os/kernelhwsrv/userlibandfileserver/fileserver/sfile/sf_ldr.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/userlibandfileserver/fileserver/sfile/sf_ldr.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,110 @@
     1.4 +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// f32\sfile\sf_ldr.h
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#ifndef __SF_LDR_H__
    1.22 +#define __SF_LDR_H__
    1.23 +
    1.24 +class TLoaderDeletedList
    1.25 +	{
    1.26 +public:
    1.27 +	TLoaderDeletedList* iNext;
    1.28 +	TInt iDriveNumber;
    1.29 +	TInt64 iStartBlock;
    1.30 +	HBufC* iFileName;
    1.31 +	};
    1.32 +
    1.33 +
    1.34 +NONSHARABLE_CLASS(CReaperCleanupTimer): public CTimer
    1.35 +	{
    1.36 +public:
    1.37 +	CReaperCleanupTimer();
    1.38 +	static TInt New();
    1.39 +	static void Complete();
    1.40 +private:
    1.41 +	~CReaperCleanupTimer();
    1.42 +	void RunL();
    1.43 +	void Start();
    1.44 +	static CReaperCleanupTimer* Timer;
    1.45 +	};
    1.46 +
    1.47 +NONSHARABLE_CLASS(CActiveReaper) : public CActive
    1.48 +	{
    1.49 +public:
    1.50 +	static CActiveReaper* New();
    1.51 +	~CActiveReaper();
    1.52 +	void StartReaper();
    1.53 +	
    1.54 +	void AddDeleted(TLoaderDeletedList* aLink);	
    1.55 +	void InitDelDir();
    1.56 +private:
    1.57 +	CActiveReaper();
    1.58 +
    1.59 +	void Construct();
    1.60 +	virtual void RunL();
    1.61 +	virtual void DoCancel();
    1.62 +	
    1.63 +	TLoaderDeletedList* iLoaderDeletedList;
    1.64 +	};
    1.65 +
    1.66 +NONSHARABLE_CLASS(CSlottedChunkAllocator) : public CBase
    1.67 +	{
    1.68 +public:
    1.69 +	TInt Construct();
    1.70 +	TAny* Alloc(TUint aSize);
    1.71 +	void Free(TAny* aPtr);
    1.72 +
    1.73 +private:
    1.74 +	// slot size must be multiple of page size
    1.75 +	enum { KSlots=2, KSlotSize=16777216 };
    1.76 +	TUint iUsed[KSlots];
    1.77 +	RChunk iChunk;
    1.78 +	TUint8* iBase;
    1.79 +	};
    1.80 +
    1.81 +extern CSlottedChunkAllocator gFileDataAllocator;
    1.82 +
    1.83 +
    1.84 +//#define TRACE_CHECK_FAILURES
    1.85 +//#define TRACE_ON
    1.86 +
    1.87 +
    1.88 +#ifdef TRACE_CHECK_FAILURES
    1.89 +static TInt CheckFail(const char* aFile,TUint aLine)
    1.90 +	{
    1.91 +	RDebug::Printf("\nLoader check failure: %s line %d\n",aFile,aLine);
    1.92 +	return 0;
    1.93 +	}
    1.94 +#define CHECK_FAIL CheckFail(__FILE__,__LINE__)
    1.95 +#define CHECK_FAILURE(_r) (void)(_r==0 || CHECK_FAIL)
    1.96 +#else
    1.97 +#define CHECK_FAIL ((void)0)
    1.98 +#define CHECK_FAILURE(_r) ((void)0)
    1.99 +#endif
   1.100 +
   1.101 +#define RETURN_FAILURE(_r) return (CHECK_FAIL,_r)
   1.102 +#define LEAVE_FAILURE(_r) User::Leave((CHECK_FAIL,_r))
   1.103 +
   1.104 +#ifdef TRACE_ON
   1.105 +#define TRACE(_t) RDebug::Printf _t
   1.106 +#else
   1.107 +#define TRACE(_t) ((void)0)
   1.108 +#endif
   1.109 +#define E32IMAGEHEADER_TRACE TRACE
   1.110 +
   1.111 +
   1.112 +
   1.113 +#endif