diff -r 000000000000 -r bde4ae8d615e os/kernelhwsrv/kerneltest/e32test/misc/strataflash.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os/kernelhwsrv/kerneltest/e32test/misc/strataflash.cpp Fri Jun 15 03:10:57 2012 +0200 @@ -0,0 +1,102 @@ +// 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\strataflash.cpp +// +// + +#include +#include +#include "flash.h" + +class StrataFlash : 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 StrataFlash; + } + +TInt StrataFlash::Read(TUint32 anAddr, TUint32 aSize, TUint8* aDest) + { + Mem::Copy(aDest,(const TUint8*)anAddr,aSize); + return KErrNone; + } + +TInt StrataFlash::BlankCheck(TUint32 anAddr, TUint32 aSize) + { + const TUint8* p=(const TUint8*)anAddr; + const TUint8* pE=p+aSize; + while(p