diff -r 000000000000 -r bde4ae8d615e os/kernelhwsrv/kerneltest/e32test/misc/strataflash32.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os/kernelhwsrv/kerneltest/e32test/misc/strataflash32.cpp Fri Jun 15 03:10:57 2012 +0200 @@ -0,0 +1,145 @@ +// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of the License "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// e32test\misc\strataflash32.cpp +// +// + +#include +#include +#include "flash.h" + +#include +GLREF_C RTest test; + +class StrataFlash32 : public Flash + { +public: + virtual TInt Read(TUint32 anAddr, TUint32 aSize, TUint8* aDest); + virtual TInt BlankCheck(TUint32 anAddr, TUint32 aSize); + virtual TInt Erase(TUint32 anAddr, TUint32 aSize); + virtual TInt Write(TUint32 anAddr, TUint32 aSize, const TUint8* aSrc); + }; + + +Flash* Flash::New(TUint32 /*anAddr*/) + { + return new StrataFlash32; + } + +TInt StrataFlash32::Read(TUint32 anAddr, TUint32 aSize, TUint8* aDest) + { + Mem::Move(aDest,(const TUint32*)anAddr,aSize); + return KErrNone; + } + +TInt StrataFlash32::BlankCheck(TUint32 anAddr, TUint32 aSize) + { + const TUint32* p=(const TUint32*)anAddr; + const TUint32* pE=p+(aSize+3)/4; + while(p