--- a/baseapitest/basesvs/validation/f32/sfsrv/inc/T_FsData.h Fri Apr 23 22:02:01 2010 +0100
+++ b/baseapitest/basesvs/validation/f32/sfsrv/inc/T_FsData.h Fri Apr 23 22:08:41 2010 +0100
@@ -33,6 +33,7 @@
// EPOC includes
#include <e32std.h>
#include <f32file.h>
+#include <f32file_private.h>
#include <f32fsys.h>
// User includes
--- a/brdbootldr/ubootldr/flash_nor.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/brdbootldr/ubootldr/flash_nor.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -28,7 +28,7 @@
#include <u32hal.h>
#include "flash_nor.h"
-const TUint KFlashRetries = 1000000;
+#define KFlashRetries 1000000
#ifdef __SUPPORT_FLASH_REPRO__
_LIT(KLitThreadName,"Flash");
--- a/bsptemplate/asspandvariant/template_variant/specific/power.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/bsptemplate/asspandvariant/template_variant/specific/power.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -133,6 +133,12 @@
// 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 Fri Apr 23 22:02:01 2010 +0100
+++ b/bsptemplate/asspandvariant/template_variant/specific/uart.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -82,6 +82,8 @@
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)
//
@@ -106,6 +108,7 @@
// Lookup table to convert EPOC parity settings into hardware-specific values
//
// EXAMPLE ONLY
+
static const TUartParity Parity[3] =
{
EUartParityNone,EUartParityEven,EUartParityOdd
@@ -117,6 +120,7 @@
// Lookup table to convert EPOC stop bit values into hardware-specific values
//
// EXAMPLE ONLY
+
static const TUartStopBit StopBit[2] =
{
EUartStopBitOne,EUartStopBitTwo
@@ -128,12 +132,14 @@
// 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 Fri Apr 23 22:02:01 2010 +0100
+++ b/bsptemplate/asspandvariant/template_variant/specific/variant.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -27,8 +27,12 @@
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)
{
@@ -430,8 +434,11 @@
// TO DO: (optional)
//
// Read the restart startup mode, e.g:
- // TInt startup = (Kern::SuperPage().iHwStartupReason & KHtRestartStartupModesMask) >> KHtRestartStartupModesShift;
- // kumemput32(a1, &startup, sizeof(TInt));
+#undef USE_MODE_SHIFT_MASK
+#ifdef USE_MODE_SHIFT_MASK
+ TInt startup = (Kern::SuperPage().iHwStartupReason & KHtRestartStartupModesMask) >> KHtRestartStartupModesShift;
+ kumemput32(a1, &startup, sizeof(TInt));
+#endif
break;
}
--- a/kernel/eka/drivers/resmanus/d_resmanus.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/drivers/resmanus/d_resmanus.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -473,7 +473,7 @@
TInt r = KErrNone;
TTrackingBuffer *trackBuf = NULL;
TUint parms[4];
- TPowerResourceCb *callBack;
+ TPowerResourceCb *callBack = NULL;
DPowerResourceNotification *prn;
switch(id)
--- a/kernel/eka/euser/epoc/arm/uc_trp.cia Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/euser/epoc/arm/uc_trp.cia Fri Apr 23 22:08:41 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/include/cpudefs.h Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/include/cpudefs.h Fri Apr 23 22:08:41 2010 +0100
@@ -368,21 +368,21 @@
#define __END_ARM
#endif
-#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
+#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
#ifdef __CPU_ARM_HAS_CLZ
#if __ARM_ASSEMBLER_ISA__ >= 5
--- a/kernel/eka/include/drivers/locmedia.h Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/include/drivers/locmedia.h Fri Apr 23 22:08:41 2010 +0100
@@ -23,7 +23,7 @@
#if defined(_DEBUG) && defined(__DEMAND_PAGING__)
#define __CONCURRENT_PAGING_INSTRUMENTATION__
#endif
-#if defined(_DEBUG) && defined(__DEMAND_PAGING__)
+#ifdef __DEMAND_PAGING__
#define __DEMAND_PAGING_BENCHMARKS__
#endif
--- a/kernel/eka/include/drivers/resource.h Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/include/drivers/resource.h Fri Apr 23 22:08:41 2010 +0100
@@ -32,7 +32,7 @@
static const TUint KLongLatencyGetOffset=0x1D;
static const TUint KClassOffset=0x1C;
static const TUint KSenseOffset=0x1A;
-static const TUint KShared=0x1<<KUsageOffset;
+static const TUint KShared=0x1U<<KUsageOffset;
static const TUint KLongLatencySet=0x1<<KLongLatencySetOffset;
static const TUint KLongLatencyGet=0x1<<KLongLatencyGetOffset;
static const TUint KLogical=0x1<<KClassOffset;
--- a/kernel/eka/include/e32base.h Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/include/e32base.h Fri Apr 23 22:08:41 2010 +0100
@@ -19,6 +19,10 @@
#define __E32BASE_H__
#include <e32std.h>
+#ifdef __ARMCC__
+#pragma push
+#pragma diag_suppress 830
+#endif
/**
* Container Base Class
*/
@@ -71,8 +75,10 @@
CBase& operator=(const CBase&);
private:
};
-
-
+
+#ifdef __ARMCC__
+#pragma pop
+#endif
class CBufBase : public CBase
--- a/kernel/eka/include/e32btrace.h Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/include/e32btrace.h Fri Apr 23 22:08:41 2010 +0100
@@ -260,7 +260,7 @@
/**
Masks out the bits for the CPU ID for SMP systems (zero if present on non SMP systems)
*/
- ECpuIdMask = 0xfff<<20,
+ ECpuIdMask = 0xfffU<<20,
};
/**
--- a/kernel/eka/include/e32cmn.h Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/include/e32cmn.h Fri Apr 23 22:08:41 2010 +0100
@@ -1971,6 +1971,10 @@
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:
@@ -1981,7 +1985,9 @@
public:
TUint32 iId;
};
-
+#if defined(__ARMCC__) && __ARMCC_VERSION >= 400000
+#pragma pop
+#endif
@@ -1989,6 +1995,10 @@
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:
@@ -1999,7 +2009,9 @@
public:
TUint32 iId;
};
-
+#if defined(__ARMCC__) && __ARMCC_VERSION >= 400000
+#pragma pop
+#endif
@@ -2639,135 +2651,130 @@
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};
-
-
+ /**
+ 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
+ };
+
/**
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
@@ -2795,26 +2802,37 @@
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;
- TInt iHandleCount;
- TInt* iHandles;
- TUint32 iFlags;
- TInt iCellCount;
- TInt iTotalAllocSize;
+ 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
};
-
-
-
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
@@ -2823,127 +2841,20 @@
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);
@@ -2957,72 +2868,120 @@
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:
- 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;
+
+ /**
+ @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);
+
protected:
- 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;
+
+ // 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
friend class UserHeap;
};
-
-
-
-
class OnlyCreateWithNull;
/** @internalTechnology */
--- a/kernel/eka/include/e32ver.h Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/include/e32ver.h Fri Apr 23 22:08:41 2010 +0100
@@ -28,7 +28,7 @@
const TInt KE32MajorVersionNumber=2;
const TInt KE32MinorVersionNumber=0;
-const TInt KE32BuildVersionNumber=3061;
+const TInt KE32BuildVersionNumber=3063;
const TInt KMachineConfigurationMajorVersionNumber=1;
const TInt KMachineConfigurationMinorVersionNumber=0;
--- a/kernel/eka/include/kernel/kern_priv.h Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/include/kernel/kern_priv.h Fri Apr 23 22:08:41 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__
@@ -1522,10 +1522,10 @@
};
enum TMask
{
- EMaskFail = ETypeFail << KCSPBitsFree,
- EMaskCapsOnly = ETypeCapsOnly << KCSPBitsFree,
- EMaskSecureId = ETypeSecureId << KCSPBitsFree,
- EMaskVendorId = ETypeVendorId << KCSPBitsFree,
+ EMaskFail = TUint32 (ETypeFail) << KCSPBitsFree,
+ EMaskCapsOnly = TUint32 (ETypeCapsOnly) << KCSPBitsFree,
+ EMaskSecureId = TUint32 (ETypeSecureId) << KCSPBitsFree,
+ EMaskVendorId = TUint32 (ETypeVendorId) << KCSPBitsFree,
};
TInt Set(const TSecurityPolicy& aPolicy);
#ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
@@ -2262,7 +2262,7 @@
/********************************************
* Kernel heap
********************************************/
-class RHeapK : public RHeap
+class RHeapK : public RHybridHeap
{
public:
static RHeapK* FixedHeap(TAny* aBase, TInt aMaxLength);
@@ -2280,37 +2280,18 @@
static void CheckThreadState();
static void Fault(TInt aFault);
inline TBool CheckForSimulatedAllocFail()
- { return RHeap::CheckForSimulatedAllocFail(); }
+ { return RHybridHeap::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/nkern/nk_cpu.h Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/include/nkern/nk_cpu.h Fri Apr 23 22:08:41 2010 +0100
@@ -812,8 +812,8 @@
#define USER_MEMORY_GUARD_SAVE_WORDS 2
#define USER_MEMORY_DOMAIN 15
-#define USER_MEMORY_DOMAIN_MASK (3 << (2*USER_MEMORY_DOMAIN))
-#define USER_MEMORY_DOMAIN_CLIENT (1 << (2*USER_MEMORY_DOMAIN))
+#define USER_MEMORY_DOMAIN_MASK (3U << (2*USER_MEMORY_DOMAIN))
+#define USER_MEMORY_DOMAIN_CLIENT (1U << (2*USER_MEMORY_DOMAIN))
// Save the DACR in the named register
#define USER_MEMORY_GUARD_SAVE(save) \
--- a/kernel/eka/include/nkern/nk_trace.h Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/include/nkern/nk_trace.h Fri Apr 23 22:08:41 2010 +0100
@@ -445,7 +445,15 @@
*/
#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/kernel/arm/vfp.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/kernel/arm/vfp.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -81,3 +81,97 @@
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/ekern.mmp Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/kernel/ekern.mmp Fri Apr 23 22:08:41 2010 +0100
@@ -50,6 +50,7 @@
// we have to keep this here, and not in kern_int.mmh, because media drivers
// use the same macro name for different puposes...
macro __DEMAND_PAGING__
+macro __DEMAND_PAGING_BENCHMARKS__
#endif
--- a/kernel/eka/kernel/kern_int.mmh Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/kernel/kern_int.mmh Fri Apr 23 22:08:41 2010 +0100
@@ -61,10 +61,6 @@
macro __SUPPORT_DEMAND_PAGING_EMULATION__
#endif
-#if defined(DEMAND_PAGING) && defined(DEMAND_PAGING_BENCHMARKS)
-macro __DEMAND_PAGING_BENCHMARKS__
-#endif
-
#ifdef SYMBIAN_OLD_EXPORT_LOCATION
systeminclude ../include/kernel
#endif
--- a/kernel/eka/memmodel/epoc/direct/minit.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/memmodel/epoc/direct/minit.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -20,7 +20,6 @@
_LIT(KLitRamAlloc,"RamAlloc");
-const TInt KMaxSupervisorStackSpace=0x200000;
void M::Init1()
{
--- a/kernel/eka/memmodel/epoc/flexible/arm/xipc.cia Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/memmodel/epoc/flexible/arm/xipc.cia Fri Apr 23 22:08:41 2010 +0100
@@ -33,8 +33,11 @@
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
@@ -61,8 +64,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("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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/memmodel/epoc/flexible/arm/xipc.cpp Fri Apr 23 22:08:41 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:
+//
+
+#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 Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/memmodel/epoc/flexible/arm/xsched.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -14,6 +14,7 @@
//
#include "arm_mem.h"
+#include "mpager.h"
#define iMState iWaitLink.iSpare1
@@ -30,6 +31,18 @@
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/mmu/arm/xmmu.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/arm/xmmu.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -298,7 +298,8 @@
// we have an L1 data cache...
TUint32 csir = InternalCache::SizeIdRegister(0,0);
TUint sets = ((csir>>13)&0x7fff)+1;
- TUint ways = ((csir>>3)&0x3ff)+1;
+ TUint ways = ((csir>>3)&0x3ff);
+ ways+=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;
@@ -312,7 +313,8 @@
// we have a separate L1 instruction cache...
TUint32 csir = InternalCache::SizeIdRegister(1,0);
TUint sets = ((csir>>13)&0x7fff)+1;
- TUint ways = ((csir>>3)&0x3ff)+1;
+ TUint ways = ((csir>>3)&0x3ff);
+ ways+=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));
@@ -902,6 +904,15 @@
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 Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/maddressspace.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -245,14 +245,14 @@
{
TRACE(("DAddressSpace::FreeVirtualMemory(0x%08x,0x%08x) osAsid=%d",aAddr, aSize, iOsAsid));
Lock();
- if(iOsAsid==(TInt)KKernelOsAsid && UserGlobalVirtualAllocator.InRange(aAddr,aSize))
+ TBool global = iOsAsid==(TInt)KKernelOsAsid && UserGlobalVirtualAllocator.InRange(aAddr,aSize);
+ if(global)
UserGlobalVirtualAllocator.Free(aAddr,aSize);
else
- {
iVirtualAllocator.Free(aAddr,aSize);
+ Unlock();
+ if (!global)
AsyncClose();
- }
- Unlock();
}
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mm.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mm.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -394,7 +394,7 @@
}
-TInt MM::MemoryAddPages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, TPhysAddr* aPages)
+TInt MM::MemoryAddPages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, const TPhysAddr* aPages)
{
TRACE(("MM::MemoryAddPages(0x%08x,0x%08x,0x%08x,?)",aMemory,aIndex,aCount));
MemoryObjectLock::Lock(aMemory);
@@ -785,6 +785,30 @@
}
+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)
{
@@ -1117,5 +1141,3 @@
attr&EMemoryAttributeUseECC
);
}
-
-
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mm.h Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mm.h Fri Apr 23 22:08:41 2010 +0100
@@ -28,6 +28,7 @@
class DMemoryObject;
class DMemoryMapping;
class DMemModelThread;
+class DMemModelProcess;
class DPhysicalPinMapping;
/**
@@ -84,6 +85,9 @@
EMemoryObjectMovable but with the additional option of marking pages as
'discardable'. Discardable pages may be reclaimed (remove) by the system at
any time, this state is controlled using the functions:
+ - MM::MemoryAlloc
+ - MM::MemoryAllocContiguous
+ - MM::MemoryFree
- MM::MemoryAllowDiscard
- MM::MemoryDisallowDiscard
*/
@@ -157,7 +161,7 @@
/**
Memory object contents are to be demand paged.
*/
- EMemoryCreateDemandPaged = 1<<31
+ EMemoryCreateDemandPaged = 1U<<31
};
@@ -308,7 +312,7 @@
specified address.
@internalTechnology
*/
- EMappingCreateFixedVirtual = 1<<31
+ EMappingCreateFixedVirtual = 1U<<31
};
@@ -485,7 +489,7 @@
KErrNotSupported, if the memory object doesn't support this operation;
otherwise another of the system wide error codes.
*/
- static TInt MemoryAddPages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, TPhysAddr* aPages);
+ static TInt MemoryAddPages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, const TPhysAddr* aPages);
/**
Add a contiguous range of pages to a region in a memory object.
@@ -880,6 +884,26 @@
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.
@@ -1044,6 +1068,18 @@
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/mpager.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mpager.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -92,7 +92,7 @@
#elif defined(__CPU_X86)
-/* Need at least 6 mapped pages to guarantee to be able to execute all ARM instructions,
+/* Need at least 6 mapped pages to guarantee to be able to execute all X86 instructions,
plus enough pages for 6 page tables to map those pages, plus enough pages for the
page table info structures of those page tables.
(Worst case is (?) a MOV [X],[Y] instruction with instruction, 'X' and 'Y' all
@@ -200,8 +200,7 @@
TInt r = m.AllocRam(&pagePhys, 1,
(Mmu::TRamAllocFlags)(EMemAttNormalCached|Mmu::EAllocNoWipe|Mmu::EAllocNoPagerReclaim),
EPageDiscard);
- if(r!=KErrNone)
- __NK_ASSERT_ALWAYS(0);
+ __NK_ASSERT_ALWAYS(r == KErrNone);
MmuLock::Lock();
AddAsFreePage(SPageInfo::FromPhysAddr(pagePhys));
MmuLock::Unlock();
@@ -214,50 +213,50 @@
#ifdef _DEBUG
-TBool DPager::CheckLists()
+#ifdef FMM_PAGER_CHECK_LISTS
+TBool CheckList(SDblQueLink* aHead, TUint aCount)
{
-#if 0
- __NK_ASSERT_DEBUG(MmuLock::IsHeld());
- SDblQueLink* head = &iOldList.iA;
- TInt n = iOldCount;
- SDblQueLink* link = head;
- while(n--)
+ SDblQueLink* link = aHead;
+ while(aCount--)
{
link = link->iNext;
- if(link==head)
- return false;
+ if(link == aHead)
+ return EFalse;
}
link = link->iNext;
- if(link!=head)
- return false;
-
- head = &iYoungList.iA;
- n = iYoungCount;
- link = head;
- while(n--)
- {
- link = link->iNext;
- if(link==head)
- return false;
- }
- link = link->iNext;
- if(link!=head)
- return false;
-
-// TRACEP(("DP: y=%d o=%d f=%d",iYoungCount,iOldCount,iNumberOfFreePages));
-#endif
-// TraceCounts();
+ if(link != aHead)
+ return EFalse;
+ return ETrue;
+ }
+#endif // #ifdef FMM_PAGER_CHECK_LISTS
+
+TBool DPager::CheckLists()
+ {
+#ifdef FMM_PAGER_CHECK_LISTS
+ __NK_ASSERT_DEBUG(MmuLock::IsHeld());
+ if (!CheckList(&iOldList.iA, iOldCount))
+ return EFalse;
+ if (!CheckList(&iYoungList.iA, iYoungCount))
+ return EFalse;
+ if (!CheckList(&iOldestCleanList.iA, iOldestCleanCount))
+ return EFalse;
+ if (!CheckList(&iOldestDirtyList.iA, iOldestDirtyCount))
+ return EFalse;
+ TRACEP(("DP: y=%d o=%d oc=%d od=%d f=%d", iYoungCount, iOldCount,
+ iOldestCleanCount, iOldestDirtyCount, iNumberOfFreePages));
+ TraceCounts();
+#endif // #ifdef FMM_PAGER_CHECK_LISTS
return true;
}
void DPager::TraceCounts()
{
- TRACEP(("DP: y=%d o=%d f=%d min=%d max=%d ml=%d res=%d",
- iYoungCount,iOldCount,iNumberOfFreePages,iMinimumPageCount,
- iMaximumPageCount,iMinimumPageLimit,iReservePageCount));
+ TRACEP(("DP: y=%d o=%d oc=%d od=%d f=%d min=%d max=%d ml=%d res=%d",
+ iYoungCount, iOldCount, iOldestCleanCount, iOldestDirtyCount,
+ iNumberOfFreePages, iMinimumPageCount, iMaximumPageCount,
+ iMinimumPageLimit, iReservePageCount));
}
-
-#endif
+#endif //#ifdef _DEBUG
TBool DPager::HaveTooManyPages()
@@ -1292,6 +1291,10 @@
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
}
@@ -1984,7 +1987,7 @@
MmuLock::Lock();
- __NK_ASSERT_ALWAYS(iYoungOldRatio!=0);
+ __NK_ASSERT_ALWAYS(iYoungOldRatio);
// Make sure aMinimumPageCount is not less than absolute minimum we can cope with...
iMinimumPageLimit = iMinYoungPages * (1 + iYoungOldRatio) / iYoungOldRatio
@@ -1997,9 +2000,8 @@
aMaximumPageCount=aMinimumPageCount;
// Increase iMaximumPageCount?
- TInt extra = aMaximumPageCount-iMaximumPageCount;
- if(extra>0)
- iMaximumPageCount += extra;
+ if(aMaximumPageCount > iMaximumPageCount)
+ iMaximumPageCount = aMaximumPageCount;
// Reduce iMinimumPageCount?
TInt spare = iMinimumPageCount-aMinimumPageCount;
@@ -2126,6 +2128,100 @@
}
+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...
@@ -2837,15 +2933,15 @@
EXPORT_C TInt DDemandPagingLock::Lock(DThread* aThread, TLinAddr aStart, TInt aSize)
{
// TRACEP(("DDemandPagingLock[0x%08x]::Lock(0x%08x,0x%08x,0x%08x)",this,aThread,aStart,aSize));
- if(iLockedPageCount)
- __NK_ASSERT_ALWAYS(0); // lock already used
+ __NK_ASSERT_ALWAYS(!iLockedPageCount); // lock already used
// calculate the number of pages that need to be locked...
TUint mask=KPageMask;
TUint offset=aStart&mask;
TInt numPages = (aSize+offset+mask)>>KPageShift;
- if(numPages>iMaxPageCount)
- __NK_ASSERT_ALWAYS(0);
+
+ // Should never be asked to lock more pages than are allocated to this object.
+ __NK_ASSERT_ALWAYS(numPages <= iMaxPageCount);
NKern::ThreadEnterCS();
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mpager.h Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mpager.h Fri Apr 23 22:08:41 2010 +0100
@@ -21,6 +21,7 @@
#ifndef MPAGER_H
#define MPAGER_H
+#include "mmu.h"
#include <kern_priv.h>
/**
@@ -57,6 +58,11 @@
MmuLock::Unlock();
return ret;
}
+
+ FORCE_INLINE TUint MinimumPageCount()
+ {
+ return iMinimumPageCount;
+ }
FORCE_INLINE void SetWritable(SPageInfo& aPageInfo)
{
@@ -143,6 +149,20 @@
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);
--- a/kernel/eka/memmodel/epoc/flexible/mmu/x86/xmmu.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/x86/xmmu.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -546,6 +546,15 @@
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/moving/arm/xmmu.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/memmodel/epoc/moving/arm/xmmu.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -1275,23 +1275,16 @@
}
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);
+
+#if defined(__CPU_XSCALE__) || defined(__CPU_SA1__)
const TUint AWBR=(EMapAttrAltCacheWBRA>>12);
-const TUint AWBW=(EMapAttrAltCacheWBWA>>12);
-const TUint MAXC=(EMapAttrL1CachedMax>>12);
-
-const TUint L2UN=(EMapAttrL2Uncached>>12);
+#endif
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
@@ -1315,9 +1308,17 @@
{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/multiple/arm/xmmu.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/memmodel/epoc/multiple/arm/xmmu.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -715,7 +715,8 @@
// we have an L1 data cache...
TUint32 csir = InternalCache::SizeIdRegister(0,0);
TUint sets = ((csir>>13)&0x7fff)+1;
- TUint ways = ((csir>>3)&0x3ff)+1;
+ TUint ways = ((csir>>3)&0x3ff);
+ ways+=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;
@@ -729,7 +730,8 @@
// we have a separate L1 instruction cache...
TUint32 csir = InternalCache::SizeIdRegister(1,0);
TUint sets = ((csir>>13)&0x7fff)+1;
- TUint ways = ((csir>>3)&0x3ff)+1;
+ TUint ways = ((csir>>3)&0x3ff);
+ ways+=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/memmodel.mmp Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/memmodel/memmodel.mmp Fri Apr 23 22:08:41 2010 +0100
@@ -109,8 +109,8 @@
#ifdef MARM
userinclude ../memmodel/epoc/flexible/mmu/arm
sourcepath ../memmodel/epoc/flexible/arm
-source xinit.cpp xipc.cia xkernel.cpp xkernel.cia
-source xsched.cpp xsched.cia
+source xinit.cpp xipc.cpp xipc.cia
+source xkernel.cpp xkernel.cia xsched.cpp xsched.cia
sourcepath ../memmodel/epoc/flexible/mmu/arm
source xmmu.cpp xmmu.cia
#endif //MARM
--- a/kernel/eka/nkern/nkern.mmp Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/nkern/nkern.mmp Fri Apr 23 22:08:41 2010 +0100
@@ -71,8 +71,12 @@
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/release.txt Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/release.txt Fri Apr 23 22:08:41 2010 +0100
@@ -1,3 +1,24 @@
+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)
--- a/kernel/eka/rombuild/mmctest_load.oby Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/rombuild/mmctest_load.oby Fri Apr 23 22:08:41 2010 +0100
@@ -19,6 +19,7 @@
#define BASE_ROM
#define REBOOT_DRIVER
+#define MMCLOADER_ROM
#include <rom\##VARIANT##\header.iby>
--- a/kernel/eka/rombuild/mmctest_load_rel.oby Fri Apr 23 22:02:01 2010 +0100
+++ b/kernel/eka/rombuild/mmctest_load_rel.oby Fri Apr 23 22:08:41 2010 +0100
@@ -19,6 +19,7 @@
#define BASE_ROM
#define REBOOT_DRIVER
+#define MMCLOADER_ROM
#include <rom\##VARIANT##\header.iby>
--- a/kerneltest/e32test/active/t_messge.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/active/t_messge.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -125,14 +125,14 @@
// CTestServer functions
-CTestServer::CTestServer(TInt aPriority)
+EXPORT_C CTestServer::CTestServer(TInt aPriority)
//
// Constructor - sets name
//
: CServer2(aPriority)
{}
-CSession2* CTestServer::NewSessionL(const TVersion& aVersion,const RMessage2& /*aMessage*/) const
+EXPORT_C CSession2* CTestServer::NewSessionL(const TVersion& aVersion,const RMessage2& /*aMessage*/) const
//
// Virtual fn - checks version supported and creates a CTestSession
//
@@ -283,7 +283,7 @@
return KErrNone;
}
-void CTestSession::ServiceL(const RMessage2& aMessage)
+EXPORT_C void CTestSession::ServiceL(const RMessage2& aMessage)
//
// Virtual message-handler
//
--- a/kerneltest/e32test/bench/t_dhry.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/bench/t_dhry.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -383,9 +383,8 @@
TRequestStatus timerStat;
timer.After(timerStat,20*1000000);
User::WaitForRequest(timerStat,keyStat);
- TInt key = 0;
if(keyStat!=KRequestPending)
- key = test.Console()->KeyCode();
+ (void)test.Console()->KeyCode();
timer.Cancel();
test.Console()->ReadCancel();
User::WaitForAnyRequest();
--- a/kerneltest/e32test/bench/t_exec.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/bench/t_exec.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -18,9 +18,7 @@
#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"));
@@ -36,10 +34,9 @@
speedCount=0;
semmy.Signal();
TUint myChar='a';
- TUint r;
for (TUint i=0;i<0xffffffff;i++)
{
- r=User::UpperCase(myChar);
+ User::UpperCase(myChar);
speedCount++;
}
return(KErrNone);
--- a/kerneltest/e32test/buffer/t_buf.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/buffer/t_buf.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -1359,7 +1359,14 @@
#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"));
@@ -1568,6 +1575,10 @@
// 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));
@@ -1598,6 +1609,9 @@
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);
--- a/kerneltest/e32test/buffer/t_collate.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/buffer/t_collate.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -100,6 +100,8 @@
test(order == desired_order);
}
+#undef USE_SWEDISH_TABLE
+#ifdef USE_SWEDISH_TABLE
static const TUint32 TheSwedishKey[] =
{
0x8f60109,0x8f70109,0x8f80109,0x8f60121,0x8f70121,0x8f80121,0x8dd0109,0x8dd0121,
@@ -128,6 +130,7 @@
static const TCollationMethod TheSwedishMethod =
{ 0, NULL, &TheSwedishTable, 0 };
+#endif
static const TCollationMethod TheSwapCaseMethod =
{ 0, NULL, NULL, TCollationMethod::ESwapCase };
@@ -33137,7 +33140,10 @@
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
- // test_unicode_collation(_L("\xe5ngstr\xf6m"),_L("zoo"),1,3,&TheSwedishMethod); // a-ring after z in Sweden
+#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("Antidisestablishmentarian"),_L("antidisestablishmentariac"),1); // long strings that don't have identical prefixes
test_unicode_collation(_L("\xFF86"),_L(""),1);
--- a/kerneltest/e32test/buffer/t_que.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/buffer/t_que.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -1762,14 +1762,12 @@
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 Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/buffer/t_regn.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -641,7 +641,6 @@
RRegion rgnErr,rgnErr2;
RRegion rgn;
TRect rect(1,2,3,4),rect2;
- const TRect* rList;
TPoint pnt;
rgnErr.ForceError();
@@ -711,7 +710,6 @@
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 Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/buffer/t_sque.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -940,14 +940,12 @@
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/demandpaging/t_svrpinning.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/demandpaging/t_svrpinning.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -260,7 +260,7 @@
return r;
}
-void CTestSession::ServiceL(const RMessage2& aMessage)
+EXPORT_C void CTestSession::ServiceL(const RMessage2& aMessage)
//
// Virtual message-handler
//
--- a/kerneltest/e32test/device/t_commsk.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/device/t_commsk.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -48,9 +48,6 @@
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
{
@@ -75,6 +72,7 @@
const TText* iName;
};
+/*
const TSpeedAndName KSpeeds[]=
{
{KCapsBps50,EBps50,_S("50")},
@@ -83,8 +81,7 @@
{KCapsBps19200,EBps19200,_S("19200")},
{KCapsBps57600,EBps57600,_S("57600")},
{KCapsBps115200,EBps115200,_S("115200")},
- };
-
+ };*/
class TFrameAndName
{
public:
@@ -93,7 +90,7 @@
TParity iParity;
const TText* iName;
};
-
+/*
const TFrameAndName KFrameTypes[]=
{
{EData8,EStop1,EParityNone,_S("8,N,1")},
@@ -111,7 +108,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 Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/device/t_dtenot.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -25,11 +25,6 @@
#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 Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/device/t_sirco2.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -44,7 +44,6 @@
#define FIND_NAME _L("Comm.*")
-const TInt KUnit0=0;
const TInt KUnit1=1;
const TInt KUnit2=2;
--- a/kerneltest/e32test/dll/t_dll1.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/dll/t_dll1.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -17,7 +17,6 @@
#include "t_dll.h"
-const TInt KHeapSize=0x2000;
class TlsData
{
--- a/kerneltest/e32test/dll/t_dll2.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/dll/t_dll2.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -18,8 +18,6 @@
#include "t_dll.h"
-const TInt KHeapSize=0x2000;
-
class TlsData
{
public:
--- a/kerneltest/e32test/group/t_drtaeabi.mmp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/group/t_drtaeabi.mmp Fri Apr 23 22:08:41 2010 +0100
@@ -16,7 +16,7 @@
TARGET t_drtaeabi.dll
TARGETTYPE dll
-
+armfpu softvfp
SOURCEPATH ../../../kernel/eka/compsupp/rvct
SOURCE aeabidiv0.cpp
@@ -44,13 +44,15 @@
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
+#if defined ARMCC_3_1 || defined ARMCC_4_0
#ifdef MARM_ARMV5
ARMLIBS c_5.l h_5.l cpprt_5.l
#else
--- a/kerneltest/e32test/heap/t_hcomp.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/heap/t_hcomp.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -39,7 +39,12 @@
if (heap1==NULL)
return KErrNoMemory;
- FOREVER
+ // 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)
{
TUint8* ptr=(TUint8*)heap1->Alloc(heapsize); // fail, compress, fail
User::After(1000); // quite soon
--- a/kerneltest/e32test/lffs/loadlffs.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/lffs/loadlffs.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -24,10 +24,9 @@
RFormat format;
TInt count;
- TInt r;
RDebug::Print(_L("Format LFFS drive %S\r\n"), &drive);
- r = format.Open(TheFs, drive, EHighDensity, count);
+ format.Open(TheFs, drive, EHighDensity, count);
while (count)
{
--- a/kerneltest/e32test/math/t_i64.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/math/t_i64.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -138,7 +138,7 @@
{
while (aMod >= (t << 31))
{
- aDiv += static_cast<TUint32>(1 << 31);
+ aDiv += static_cast<TUint32>(1U << 31);
aMod -= t << 31;
}
}
--- a/kerneltest/e32test/math/t_r32.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/math/t_r32.cpp Fri Apr 23 22:08:41 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/misc/t_svr3.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/misc/t_svr3.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -578,7 +578,8 @@
// 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
-TInt UserHeap::SetupThreadHeap(TBool aNotFirst, SStdEpocThreadCreateInfo& aInfo)
+
+EXPORT_C TInt UserHeap::SetupThreadHeap(TBool aNotFirst, SStdEpocThreadCreateInfo& aInfo)
{
TInt r = KErrNone;
if (!aInfo.iAllocator && aInfo.iHeapInitialSize>0)
--- a/kerneltest/e32test/misc/t_svr6.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/misc/t_svr6.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -706,7 +706,8 @@
// 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
-TInt UserHeap::SetupThreadHeap(TBool aNotFirst, SStdEpocThreadCreateInfo& aInfo)
+
+EXPORT_C TInt UserHeap::SetupThreadHeap(TBool aNotFirst, SStdEpocThreadCreateInfo& aInfo)
{
TInt r = KErrNone;
if (!aInfo.iAllocator && aInfo.iHeapInitialSize>0)
--- a/kerneltest/e32test/misc/t_tmout.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/misc/t_tmout.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -132,12 +132,11 @@
RandomSignalInterval = interval;
RandomSignalCount = interval;
- FOREVER
+ volatile TInt forever = 1;
+ while(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 Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/misc/t_uid.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -45,7 +45,6 @@
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 Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/misc/t_ymodemz.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -211,7 +211,6 @@
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)
@@ -228,7 +227,6 @@
{
// after reading first block, process the header
ProcessHeader(z);
- c=User::NTickCount();
}
}
test.Printf(_L("\nWait for thread to exit\n"));
--- a/kerneltest/e32test/mmu/d_demandpaging.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/mmu/d_demandpaging.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -158,7 +158,7 @@
case RDemandPagingTestLdd::ESetRealtimeTrace:
{
#if defined(_DEBUG)
- TUint32 bit = TUint32(1<<(KREALTIME&31));
+ TUint32 bit = TUint32(1U<<(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_memorytest.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/mmu/d_memorytest.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -42,7 +42,7 @@
private:
TInt TestAllocZerosMemory();
TInt TestReAllocZerosMemory();
- TInt AllocTest1();
+ TInt AllocTest1(TInt aSize);
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&~(1<<KPANIC);
+ Kern::CurrentThread().iDebugMask = debugMask&~(1U<<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&(1<<KPANIC))
+ if(debugMask&(1U<<KPANIC))
old = true;
if(a1)
- debugMask |= (1<<KPANIC);
+ debugMask |= (1U<<KPANIC);
else
- debugMask &= ~(1<<KPANIC);
+ debugMask &= ~(1U<<KPANIC);
thread.iDebugMask = debugMask;
#endif
return old;
@@ -434,29 +434,32 @@
{
TInt count = 100;
TInt r = KErrNotSupported;
+ TInt size = 256;
do { //re-try up to 100 times if memory conditions are not correct
- r=AllocTest1();
- } while(((r == KErrNoMemory)||(r == KErrUnknown)) && --count);
+ r=AllocTest1(size);
+ size -= 2;
+ } while(((r == KErrNoMemory)||(r == KErrUnknown)) && --count );
return r;
}
-TInt DMemoryTestChannel::AllocTest1()
+TInt DMemoryTestChannel::AllocTest1(TInt aSize)
{
- const TInt KSize = 256;
TInt err = KErrNone;
- TUint8* mem1 = (TUint8*)Kern::Alloc(KSize);
+ TUint8* mem1 = (TUint8*)Kern::Alloc(aSize);
if (!mem1)
return KErrNoMemory;
- memset(mem1, KSize, 0xff);
+ memset(mem1, 0xff, aSize);
Kern::Free(mem1);
- TUint8* mem2 = (TUint8*)Kern::Alloc(KSize);
+ TUint8* mem2 = (TUint8*)Kern::Alloc(aSize);
if (!mem2)
return KErrNoMemory;
+
if (mem1 != mem2)
err = KErrUnknown; // Test inconclusive, can retry
- for (TInt i = 0 ; i<KSize && err==KErrNone; ++i)
+
+ for (TInt i = 0 ; i<aSize && err==KErrNone; ++i)
{
if (mem2[i] != 0)
FAIL_ALLOC_TEST(1, i, mem2[i]);
@@ -498,7 +501,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 acllocate blocks where the size we get is the size we ask for - this
+// We only allocate 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);
@@ -523,14 +526,19 @@
Kern::Free(mem2);
return KErrUnknown; // Don't expect move on shrink
}
- mem2 = (TUint8*)Kern::ReAlloc(mem1, KSize); // 3
+ //
+ // With DL allocator growth into original area cannot be expected !
+ //
+// 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)
{
@@ -564,27 +572,48 @@
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; // Expect mem3 higher than mem2
+ return KErrUnknown+2; // 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;
+ return KErrNoMemory;
+ //
+ // The following exceptions are not possible with DL allocator
+ //
+/*
+ if (mem3 <= (mem2 + KSmallSize))
+ return KErrUnknown+2; // Expect mem3 higher than mem2
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 Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/mmu/d_sharedchunk.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -697,7 +697,7 @@
TInt addr = kernAddr+i1;
#ifdef _DEBUG
TInt debugMask = Kern::CurrentThread().iDebugMask;
- Kern::CurrentThread().iDebugMask = debugMask&~(1<<KPANIC);
+ Kern::CurrentThread().iDebugMask = debugMask&~(1U<<KPANIC);
#endif
XTRAP(r, XT_DEFAULT,
if(aFunction==RSharedChunkLdd::ECheckMemory)
--- a/kerneltest/e32test/mmu/t_chunk3.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/mmu/t_chunk3.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -20,7 +20,6 @@
#include "../misc/prbs.h"
RTest test(_L("T_CHUNK3"));
-const TInt KHeapSize=4096;
GLDEF_C TInt E32Main()
{
--- a/kerneltest/e32test/mmu/t_mmubm.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/mmu/t_mmubm.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -70,9 +70,8 @@
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/nkern/t_nktrace.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/nkern/t_nktrace.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -151,9 +151,7 @@
TRequestStatus timerStat;
timer.After(timerStat,10*1000000);
User::WaitForRequest(timerStat,keyStat);
- TInt key;
- if(keyStat!=KRequestPending)
- key = test.Console()->KeyCode();
+ (void)test.Console()->KeyCode();
timer.Cancel();
test.Console()->ReadCancel();
User::WaitForAnyRequest();
--- a/kerneltest/e32test/nkernsa/threadbasic.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/nkernsa/threadbasic.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -413,7 +413,7 @@
}
}
}
- TEST_RESULT(RANGE_CHECK(0, pointA, delta), "pointA");
+ TEST_RESULT(RANGE_LQ(pointA, delta), "pointA");
if (aCpu != this_cpu)
{
TEST_RESULT(RANGE_CHECK(TUint32(aSpin1), pointB, TUint32(aSpin1)+delta), "pointB");
--- a/kerneltest/e32test/nkernsa/utils.h Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/nkernsa/utils.h Fri Apr 23 22:08:41 2010 +0100
@@ -100,6 +100,7 @@
#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/pccd/t_atadrv.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/pccd/t_atadrv.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -37,7 +37,12 @@
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")
@@ -263,10 +268,13 @@
test(info.iDriveAtt==(TUint)(KDriveAttLocal|KDriveAttRemovable));
test(info.iMediaAtt==KMediaAttFormattable);
test(info.iFileSystemId==KDriveFileSysFAT);
-// TSupplyInfoV1Buf supply2;
-// test(UserHal::SupplyInfo(supply2)==KErrNone);
-// if (mediaChangeSupported)
-// test(supply2().iCurrentConsumptionMilliAmps==supply1().iCurrentConsumptionMilliAmps+KAtaIdleCurrentInMilliAmps); // Snowball idle current is zero
+#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
b.Format(_L("ATA drive: Sector RdWr(%d)"),KAtaSectorSize);
test.Next(b);
@@ -450,8 +458,11 @@
test.Next(_L("ATA drive: Caps following media change"));
test(theAtaDrive.Caps(infoPckg)==KErrNone);
test(info.iType==EMediaHardDisk);
-// test(UserHal::SupplyInfo(supply2)==KErrNone);
-// test(supply2().iCurrentConsumptionMilliAmps==supply1().iCurrentConsumptionMilliAmps+KAtaIdleCurrentInMilliAmps);
+#undef USE_IDLE_CURRENT
+#ifdef USE_IDLE_CURRENT
+ test(UserHal::SupplyInfo(supply2)==KErrNone);
+ test(supply2().iCurrentConsumptionMilliAmps==supply1().iCurrentConsumptionMilliAmps+KAtaIdleCurrentInMilliAmps);
+#endif
test.Next(_L("ATA drive: Caps while OOM"));
TInt err=KErrNoMemory;
--- a/kerneltest/e32test/pccd/t_idrv.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/pccd/t_idrv.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -44,7 +44,9 @@
const TInt KTestDriveLen=0x00040000; //256K
const TInt KSmallDriveInc=0x00000400; //1K
+#if defined (__WINS__)
const TInt KBigDriveLen=0x00100000; //1M - WINS
+#endif
const TInt KTestBufLen=256;
--- a/kerneltest/e32test/pccd/t_pccdsr.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/pccd/t_pccdsr.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -32,7 +32,6 @@
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 Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/pccd/t_setkey.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -66,8 +66,12 @@
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
}
--- a/kerneltest/e32test/personality/example/main.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/personality/example/main.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -676,7 +676,6 @@
random_isr_msg* m;
unsigned extra = 1;
unsigned count = 1;
- int r;
if (!(n%11))
++count;
if (!(n%13))
@@ -688,7 +687,7 @@
m->random_isr_number = n;
extra *= n;
m->extra = extra;
- r = send_msg(L1_TASK, &m->header);
+ send_msg(L1_TASK, &m->header);
}
if (random_sem_signal_count && !--random_sem_signal_count)
{
--- a/kerneltest/e32test/pipe/t_pipe.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/pipe/t_pipe.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -789,7 +789,6 @@
// My VID and SID
_LIT_VENDOR_ID(MyVID,0x70000001);
-
void TestPipesPermissionCheck() {
RProcess proc;
--- a/kerneltest/e32test/realtime/t_lat2.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/realtime/t_lat2.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -110,13 +110,14 @@
SLatencyResults results;
l.Start();
- FOREVER
+ volatile TInt forever = 1;
+ while(forever)
{
User::WaitForAnyRequest();
l.GetResults(results);
Latencies.Update(results);
}
- return r;
+ return 0;
}
void GetLatencies(SFullLatencyResults& aResults)
--- a/kerneltest/e32test/resourceman/t_rescontrolcli.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/resourceman/t_rescontrolcli.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -4241,6 +4241,10 @@
{
test.Title();
test.Start(_L("Testing Resource Manager...\n"));
+ //
+ test.Printf(_L("TEST SKIPPED UNTIL FIX FOR DEF145087 IS AVAILABLE TO PREVENT CRASHING\n"));
+ test(0);
+ //
test.Next(_L("Load Physical device"));
#ifndef PRM_ENABLE_EXTENDED_VERSION
r = User::LoadPhysicalDevice(KPddFileName);
--- a/kerneltest/e32test/secure/t_platsecconfig.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/secure/t_platsecconfig.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -473,9 +473,8 @@
TRequestStatus timerStat;
timer.After(timerStat,20*1000000);
User::WaitForRequest(timerStat,keyStat);
- TInt key = 0;
if(keyStat!=KRequestPending)
- key = test.Console()->KeyCode();
+ (void)test.Console()->KeyCode();
timer.Cancel();
test.Console()->ReadCancel();
User::WaitForAnyRequest();
--- a/kerneltest/e32test/secure/t_sdrivers.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/secure/t_sdrivers.cpp Fri Apr 23 22:08:41 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("TestGetCapsThread"),TestGetCapsThread,KDefaultStackSize,0x2000,0x2000,(TAny*)kernelPtr);
+ r = thread.Create(_L("TestGetCapsThread2"),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)
- key = test.Console()->KeyCode();
+ (void)test.Console()->KeyCode();
+
timer.Cancel();
test.Console()->ReadCancel();
User::WaitForAnyRequest();
--- a/kerneltest/e32test/secure/t_shal.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/secure/t_shal.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -258,9 +258,8 @@
TRequestStatus timerStat;
timer.After(timerStat,20*1000000);
User::WaitForRequest(timerStat,keyStat);
- TInt key = 0;
if(keyStat!=KRequestPending)
- key = test.Console()->KeyCode();
+ (void)test.Console()->KeyCode();
timer.Cancel();
test.Console()->ReadCancel();
User::WaitForAnyRequest();
--- a/kerneltest/e32test/secure/t_sobject.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/secure/t_sobject.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -55,6 +55,7 @@
//
//
+#define __E32TEST_EXTENSION__
#include <e32test.h>
#include <e32msgqueue.h>
#include <f32file.h>
@@ -238,11 +239,6 @@
{
}
-const TInt KTestDataMaxLength8 = 20;
-const TInt KTestDataMaxLength16 = 40;
-_LIT8(KTestData8,"12345678");
-_LIT16(KTestData16,"1234567890123456");
-_LIT(KTestPanicCategory,"TEST PANIC");
void CTestSession::ServiceL(const RMessage2& aMessage)
{
@@ -288,7 +284,6 @@
object.Close();
return;
}
- break;
case CTestSession::ETestSemaphore:
{
@@ -318,7 +313,6 @@
object.Close();
return;
}
- break;
case CTestSession::ETestMsgQueue:
{
@@ -348,7 +342,7 @@
object.Close();
return;
}
- break;
+
case CTestSession::ETestCondVar:
{
@@ -378,7 +372,7 @@
object.Close();
return;
}
- break;
+
case CTestSession::ETestChunk:
{
@@ -408,7 +402,7 @@
object.Close();
return;
}
- break;
+
case CTestSession::ETestChunkAdjust:
{
@@ -624,15 +618,13 @@
void TestPhysicalDevices()
{
TFullName name;
- TInt r;
-
test.Start(_L("Test find named object"));
TFindPhysicalDevice find(_L("*"));
- test((r=find.Next(name))==KErrNone);
+ test((find.Next(name))==KErrNone);
test.Next(_L("Try open found object"));
RTestHandle testObject;
- test((r=testObject.Open(find))==PlatSecProcessIsolationError);
+ test((testObject.Open(find))==PlatSecProcessIsolationError);
testObject.Close();
test.End();
@@ -642,27 +634,26 @@
void TestLogicalDevices()
{
- TFullName name;
- TInt r;
+ TFullName name;
RDevice device;
test.Start(_L("Test find named object"));
TFindLogicalDevice find(_L("*"));
- test((r=find.Next(name))==KErrNone);
+ test((find.Next(name))==KErrNone);
test.Next(_L("Test open found object"));
- test((r=device.Open(find))==KErrNone);
+ test((device.Open(find))==KErrNone);
test.Next(_L("Test duplicate object in other thread"));
- test((r=DuplicateInOtherThread(device))==KErrNone);
+ test((DuplicateInOtherThread(device))==KErrNone);
test.Next(_L("Test duplicate object in other process"));
- test((r=DuplicateInOtherProcess(device))==KErrNone);
+ test((DuplicateInOtherProcess(device))==KErrNone);
device.Close();
test.Next(_L("Test open device by name"));
- test((r=device.Open(name))==KErrNone);
+ test((device.Open(name))==KErrNone);
device.Close();
test.End();
@@ -673,15 +664,13 @@
void TestLibraries()
{
TFullName name;
- TInt r;
-
test.Start(_L("Test find named object"));
TFindLibrary find(_L("*"));
- test((r=find.Next(name))==KErrNone);
+ test((find.Next(name))==KErrNone);
test.Next(_L("Try open found object"));
RTestHandle testObject;
- test((r=testObject.Open(find))==PlatSecProcessIsolationError);
+ test((testObject.Open(find))==PlatSecProcessIsolationError);
testObject.Close();
test.End();
@@ -692,28 +681,27 @@
void TestServers()
{
TFullName name;
- TInt r;
RServer2 localObject(Servers[EAnonymousServer]);
test.Start(_L("Test find named object"));
TFindServer find(ServerName(EMainServer));
- test((r=find.Next(name))==KErrNone);
+ test((find.Next(name))==KErrNone);
test.Next(_L("Try open found object"));
RTestHandle testObject;
- test((r=testObject.Open(find))==KErrPermissionDenied);
+ test((testObject.Open(find))==KErrPermissionDenied);
test.Next(_L("Test duplicate named server in other thread"));
- test((r=Session.Send(CTestSession::ETestServerDuplicateInThread))==KErrNone);
+ test((Session.Send(CTestSession::ETestServerDuplicateInThread))==KErrNone);
test.Next(_L("Try duplicate named server in other process"));
- test((r=Session.Send(CTestSession::ETestServerDuplicateInProcess))==KErrPermissionDenied);
+ test((Session.Send(CTestSession::ETestServerDuplicateInProcess))==KErrPermissionDenied);
test.Next(_L("Test duplicate unnamed server in other thread"));
- test((r=DuplicateInOtherThread(localObject))==KErrNone);
+ test((DuplicateInOtherThread(localObject))==KErrNone);
test.Next(_L("Try duplicate unnamed server in other process"));
- test((r=DuplicateInOtherProcess(localObject))==KErrPermissionDenied);
+ test((DuplicateInOtherProcess(localObject))==KErrPermissionDenied);
test.End();
}
@@ -722,32 +710,31 @@
void TestProcesses()
{
- TFullName name;
- TInt r;
+ TFullName name;
RProcess process;
test.Start(_L("Test find named object"));
TFindProcess find(_L("EKern*"));
- test((r=find.Next(name))==KErrNone);
+ test((find.Next(name))==KErrNone);
test.Next(_L("Test open found object"));
- test((r=process.Open(find))==KErrNone);
+ test((process.Open(find))==KErrNone);
test.Next(_L("Test duplicate object in other thread"));
- test((r=DuplicateInOtherThread(process))==KErrNone);
+ test((DuplicateInOtherThread(process))==KErrNone);
test.Next(_L("Test duplicate object in other process"));
- test((r=DuplicateInOtherProcess(process))==KErrNone);
+ test((DuplicateInOtherProcess(process))==KErrNone);
process.Close();
test.Next(_L("Test open process by name"));
- test((r=process.Open(name))==KErrNone);
+ test((process.Open(name))==KErrNone);
TProcessId id=process.Id();
process.Close();
test.Next(_L("Test open process by id"));
- test((r=process.Open(id))==KErrNone);
+ test((process.Open(id))==KErrNone);
test(name==process.FullName());
process.Close();
@@ -759,64 +746,63 @@
void TestThreads()
{
TFullName name;
- TInt r;
-
+
test.Start(_L("Creating threads"));
RThread globalObject;
RThread localObject;
RThread testObject;
- 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((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.Next(_L("Test find named thread"));
TFindThread find(globalObject.FullName());
- test((r=find.Next(name))==KErrNone);
+ test((find.Next(name))==KErrNone);
test.Next(_L("Test open found object"));
- test((r=testObject.Open(find))==KErrNone);
+ test((testObject.Open(find))==KErrNone);
testObject.Close();
test.Next(_L("Check can't find unnamed thread"));
TName objectName(localObject.FullName());
find.Find(objectName);
- test((r=find.Next(name))==PlatSecFindError);
+ test((find.Next(name))==PlatSecFindError);
test.Next(_L("Test open named thread by name"));
- test((r=testObject.Open(globalObject.FullName()))==KErrNone);
+ test((testObject.Open(globalObject.FullName()))==KErrNone);
testObject.Close();
test.Next(_L("Check can't open unnamed thread by name"));
- test((r=testObject.Open(localObject.FullName()))==PlatSecFindError);
+ test((testObject.Open(localObject.FullName()))==PlatSecFindError);
testObject.Close();
test.Next(_L("Check can't open with no name"));
- test((r=testObject.Open(KNullDesC))==KErrNotFound);
+ test((testObject.Open(KNullDesC))==KErrNotFound);
testObject.Close();
test.Next(_L("Test open named thread by id (in same process)"));
- test((r=testObject.Open(globalObject.Id()))==KErrNone);
+ test((testObject.Open(globalObject.Id()))==KErrNone);
testObject.Close();
test.Next(_L("Test open named thread by id (in other process)"));
- test((r=OpenThreadByIdInOtherProcess(globalObject.Id()))==KErrNone);
+ test((OpenThreadByIdInOtherProcess(globalObject.Id()))==KErrNone);
test.Next(_L("Test open unnamed thread by id (in same process)"));
- test((r=testObject.Open(localObject.Id()))==KErrNone);
+ test((testObject.Open(localObject.Id()))==KErrNone);
test.Next(_L("Check can't open unnamed thread by id (in other process)"));
- test((r=OpenThreadByIdInOtherProcess(localObject.Id()))==PlatSecProcessIsolationError);
+ test((OpenThreadByIdInOtherProcess(localObject.Id()))==PlatSecProcessIsolationError);
test.Next(_L("Test duplicate named thread in other process"));
- test((r=DuplicateInOtherProcess(globalObject))==KErrNone);
+ test((DuplicateInOtherProcess(globalObject))==KErrNone);
test.Next(_L("Check can't duplicate unnamed thread in other process"));
- test((r=DuplicateInOtherProcess(localObject))==PlatSecProcessIsolationError);
+ test((DuplicateInOtherProcess(localObject))==PlatSecProcessIsolationError);
test.Next(_L("Test duplicate named thread in other thread"));
- test((r=DuplicateInOtherThread(globalObject))==KErrNone);
+ test((DuplicateInOtherThread(globalObject))==KErrNone);
test.Next(_L("Test duplicate unnamed thread in other thead"));
- test((r=DuplicateInOtherThread(localObject))==KErrNone);
+ test((DuplicateInOtherThread(localObject))==KErrNone);
test.Next(_L("Closing threads"));
globalObject.Close();
@@ -830,59 +816,58 @@
void TestChunks()
{
TFullName name;
- TInt r;
-
+
test.Start(_L("Creating chunks"));
RChunk globalObject;
RChunk localObject;
RChunk testObject;
- test((r=globalObject.CreateGlobal(_L("T_SOBJECT-test-global-chunk"),4096,1024*1024))==KErrNone);
- test((r=localObject.CreateLocal(4096,1024*1024))==KErrNone);
+ test((globalObject.CreateGlobal(_L("T_SOBJECT-test-global-chunk"),4096,1024*1024))==KErrNone);
+ test((localObject.CreateLocal(4096,1024*1024))==KErrNone);
test.Next(_L("Test find global object"));
TFindChunk find(globalObject.FullName());
- test((r=find.Next(name))==KErrNone);
+ test((find.Next(name))==KErrNone);
test.Next(_L("Test open found object"));
- test((r=testObject.Open(find))==KErrNone);
+ test((testObject.Open(find))==KErrNone);
testObject.Close();
test.Next(_L("Check can't find local object"));
TName objectName(localObject.FullName());
find.Find(objectName);
- test((r=find.Next(name))==PlatSecFindError);
+ test((find.Next(name))==PlatSecFindError);
test.Next(_L("Test open with null name"));
- test((r=testObject.OpenGlobal(KNullDesC,ETrue))==KErrNotFound);
+ test((testObject.OpenGlobal(KNullDesC,ETrue))==KErrNotFound);
testObject.Close();
test.Next(_L("Test open global object by name"));
- test((r=testObject.OpenGlobal(globalObject.FullName(),ETrue))==KErrNone);
+ test((testObject.OpenGlobal(globalObject.FullName(),ETrue))==KErrNone);
testObject.Close();
test.Next(_L("Check can't open local object by name"));
- test((r=testObject.OpenGlobal(localObject.FullName(),ETrue))==PlatSecFindError);
+ test((testObject.OpenGlobal(localObject.FullName(),ETrue))==PlatSecFindError);
testObject.Close();
test.Next(_L("Test duplicate global object in other process"));
- test((r=DuplicateInOtherProcess(globalObject))==KErrNone);
+ test((DuplicateInOtherProcess(globalObject))==KErrNone);
test.Next(_L("Check can't duplicate local object in other process"));
- test((r=DuplicateInOtherProcess(localObject))==PlatSecProcessIsolationError);
+ test((DuplicateInOtherProcess(localObject))==PlatSecProcessIsolationError);
test.Next(_L("Test duplicate global object in other thread"));
- test((r=DuplicateInOtherThread(globalObject))==KErrNone);
+ test((DuplicateInOtherThread(globalObject))==KErrNone);
test.Next(_L("Test duplicate local object in other thead"));
- test((r=DuplicateInOtherThread(localObject))==KErrNone);
+ test((DuplicateInOtherThread(localObject))==KErrNone);
test.Next(_L("Test Chunk protection"));
{
RChunk protectedChunk;
- test((r=protectedChunk.CreateGlobal(KNullDesC,0x1000,0x100000,EOwnerProcess))==KErrNone);
- test((r=Session.Send(CTestSession::ETestChunkAdjust,TIpcArgs(protectedChunk)))==KErrNone);
+ test((protectedChunk.CreateGlobal(KNullDesC,0x1000,0x100000,EOwnerProcess))==KErrNone);
+ test((Session.Send(CTestSession::ETestChunkAdjust,TIpcArgs(protectedChunk)))==KErrNone);
protectedChunk.SetRestrictions(RChunk::EPreventAdjust);
- test((r=Session.Send(CTestSession::ETestChunkAdjust,TIpcArgs(protectedChunk)))==KErrAccessDenied);
+ test((Session.Send(CTestSession::ETestChunkAdjust,TIpcArgs(protectedChunk)))==KErrAccessDenied);
protectedChunk.Close();
}
@@ -898,51 +883,50 @@
void TestSemaphores()
{
TFullName name;
- TInt r;
-
+
test.Start(_L("Creating semaphores"));
RSemaphore globalObject;
RSemaphore localObject;
RSemaphore testObject;
- test((r=globalObject.CreateGlobal(_L("T_SOBJECT-test-global-semaphore"),1))==KErrNone);
- test((r=localObject.CreateLocal(1))==KErrNone);
+ test((globalObject.CreateGlobal(_L("T_SOBJECT-test-global-semaphore"),1))==KErrNone);
+ test((localObject.CreateLocal(1))==KErrNone);
test.Next(_L("Test find global object"));
TFindSemaphore find(globalObject.FullName());
- test((r=find.Next(name))==KErrNone);
+ test((find.Next(name))==KErrNone);
test.Next(_L("Test open found object"));
- test((r=testObject.Open(find))==KErrNone);
+ test((testObject.Open(find))==KErrNone);
testObject.Close();
test.Next(_L("Check can't find local object"));
TName objectName(localObject.FullName());
find.Find(objectName);
- test((r=find.Next(name))==PlatSecFindError);
+ test((find.Next(name))==PlatSecFindError);
test.Next(_L("Test open with null name"));
- test((r=testObject.OpenGlobal(KNullDesC))==KErrNotFound);
+ test((testObject.OpenGlobal(KNullDesC))==KErrNotFound);
testObject.Close();
test.Next(_L("Test open global object by name"));
- test((r=testObject.OpenGlobal(globalObject.FullName()))==KErrNone);
+ test((testObject.OpenGlobal(globalObject.FullName()))==KErrNone);
testObject.Close();
test.Next(_L("Check can't open local object by name"));
- test((r=testObject.OpenGlobal(localObject.FullName()))==PlatSecFindError);
+ test((testObject.OpenGlobal(localObject.FullName()))==PlatSecFindError);
testObject.Close();
test.Next(_L("Test duplicate global object in other process"));
- test((r=DuplicateInOtherProcess(globalObject))==KErrNone);
+ test((DuplicateInOtherProcess(globalObject))==KErrNone);
test.Next(_L("Check can't duplicate local object in other process"));
- test((r=DuplicateInOtherProcess(localObject))==PlatSecProcessIsolationError);
+ test((DuplicateInOtherProcess(localObject))==PlatSecProcessIsolationError);
test.Next(_L("Test duplicate global object in other thread"));
- test((r=DuplicateInOtherThread(globalObject))==KErrNone);
+ test((DuplicateInOtherThread(globalObject))==KErrNone);
test.Next(_L("Test duplicate local object in other thead"));
- test((r=DuplicateInOtherThread(localObject))==KErrNone);
+ test((DuplicateInOtherThread(localObject))==KErrNone);
test.Next(_L("Closing Semaphores"));
globalObject.Close();
@@ -956,51 +940,50 @@
void TestMutexes()
{
TFullName name;
- TInt r;
-
+
test.Start(_L("Creating mutexes"));
RMutex globalObject;
RMutex localObject;
RMutex testObject;
- test((r=globalObject.CreateGlobal(_L("T_SOBJECT-test-global-mutex")))==KErrNone);
- test((r=localObject.CreateLocal())==KErrNone);
+ test((globalObject.CreateGlobal(_L("T_SOBJECT-test-global-mutex")))==KErrNone);
+ test((localObject.CreateLocal())==KErrNone);
test.Next(_L("Test find global object"));
TFindMutex find(globalObject.FullName());
- test((r=find.Next(name))==KErrNone);
+ test((find.Next(name))==KErrNone);
test.Next(_L("Test open found object"));
- test((r=testObject.Open(find))==KErrNone);
+ test((testObject.Open(find))==KErrNone);
testObject.Close();
test.Next(_L("Check can't find local object"));
TName objectName(localObject.FullName());
find.Find(objectName);
- test((r=find.Next(name))==PlatSecFindError);
+ test((find.Next(name))==PlatSecFindError);
test.Next(_L("Test open with null name"));
- test((r=testObject.OpenGlobal(KNullDesC))==KErrNotFound);
+ test((testObject.OpenGlobal(KNullDesC))==KErrNotFound);
testObject.Close();
test.Next(_L("Test open global object by name"));
- test((r=testObject.OpenGlobal(globalObject.FullName()))==KErrNone);
+ test((testObject.OpenGlobal(globalObject.FullName()))==KErrNone);
testObject.Close();
test.Next(_L("Check can't open local object by name"));
- test((r=testObject.OpenGlobal(localObject.FullName()))==PlatSecFindError);
+ test((testObject.OpenGlobal(localObject.FullName()))==PlatSecFindError);
testObject.Close();
test.Next(_L("Test duplicate global object in other process"));
- test((r=DuplicateInOtherProcess(globalObject))==KErrNone);
+ test((DuplicateInOtherProcess(globalObject))==KErrNone);
test.Next(_L("Check can't duplicate local object in other process"));
- test((r=DuplicateInOtherProcess(localObject))==PlatSecProcessIsolationError);
+ test((DuplicateInOtherProcess(localObject))==PlatSecProcessIsolationError);
test.Next(_L("Test duplicate global object in other thread"));
- test((r=DuplicateInOtherThread(globalObject))==KErrNone);
+ test((DuplicateInOtherThread(globalObject))==KErrNone);
test.Next(_L("Test duplicate local object in other thead"));
- test((r=DuplicateInOtherThread(localObject))==KErrNone);
+ test((DuplicateInOtherThread(localObject))==KErrNone);
test.Next(_L("Closing mutexes"));
globalObject.Close();
@@ -1013,38 +996,36 @@
void TestMessageQueues()
{
- TInt r;
-
test.Start(_L("Creating message queues"));
RMsgQueue<TInt> globalObject;
RMsgQueue<TInt> localObject;
RMsgQueue<TInt> testObject;
- test((r=globalObject.CreateGlobal(_L("T_SOBJECT-test-global-msgqueue"),1))==KErrNone);
- test((r=localObject.CreateLocal(1))==KErrNone);
+ test((globalObject.CreateGlobal(_L("T_SOBJECT-test-global-msgqueue"),1))==KErrNone);
+ test((localObject.CreateLocal(1))==KErrNone);
test.Next(_L("Test open with null name"));
- test((r=testObject.OpenGlobal(KNullDesC))==KErrNotFound);
+ test((testObject.OpenGlobal(KNullDesC))==KErrNotFound);
testObject.Close();
test.Next(_L("Test open global object by name"));
- test((r=testObject.OpenGlobal(globalObject.FullName()))==KErrNone);
+ test((testObject.OpenGlobal(globalObject.FullName()))==KErrNone);
testObject.Close();
test.Next(_L("Check can't open local object by name"));
- test((r=testObject.OpenGlobal(localObject.FullName()))==PlatSecFindError);
+ test((testObject.OpenGlobal(localObject.FullName()))==PlatSecFindError);
testObject.Close();
test.Next(_L("Test duplicate global object in other process"));
- test((r=DuplicateInOtherProcess(globalObject))==KErrNone);
+ test((DuplicateInOtherProcess(globalObject))==KErrNone);
test.Next(_L("Check can't duplicate local object in other process"));
- test((r=DuplicateInOtherProcess(localObject))==PlatSecProcessIsolationError);
+ test((DuplicateInOtherProcess(localObject))==PlatSecProcessIsolationError);
test.Next(_L("Test duplicate global object in other thread"));
- test((r=DuplicateInOtherThread(globalObject))==KErrNone);
+ test((DuplicateInOtherThread(globalObject))==KErrNone);
test.Next(_L("Test duplicate local object in other thead"));
- test((r=DuplicateInOtherThread(localObject))==KErrNone);
+ test((DuplicateInOtherThread(localObject))==KErrNone);
test.Next(_L("Closing message queues"));
globalObject.Close();
@@ -1056,39 +1037,37 @@
void TestConditionVariables()
- {
- TInt r;
-
+ {
test.Start(_L("Creating condition variables"));
RCondVar globalObject;
RCondVar localObject;
RCondVar testObject;
- test((r=globalObject.CreateGlobal(_L("T_SOBJECT-test-global-condvar")))==KErrNone);
- test((r=localObject.CreateLocal())==KErrNone);
+ test((globalObject.CreateGlobal(_L("T_SOBJECT-test-global-condvar")))==KErrNone);
+ test((localObject.CreateLocal())==KErrNone);
test.Next(_L("Test open with null name"));
- test((r=testObject.OpenGlobal(KNullDesC))==KErrNotFound);
+ test((testObject.OpenGlobal(KNullDesC))==KErrNotFound);
testObject.Close();
test.Next(_L("Test open global object by name"));
- test((r=testObject.OpenGlobal(globalObject.FullName()))==KErrNone);
+ test((testObject.OpenGlobal(globalObject.FullName()))==KErrNone);
testObject.Close();
test.Next(_L("Check can't open local object by name"));
- test((r=testObject.OpenGlobal(localObject.FullName()))==PlatSecFindError);
+ test((testObject.OpenGlobal(localObject.FullName()))==PlatSecFindError);
testObject.Close();
test.Next(_L("Test duplicate global object in other process"));
- test((r=DuplicateInOtherProcess(globalObject))==KErrNone);
+ test((DuplicateInOtherProcess(globalObject))==KErrNone);
test.Next(_L("Check can't duplicate local object in other process"));
- test((r=DuplicateInOtherProcess(localObject))==PlatSecProcessIsolationError);
+ test((DuplicateInOtherProcess(localObject))==PlatSecProcessIsolationError);
test.Next(_L("Test duplicate global object in other thread"));
- test((r=DuplicateInOtherThread(globalObject))==KErrNone);
+ test((DuplicateInOtherThread(globalObject))==KErrNone);
test.Next(_L("Test duplicate local object in other thead"));
- test((r=DuplicateInOtherThread(localObject))==KErrNone);
+ test((DuplicateInOtherThread(localObject))==KErrNone);
test.Next(_L("Closing message queues"));
globalObject.Close();
@@ -1104,7 +1083,7 @@
RTestProcess server;
TRequestStatus rendezvous;
TInt r;
-
+
test.Next(_L("Test sending LogicalChannel handles"));
{
RLddTest localLdd;
@@ -1400,7 +1379,6 @@
test.Title();
- TInt r;
test.Start(_L("Starting test servers"));
RTestProcess server;
@@ -1413,10 +1391,10 @@
User::WaitForRequest(rendezvous);
test(rendezvous==KServerRendezvous);
server.Close();
- test((r=StartServerInThread(EAnonymousServer))==KErrNone);
+ test((StartServerInThread(EAnonymousServer))==KErrNone);
test.Next(_L("Openning server session"));
- test((r=Session.Connect())==KErrNone);
+ test((Session.Connect())==KErrNone);
test.Next(_L("Test Find and Open PhysicalDevices"));
TestPhysicalDevices();
--- a/kerneltest/e32test/secure/t_sprocess.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/secure/t_sprocess.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -75,7 +75,6 @@
_LIT(KTestPanicCategory,"TEST PANIC");
_LIT(KTestProcessName,"TestName");
-_LIT(KTestProcessName2,"TestName2");
TInt DoTestProcess(TInt aTestNum,TInt aArg1,TInt aArg2)
--- a/kerneltest/e32test/system/t_atomic_common.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/system/t_atomic_common.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -39,6 +39,35 @@
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
@@ -281,9 +310,10 @@
#define DEBUGPRINTxyrc() \
DEBUGPRINTVAR(x); \
- DEBUGPRINTVAR(y); \
- DEBUGPRINTVAR(r); \
- DEBUGPRINTVAR(c)
+ DebugPrintVar(y, "y", __LINE__); \
+ DebugPrintVar(r, "r", __LINE__); \
+ DebugPrintVar(c, "c", __LINE__)
+
template<class T> TInt DoLoadTest(TInt aIndex, TAny* aPtr, T aInitialValue)
{
@@ -396,10 +426,10 @@
{
DEBUGPRINT("r=%d",r);
DEBUGPRINTVAR(x);
- DEBUGPRINTVAR(ex);
+ DebugPrintVar(ex, "ex", __LINE__);
DEBUGPRINT("c=%d",c);
- DEBUGPRINTVAR(y);
- DEBUGPRINTVAR(ey);
+ DebugPrintVar(y, "y", __LINE__);
+ DebugPrintVar(ey, "ey", __LINE__);
}
return line;
}
--- a/kerneltest/e32test/system/t_ctrap.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/system/t_ctrap.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -55,9 +55,11 @@
#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;
@@ -106,12 +108,10 @@
LOCAL_C void ReallocateStackL()
{
- TInt n = 0;
for(TInt i = 0; i < KMaxAlloc; ++i)
{
- HBufC *p1 = HBufC::NewLC(4); //Stack re-allocation will be performed due to the additional objects pushed
+ (void)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);
@@ -130,12 +130,10 @@
{
RDebug::Printf("~CTest3(): Modify Cleanup stack by pushing items");
- TInt n = 0;
for(TInt i = 0; i < KMaxAlloc; ++i)
{
- HBufC *p1 = HBufC::NewLC(4); //Stack re-allocation will be performed due to the additional objects pushed
+ 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
}
}
@@ -148,13 +146,11 @@
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,9 +1087,11 @@
// when we do the cleanup. This test only works in debug mode.
//
__UHEAP_FAILNEXT(1);
+#if defined(_DEBUG)
TRAPD(r,pC->PushL(p6));
-#if defined(_DEBUG)
test(r==KErrNoMemory);
+#else
+ TRAP_IGNORE(pC->PushL(p6));
#endif
__UHEAP_CHECK(KInitialCount+6);
pC->PopAndDestroyAll();
@@ -1300,7 +1298,7 @@
// A cleanup operation which uses a trap harness and the cleanup stack
//
{
- TRAPD(ignore,useCleanupStackL())
+ TRAP_IGNORE(useCleanupStackL());
}
LOCAL_C void addReentrantItemL()
@@ -1424,7 +1422,7 @@
test.Next(_L("Check the object has closed"));
__KHEAP_CHECK(0);
- TRAPD(r, testAutoCloseL());
+ TRAP_IGNORE(testAutoCloseL());
test.Next(_L("Check object has been closed and cleaned up after leave"));
__KHEAP_MARKEND;
test.End();
--- a/kerneltest/e32test/system/t_inact.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/system/t_inact.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -198,13 +198,12 @@
void TestNonPositiveTimeout()
{
- TInt ret;
TRequestStatus x1,x2;
RTimer rt1,rt2;
test.Next(_L("Test RTimer::Inactivity() with zero timeout"));
- ret=rt1.CreateLocal();
- ret=rt2.CreateLocal();
+ rt1.CreateLocal();
+ rt2.CreateLocal();
rt1.Inactivity(x1, 2);
User::After(500000);
--- a/kerneltest/e32test/system/t_panic.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/system/t_panic.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -27,7 +27,9 @@
RUndertaker u;
TInt r=u.Create();
test(r==KErrNone);
- FOREVER
+ //to avoid RVCT4 warning of unreachable statement.
+ volatile TInt forever = 0;
+ while(forever)
{
TInt h;
TRequestStatus s;
--- a/kerneltest/e32test/system/t_prot.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/system/t_prot.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -49,7 +49,6 @@
void DoUndefinedInstruction();
const TInt KHeapSize=0x200;
-const TInt KThreadReturnValue=9999;
_LIT(KLitKernExec,"KERN-EXEC");
@@ -426,7 +425,6 @@
User::WaitForRequest(s);
}
-_LIT(KLitUserCBase,"E32USER-CBase");
GLDEF_C TInt E32Main()
//
// Main
--- a/kerneltest/e32test/thread/t_killer.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/thread/t_killer.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -94,14 +94,14 @@
// CTestServer functions
-CTestServer::CTestServer(TInt aPriority)
+EXPORT_C CTestServer::CTestServer(TInt aPriority)
//
// Constructor - sets name
//
: CServer2(aPriority)
{}
-CSession2* CTestServer::NewSessionL(const TVersion& aVersion, const RMessage2 &) const
+EXPORT_C 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);
}
-void CTestSession::ServiceL(const RMessage2& aMessage)
+EXPORT_C void CTestSession::ServiceL(const RMessage2& aMessage)
//
// Virtual message-handler
//
--- a/kerneltest/e32test/video/t_video.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/video/t_video.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -420,7 +420,6 @@
TInt count;
- TInt fourBppMode = -1;
for (count = 0; count < totalModes; count++)
{
@@ -456,9 +455,6 @@
ret = HAL::Get(HAL::EDisplayBitsPerPixel, HALArg);
test (KErrNone == ret);
- if (HALArg == 4)
- fourBppMode = count;
-
}
@@ -1035,8 +1031,6 @@
TInt count;
- TInt fourBppMode = -1;
-
for (count = 0; count < totalModes; count++)
{
@@ -1071,9 +1065,6 @@
ret = HAL::Get(screen, HAL::EDisplayBitsPerPixel, HALArg);
test (KErrNone == ret);
- if (HALArg == 4)
- fourBppMode = count;
-
}
--- a/kerneltest/e32test/window/t_mmcpw.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/e32test/window/t_mmcpw.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -18,6 +18,7 @@
#include <e32svr.h>
+#define __E32TEST_EXTENSION__
#include <e32test.h>
#include <e32twin.h>
#include <e32def.h>
@@ -35,8 +36,8 @@
RNotifier n;
test.Next(_L("Connected to notify server."));
- TInt r;
- test((r = n.Connect()) == KErrNone);
+ TInt r = n.Connect();
+ test_KErrNone(r);
TPckgBuf<TMediaPswdSendNotifyInfoV1> send;
send().iVersion = TVersion(1, 0, 0);
--- a/kerneltest/f32test/bench/t_fsysbm.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/f32test/bench/t_fsysbm.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -31,63 +31,69 @@
//#define SYMBIAN_TEST_COPY // read from one drive and write to another
-GLDEF_D RTest test(_L("File System Benchmarks"));
+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;
-const TInt64 K3GB = 3 * KGb;
-const TInt64 K4GB = 4 * KGb;
+const TInt64 KGb = 1 << 30; // 1GB
+const TInt64 K3GB = 3 * KGb; // 3GB
+const TInt64 K4GB = 4 * KGb; // 4GB
#endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
#if defined(__WINS__)
-LOCAL_D TInt KMaxFileSize = 256 * K1K; // 256K
-//LOCAL_D TInt KMaxFileSize = K1M; // 1M
+static TInt KMaxFileSize = 256 * K1K; // 256K
+//static TInt KMaxFileSize = K1M; // 1M
#else
-//LOCAL_D TInt KMaxFileSize = 256 * K1K; // 256K
-//LOCAL_D TInt KMaxFileSize = K1M; // 1M
-LOCAL_D TInt KMaxFileSize = K2M; // 2M
+//static TInt KMaxFileSize = 256 * K1K; // 256K
+//static TInt KMaxFileSize = K1M; // 1M
+static TInt KMaxFileSize = K2M; // 2M
#endif
const TTimeIntervalMicroSeconds32 KFloatingPointTestTime = 10000000; // 10 seconds
-LOCAL_D const TInt KHeapSize = 0x4000;
+static const TInt KHeapSize = 0x4000;
-LOCAL_D TPtr8 DataBuf(NULL, KMaxFileSize,KMaxFileSize);
-LOCAL_D HBufC8* DataBufH = NULL;
+static TPtr8 DataBuf(NULL, KMaxFileSize,KMaxFileSize);
+static HBufC8* DataBufH = NULL;
-LOCAL_D RSharedChunkLdd Ldd;
-LOCAL_D RChunk TheChunk;
-LOCAL_D TInt PageSize;
+static RSharedChunkLdd Ldd;
+static RChunk TheChunk;
+static TInt PageSize;
const TUint ChunkSize = KMaxFileSize;
-LOCAL_D RFile File, File2;
-LOCAL_D TChar gDriveToTest2;
+static RFile File, File2;
+#if defined SYMBIAN_TEST_COPY
+static TChar gDriveToTest2;
+#endif
// if enabled, Read and Write operations are not boundary aligned.
-LOCAL_D TBool gMisalignedReadWrites = EFalse;
+static TBool gMisalignedReadWrites = 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;
+// read & write caching enabled flags - may be overridden by +/-r +/-w command line switches
+static TBool gReadCachingOn = EFalse;
+static TBool gWriteCachingOn = EFalse;
// if enabled, timings are for write AND flush
-LOCAL_D TBool gFlushAfterWrite = ETrue;
+static TBool gFlushAfterWrite = ETrue;
// if enabled, contiguous shared memory is used for Data buffer
-LOCAL_D TBool gSharedMemory = EFalse;
+static TBool gSharedMemory = EFalse;
// if enabled, fragmented shared memory is used for Data buffer
-LOCAL_D TBool gFragSharedMemory = EFalse;
+static TBool gFragSharedMemory = EFalse;
-LOCAL_D TInt gFastCounterFreq;
+// 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_C void RecursiveRmDir(const TDesC& aDes)
+static void RecursiveRmDir(const TDesC& aDes)
//
// Delete directory contents recursively
//
@@ -98,7 +104,7 @@
TInt r=TheFs.GetDir(n,KEntryAttMaskSupported,EDirsLast,pD);
if (r==KErrNotFound || r==KErrPathNotFound)
return;
- test(r==KErrNone);
+ test_KErrNone(r);
TInt count=pD->Count();
TInt i=0;
while (i<count)
@@ -115,30 +121,30 @@
TFileName fileName;
fileName.Format(_L("%S%S"),&aDes,&e.iName);
r=TheFs.Delete(fileName);
- test(r==KErrNone);
+ test_KErrNone(r);
}
}
delete pD;
r=TheFs.RmDir(aDes);
- test(r==KErrNone);
+ test_KErrNone(r);
}
-void LOCAL_C ClearSessionDirectory()
+void static ClearSessionDirectory()
//
// Delete the contents of F32-TST
//
{
TParse sessionPath;
TInt r=TheFs.Parse(_L("\\F32-TST\\"),_L(""),sessionPath);
- test(r==KErrNone);
+ test_KErrNone(r);
RecursiveRmDir(sessionPath.FullName());
r=TheFs.MkDir(sessionPath.FullName());
- test(r==KErrNone);
+ test_KErrNone(r);
}
-LOCAL_C void DoTestFileRead(TInt aBlockSize, TInt aFileSize = KMaxFileSize, TBool aReRead = EFalse)
+static void DoTestFileRead(TInt aBlockSize, TInt aFileSize = KMaxFileSize, TBool aReRead = EFalse)
//
// Do Read Test
//
@@ -154,7 +160,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(r == KErrNone);
+ test_KErrNone(r);
TInt count = aFileSize / DataBuf.Length();
while (count--)
File.Write(DataBuf);
@@ -163,7 +169,7 @@
enum {EFileReadBuffered = 0x00002000, EFileReadDirectIO = 0x00004000};
r = File.Open(TheFs, _L("READTEST"), EFileStream | (gReadCachingOn ? EFileReadBuffered : EFileReadDirectIO));
- test(r == KErrNone);
+ test_KErrNone(r);
// const TInt maxReadCount = aFileSize / aBlockSize;
TUint functionCalls = 0;
@@ -172,7 +178,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(r == KErrNone);
+ test_KErrNone(r);
#endif
TTime startTime(0);
@@ -209,14 +215,14 @@
// test.Printf(_L("%d"),DataBuf[a]);
TInt r = File.Read(DataBuf, readLen);
- test (r == KErrNone);
+ test_KErrNone(r);
if (DataBuf.Length() == 0)
break;
#if defined SYMBIAN_TEST_COPY
r = File2.Write(DataBuf, readLen);
- test (r == KErrNone);
+ test_KErrNone(r);
#endif
functionCalls++;
@@ -254,12 +260,12 @@
File.Close();
r = TheFs.Delete(_L("READTEST"));
- test(r == KErrNone);
+ test_KErrNone(r);
return;
}
-LOCAL_C void TestFileRead(TInt aFileSize = KMaxFileSize, TBool aMisalignedReadWrites = EFalse, TBool aReRead = EFalse)
+static void TestFileRead(TInt aFileSize = KMaxFileSize, TBool aMisalignedReadWrites = EFalse, TBool aReRead = EFalse)
//
// Benchmark read method
//
@@ -292,8 +298,10 @@
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);
@@ -306,7 +314,7 @@
}
-LOCAL_C TInt FloatingPointLoop(TAny* funcCount)
+static TInt FloatingPointLoop(TAny* funcCount)
{
TUint& count = *(TUint*) funcCount;
TReal eq = KPi;
@@ -320,7 +328,7 @@
}
-LOCAL_C void DoTestFileReadCPU(TInt aBlockSize)
+static void DoTestFileReadCPU(TInt aBlockSize)
//
// Benchmark CPU utilisation for Read method
//
@@ -330,7 +338,7 @@
{
enum {EFileReadBuffered = 0x00002000, EFileReadDirectIO = 0x00004000};
TInt r = File.Open(TheFs, _L("READCPUTEST"), EFileStream | (gReadCachingOn ? EFileReadBuffered : EFileReadDirectIO));
- test(r == KErrNone);
+ test_KErrNone(r);
TInt pos = 0;
@@ -363,7 +371,7 @@
for (TInt i = 0; reqStat==KRequestPending; i++)
{
TInt r = File.Read(pos, DataBuf, aBlockSize);
- test (r == KErrNone);
+ test_KErrNone(r);
pos += aBlockSize;
if (pos > KMaxFileSize-aBlockSize)
@@ -398,7 +406,7 @@
}
-LOCAL_C void TestFileReadCPU(TBool aMisalignedReadWrites = EFalse)
+static void TestFileReadCPU(TBool aMisalignedReadWrites = EFalse)
//
// Benchmark CPU utilisation for Read method
//
@@ -414,7 +422,7 @@
DataBuf.SetLength(KMaxFileSize);
TInt r = File.Create(TheFs, _L("READCPUTEST"), EFileStream | EFileWriteDirectIO);
- test(r == KErrNone);
+ test_KErrNone(r);
File.Write(DataBuf);
@@ -440,16 +448,17 @@
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(r == KErrNone);
+ test_KErrNone(r);
}
-LOCAL_C void DoTestFileWrite(TInt aBlockSize, TInt aFileSize = KMaxFileSize, TBool aUpdate = EFalse)
+static void DoTestFileWrite(TInt aBlockSize, TInt aFileSize = KMaxFileSize, TBool aUpdate = EFalse)
//
// Do Write benchmark
//
@@ -460,17 +469,17 @@
TFileName testDir(_L("?:\\F32-TST\\"));
testDir[0] = (TText) gDriveToTest;
TInt r = TheFs.MkDir(testDir);
- test(r == KErrNone || r == KErrAlreadyExists);
+ test_Value(r, r == KErrNone || r == KErrAlreadyExists);
TFileName fileName;
- enum {EFileWriteDirectIO = 0x00001000, EFileWriteBuffered = 0x00000800};
- r = File.Temp(TheFs, testDir, fileName, EFileWrite | (gWriteCachingOn ? EFileWriteBuffered : EFileWriteDirectIO));
- test(r == KErrNone);
+ r = File.Temp(TheFs, testDir, fileName, EFileWrite | (gFileSequentialModeOn ? EFileSequential : 0)
+ | (gWriteCachingOn ? EFileWriteBuffered : EFileWriteDirectIO));
+ test_KErrNone(r);
if (aUpdate)
{
TInt r = File.SetSize(aFileSize);
- test(r == KErrNone);
+ test_KErrNone(r);
}
TUint functionCalls = 0;
@@ -534,7 +543,7 @@
}
-LOCAL_C void TestFileWrite(TInt aFileSize = KMaxFileSize, TBool aMisalignedReadWrites = EFalse, TBool aUpdate = EFalse)
+static void TestFileWrite(TInt aFileSize = KMaxFileSize, TBool aMisalignedReadWrites = EFalse, TBool aUpdate = EFalse)
//
// Benchmark write method
//
@@ -568,8 +577,10 @@
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);
@@ -582,7 +593,7 @@
-LOCAL_C void DoTestFileWriteCPU(TInt aBlockSize)
+static void DoTestFileWriteCPU(TInt aBlockSize)
//
// Benchmark CPU utilisation for Write method
//
@@ -595,12 +606,12 @@
TFileName testDir(_L("?:\\F32-TST\\"));
testDir[0] = (TText) gDriveToTest;
TInt r = TheFs.MkDir(testDir);
- test(r == KErrNone || r == KErrAlreadyExists);
+ test_Value(r, r == KErrNone || r == KErrAlreadyExists);
TFileName fileName;
- enum {EFileWriteDirectIO = 0x00001000, EFileWriteBuffered = 0x00000800};
- r = File.Temp(TheFs, testDir, fileName, EFileWrite | (gWriteCachingOn ? EFileWriteBuffered : EFileWriteDirectIO));
- test(r == KErrNone);
+ r = File.Temp(TheFs, testDir, fileName, EFileWrite | (gFileSequentialModeOn ? EFileSequential : 0)
+ | (gWriteCachingOn ? EFileWriteBuffered : EFileWriteDirectIO));
+ test_KErrNone(r);
TUint functionCalls = 0;
TUint fltPntCalls = 0;
@@ -664,7 +675,7 @@
}
-LOCAL_C void TestFileWriteCPU(TBool aMisalignedReadWrites = EFalse)
+static void TestFileWriteCPU(TBool aMisalignedReadWrites = EFalse)
//
// Benchmark CPU utilisation for Write method
//
@@ -694,12 +705,14 @@
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
}
-LOCAL_C void TestFileSeek()
+static void TestFileSeek()
//
// Benchmark file seek method
//
@@ -714,7 +727,7 @@
TBuf8<1024> testdata(1024);
RFile f;
TInt r=f.Create(TheFs,_L("SEEKTEST"),EFileStream);
- test(r==KErrNone);
+ test_KErrNone(r);
count=64;
while (count--)
f.Write(testdata);
@@ -741,7 +754,7 @@
#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
-LOCAL_C void CreateManyLargFiles(TInt aNumber)
+static void CreateManyLargFiles(TInt aNumber)
//
// Make a directory with aNumber entries
//
@@ -753,7 +766,7 @@
TFileName sessionPath;
TInt r=TheFs.SessionPath(sessionPath);
- test(r==KErrNone);
+ test_KErrNone(r);
r=TheFs.MkDir(_L("\\F32-TST\\"));
test((r==KErrNone)||(r==KErrAlreadyExists));
r=TheFs.MkDir(_L("\\F32-TST\\BENCH_DELETE\\"));
@@ -764,11 +777,11 @@
TFileName baseName=_L("\\F32-TST\\BENCH_DELETE\\FILE");
baseName.AppendNum(i);
r=f.Replace(TheFs,baseName,EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
r = f.SetSize(K3GB);
- test(r==KErrNone);
+ test_KErrNone(r);
r=f.Write((K3GB-30),WriteData);
- test(r==KErrNone);
+ test_KErrNone(r);
f.Flush();
f.Close();
}
@@ -784,12 +797,12 @@
TInt r=f.Open(TheFs,baseName,EFileRead);
if (r!=KErrNone)
{
- test(r==KErrNotFound && j==maxEntry);
+ test_Value(r, r == KErrNotFound && j==maxEntry);
return;
}
ReadData.FillZ();
r=f.Read((K3GB-30),ReadData);
- test(r==KErrNone);
+ test_KErrNone(r);
test(f.Size(Size)==KErrNone);
test(K3GB == Size);
test(ReadData==WriteData);
@@ -798,7 +811,7 @@
}
-LOCAL_C void TestLargeFileDelete()
+static void TestLargeFileDelete()
//
// This test require MMC/SD card size >=4GB-2 in size
//
@@ -817,9 +830,14 @@
TInt r;
r = TheFs.Volume(volInfo);
- test(r == KErrNone);
-
+ test_KErrNone(r);
+
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)
@@ -844,7 +862,7 @@
baseName.AppendNum(index);
TInt r=TheFs.Delete(baseName);
- test(r==KErrNone);
+ test_KErrNone(r);
}
TTime endTime;
@@ -877,7 +895,7 @@
for (TInt index=0;index<numberOfFiles;index++)
{
TInt r=fMan->Delete(_L("\\F32-TST\\BENCH_DELETE\\FILE*"));
- test(r==KErrNone || r==KErrNotFound);
+ test_Value(r, r == KErrNone || r==KErrNotFound);
}
TTime endTime;
@@ -898,7 +916,7 @@
#endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
-LOCAL_C void CreateManyFiles(TInt aNumber)
+static void CreateManyFiles(TInt aNumber)
//
// Make a directory with aNumber entries
//
@@ -910,7 +928,7 @@
TFileName sessionPath;
TInt r=TheFs.SessionPath(sessionPath);
- test(r==KErrNone);
+ test_KErrNone(r);
r=TheFs.MkDir(_L("\\F32-TST\\"));
test((r==KErrNone)||(r==KErrAlreadyExists));
r=TheFs.MkDir(_L("\\F32-TST\\BENCH_DELETE\\"));
@@ -921,9 +939,9 @@
TFileName baseName=_L("\\F32-TST\\BENCH_DELETE\\FILE");
baseName.AppendNum(i);
r=f.Replace(TheFs,baseName,EFileRead);
- test(r==KErrNone);
+ test_KErrNone(r);
r=f.Write(_L8("Wibble"));
- test(r==KErrNone);
+ test_KErrNone(r);
f.Close();
}
@@ -935,19 +953,19 @@
TInt r=f.Open(TheFs,baseName,EFileRead);
if (r!=KErrNone)
{
- test(r==KErrNotFound && j==maxEntry);
+ test_Value(r, r == KErrNotFound && j==maxEntry);
return;
}
TBuf8<16> data;
r=f.Read(data);
- test(r==KErrNone);
+ test_KErrNone(r);
test(data==_L8("Wibble"));
f.Close();
}
}
-LOCAL_C void TestFileDelete()
+static void TestFileDelete()
//
//
//
@@ -976,7 +994,7 @@
baseName.AppendNum(index);
TInt r=TheFs.Delete(baseName);
- test(r==KErrNone);
+ test_KErrNone(r);
}
TTime endTime;
@@ -1009,7 +1027,7 @@
for (TInt index=0;index<numberOfFiles;index++)
{
TInt r=fMan->Delete(_L("\\F32-TST\\BENCH_DELETE\\FILE*"));
- test(r==KErrNone || r==KErrNotFound);
+ test_Value(r, r == KErrNone || r==KErrNotFound);
}
TTime endTime;
@@ -1030,7 +1048,7 @@
/*
TInt maxDirEntry=200;
-LOCAL_C void TestDirRead()
+static void TestDirRead()
//
// Benchmark directory read method
//
@@ -1080,7 +1098,7 @@
}
-void LOCAL_C PrintDirResults()
+void static PrintDirResults()
//
// Print results of Directory Benchmark
//
@@ -1095,7 +1113,7 @@
*/
-LOCAL_C void TestMkDir()
+static void TestMkDir()
{
test.Next(_L("Benchmark MkDir"));
ClearSessionDirectory();
@@ -1112,7 +1130,7 @@
dirName.AppendNum(n);
dirName.Append(_L("\\"));
TInt r = TheFs.MkDir(dirName);
- test(r == KErrNone);
+ test_KErrNone(r);
}
endTime.HomeTime();
@@ -1138,15 +1156,15 @@
test.Printf(_L("Initialise\n"));
TInt r = UserHal::PageSizeInBytes(PageSize);
- test(r==KErrNone);
+ test_KErrNone(r);
test.Printf(_L("Loading test driver\n"));
r = User::LoadLogicalDevice(KSharedChunkLddName);
- test(r==KErrNone || r==KErrAlreadyExists);
+ test_Value(r, r == KErrNone || r==KErrAlreadyExists);
test.Printf(_L("Opening channel\n"));
r = Ldd.Open();
- test(r==KErrNone);
+ test_KErrNone(r);
test.Printf(_L("Create chunk\n"));
@@ -1157,13 +1175,13 @@
TUint ChunkAttribs = TotalChunkSize|aCreateFlags;
r = Ldd.CreateChunk(ChunkAttribs);
- test(r==KErrNone);
+ test_KErrNone(r);
if (gSharedMemory)
{
test.Printf(_L("Commit Contigouos Memory\n"));
r = Ldd.CommitMemory(aCommitType,TotalChunkSize);
- test(r==KErrNone);
+ test_KErrNone(r);
}
else
{
@@ -1176,14 +1194,14 @@
i-=PageSize;
test.Printf(_L("Commit %d\n"), i);
r = Ldd.CommitMemory(aCommitType|i,PageSize);
- test(r==KErrNone);
+ test_KErrNone(r);
}while (i>0);
/*
for (TInt i = (ChunkSize-PageSize); i>=0; )
{
test.Printf(_L("Commit %d\n"), i);
r = Ldd.CommitMemory(aCommitType|i,PageSize);
- test(r==KErrNone);
+ test_KErrNone(r);
i-=PageSize;
}
*/
@@ -1191,7 +1209,7 @@
test.Printf(_L("\nOpen user handle\n"));
r = Ldd.GetChunkHandle(TheChunk);
- test(r==KErrNone);
+ test_KErrNone(r);
DataBuf.Set(TheChunk.Base(),KMaxFileSize, KMaxFileSize);
}
@@ -1218,11 +1236,11 @@
test.Printf(_L("Close kernel chunk handle\n"));
TInt r = Ldd.CloseChunk();
- test(r==1);
+ test_Value(r, r == 1);
test.Printf(_L("Check chunk is destroyed\n"));
r = Ldd.IsDestroyed();
- test(r==1);
+ test_Value(r, r == 1);
test.Printf(_L("Close test driver\n"));
Ldd.Close();
@@ -1294,6 +1312,17 @@
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);
@@ -1337,10 +1366,11 @@
RProcess().SetPriority(EPriorityBackground);
TInt r = HAL::Get(HAL::EFastCounterFrequency, gFastCounterFreq);
- test(r == KErrNone);
+ test_KErrNone(r);
test.Printf(_L("HAL::EFastCounterFrequency %d\n"), gFastCounterFreq);
- test.Printf(_L("gReadCachingOn %d gWriteCachingOn %d gFlushAfterWrite %d\n"), gReadCachingOn, gWriteCachingOn, gFlushAfterWrite);
+ test.Printf(_L("gReadCachingOn %d gWriteCachingOn %d gFlushAfterWrite %d gFileSequentialModeOn %d\n"),
+ gReadCachingOn, gWriteCachingOn, gFlushAfterWrite, gFileSequentialModeOn);
TestFileSeek();
--- a/kerneltest/f32test/demandpaging/t_wdpstress.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/f32test/demandpaging/t_wdpstress.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -475,7 +475,7 @@
}
-void CTestSession::ServiceL(const RMessage2& aMessage)
+EXPORT_C void CTestSession::ServiceL(const RMessage2& aMessage)
//
// Virtual message-handler
//
--- a/kerneltest/f32test/loader/exet.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/f32test/loader/exet.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -34,9 +34,9 @@
extern "C" TInt _E32Startup();
-extern "C" IMPORT_C void RegisterConstructorCall(TInt aDllNum);
-extern "C" IMPORT_C void RegisterInitCall(TInt aDllNum);
-extern "C" IMPORT_C void RegisterDestructorCall(TInt aDllNum);
+extern "C" __MODULE_IMPORT void RegisterConstructorCall(TInt aDllNum);
+extern "C" __MODULE_IMPORT void RegisterInitCall(TInt aDllNum);
+extern "C" __MODULE_IMPORT void RegisterDestructorCall(TInt aDllNum);
#define PANIC() ExeTPanic(__LINE__)
#define EXET_ASSERT(c) ((void)((c)||(PANIC(),0)))
--- a/kerneltest/f32test/loader/security/exet.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/f32test/loader/security/exet.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -32,9 +32,9 @@
extern "C" TInt _E32Startup();
-extern "C" IMPORT_C void RegisterConstructorCall(TInt aDllNum);
-extern "C" IMPORT_C void RegisterInitCall(TInt aDllNum);
-extern "C" IMPORT_C void RegisterDestructorCall(TInt aDllNum);
+extern "C" __MODULE_IMPORT void RegisterConstructorCall(TInt aDllNum);
+extern "C" __MODULE_IMPORT void RegisterInitCall(TInt aDllNum);
+extern "C" __MODULE_IMPORT void RegisterDestructorCall(TInt aDllNum);
#define PANIC() ExeTPanic(__LINE__)
#define EXET_ASSERT(c) ((void)((c)||(PANIC(),0)))
--- a/kerneltest/f32test/server/t_cp_plugin.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/f32test/server/t_cp_plugin.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -16,6 +16,7 @@
//
+#define __E32TEST_EXTENSION__
#include <f32file.h>
#include <e32ldr.h>
#include <e32ldr_private.h>
@@ -42,8 +43,6 @@
void TestCompatibility();
void TestINC126563();
-// Codepage dll name
-_LIT(KCP932Name,"T_CP932");
TInt LoadCodePageDll(const TDesC& aCodePageDllName)
{
@@ -95,7 +94,8 @@
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(r == KErrNone || r == KErrAlreadyExists);
+ test_Value(r, r == KErrNone || r == KErrAlreadyExists);
if(r == KErrNone)
{
// should not allow loading again codepage dll.
r = LoadCodePageDll(CodepageDllName);
- test(r == KErrAlreadyExists);
+ test_Value(r, r == KErrAlreadyExists);
}
@@ -129,7 +129,7 @@
// Disables codepage dll implementation of LocaleUtils functions for other base tests
r = TheFs.ControlIo(driveNum, KControlIoDisableFatUtilityFunctions);
- test(r == KErrNone);
+ test_KErrNone(r);
}
}
else
--- a/kerneltest/f32test/smassstorage/scsiprot/t_ms_scsi.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/f32test/smassstorage/scsiprot/t_ms_scsi.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -591,31 +591,30 @@
: iMount(aMount)
{}
-TInt CProxyDrive::ControlIO(const RMessagePtr2&, TInt, TAny*, TAny*)
+EXPORT_C TInt CProxyDrive::ControlIO(const RMessagePtr2&, TInt, TAny*, TAny*)
{ return KErrNone; }
-TInt CProxyDrive::Read (TInt64 aPos, TInt aLength, const TAny* aTrg, TInt, TInt, TInt)
+EXPORT_C TInt CProxyDrive::Read (TInt64 aPos, TInt aLength, const TAny* aTrg, TInt, TInt, TInt)
{ return Read(aPos, aLength, *(TDes8*)aTrg); }
-TInt CProxyDrive::Write (TInt64 aPos, TInt, const TAny* aSrc, TInt, TInt, TInt)
+EXPORT_C 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.
-TInt CProxyDrive::GetInterface(TInt /*aInterfaceId*/, TAny*& /*aInterface*/, TAny* /*aInput*/)
+EXPORT_C 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.
-TInt CProxyDrive::GetLastErrorInfo(TDes8& /*anErrorInfo*/)
+EXPORT_C TInt CProxyDrive::GetLastErrorInfo(TDes8& /*anErrorInfo*/)
{ return KErrNotSupported; }
CProxyDrive::~CProxyDrive()
{ }
-
-TInt CProxyDrive::DeleteNotify(TInt64, TInt)
+EXPORT_C TInt CProxyDrive::DeleteNotify(TInt64, TInt)
{ return KErrNone; }
--- a/kerneltest/f32test/smassstorage/src/t_ms_fsunit.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/kerneltest/f32test/smassstorage/src/t_ms_fsunit.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -195,10 +195,10 @@
return KErrNone;
}
//------------------------------------
-CFileSystem::CFileSystem(void)
+EXPORT_C CFileSystem::CFileSystem(void)
{
}
-CFileSystem::~CFileSystem(void)
+EXPORT_C CFileSystem::~CFileSystem(void)
{
}
@@ -295,7 +295,7 @@
CFsDispatchObject::~CFsDispatchObject()
{
}
-int CFsDispatchObject::IsCorrectThread(void)
+EXPORT_C int CFsDispatchObject::IsCorrectThread(void)
{
return ETrue;
}
@@ -309,12 +309,12 @@
aFileStart=NULL;
}
-int CLocDrvMountCB::CreateLocalDrive(class TBusLocalDrive &)
+EXPORT_C int CLocDrvMountCB::CreateLocalDrive(class TBusLocalDrive &)
{
return KErrNone;
}
-void CLocDrvMountCB::DismountedLocalDrive(void)
+EXPORT_C 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.
-TInt CMountCB::GetInterface(TInt /*aInterfaceId*/, TAny*& /*aInterface*/, TAny* /*aInput*/)
+EXPORT_C TInt CMountCB::GetInterface(TInt /*aInterfaceId*/, TAny*& /*aInterface*/, TAny* /*aInput*/)
{
return KErrNotSupported;
}
-TInt CFileSystem::GetInterface(TInt /*aInterfaceId*/, TAny*& /*aInterface*/, TAny* /*aInput*/)
+EXPORT_C TInt CFileSystem::GetInterface(TInt /*aInterfaceId*/, TAny*& /*aInterface*/, TAny* /*aInput*/)
{
return KErrNotSupported;
}
--- a/userlibandfileserver/fileserver/group/release.txt Fri Apr 23 22:02:01 2010 +0100
+++ b/userlibandfileserver/fileserver/group/release.txt Fri Apr 23 22:08:41 2010 +0100
@@ -1,3 +1,12 @@
+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
=================
(Made by vfebvre 09/04/2010)
--- a/userlibandfileserver/fileserver/inc/f32ver.h Fri Apr 23 22:02:01 2010 +0100
+++ b/userlibandfileserver/fileserver/inc/f32ver.h Fri Apr 23 22:08:41 2010 +0100
@@ -58,6 +58,6 @@
@see TVersion
*/
-const TInt KF32BuildVersionNumber=3028;
+const TInt KF32BuildVersionNumber=3029;
//
#endif
--- a/userlibandfileserver/fileserver/sfat32/sl_vfat.cpp Fri Apr 23 22:02:01 2010 +0100
+++ b/userlibandfileserver/fileserver/sfat32/sl_vfat.cpp Fri Apr 23 22:08:41 2010 +0100
@@ -29,8 +29,7 @@
// use second half of ISO Latin 1 character set for extended chars
const TUint KExtendedCharStart=0x80;
const TUint KExtendedCharEnd=0xff;
-
-const TUint KMaxVFatEntries = 21; ///< Max possible number of entries in the VFAT entryset
+#define KMaxVFatEntries 21 ///< Max possible number of entries in the VFAT entryset
//-----------------------------------------------------------------------------