1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/examples/defrag/d_defrag_ref.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,98 @@
1.4 +// Copyright (c) 2007-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 +// e32test\defrag\d_defrag.h
1.18 +//
1.19 +//
1.20 +
1.21 +#if !defined(__D_DEFRAG_H__)
1.22 +#define __D_DEFRAG_H__
1.23 +#include <e32cmn.h>
1.24 +#ifndef __KERNEL_MODE__
1.25 +#include <e32std.h>
1.26 +#endif
1.27 +
1.28 +
1.29 +_LIT(KLddName,"DefragRef");
1.30 +
1.31 +class TCapsDefragTestV01
1.32 + {
1.33 +public:
1.34 + TVersion iVersion;
1.35 + };
1.36 +
1.37 +/** User-side interface to the defrag LDD
1.38 +*/
1.39 +class RDefragChannel : public RBusLogicalChannel
1.40 + {
1.41 +public:
1.42 + enum TControl
1.43 + {
1.44 + EControlGeneralDefragDfc,
1.45 + EControlGeneralDefragDfcComplete,
1.46 + EControlGeneralDefragSem,
1.47 + EControlGeneralDefrag,
1.48 + EControlAllocLowestZone,
1.49 + EControlClaimLowestZone,
1.50 + EControlCloseChunk,
1.51 + };
1.52 +
1.53 +public:
1.54 + inline TInt Open();
1.55 + inline TInt GeneralDefragDfc(TRequestStatus* aReq);
1.56 + inline TInt GeneralDefragDfcComplete();
1.57 + inline TInt GeneralDefrag();
1.58 + inline TInt GeneralDefragSem();
1.59 + inline TInt AllocLowestZone();
1.60 + inline TInt ClaimLowestZone();
1.61 + inline TInt CloseChunk();
1.62 + };
1.63 +
1.64 +
1.65 +#ifndef __KERNEL_MODE__
1.66 +inline TInt RDefragChannel::Open()
1.67 + {
1.68 + return DoCreate(KLddName,TVersion(0,1,1),KNullUnit,NULL,NULL);
1.69 + }
1.70 +
1.71 +inline TInt RDefragChannel::GeneralDefragDfc(TRequestStatus* aReq)
1.72 + {
1.73 + if (aReq != NULL)
1.74 + {
1.75 + *aReq = KRequestPending;
1.76 + }
1.77 + return DoControl(EControlGeneralDefragDfc, (TAny*)aReq);
1.78 + }
1.79 +
1.80 +inline TInt RDefragChannel::GeneralDefragDfcComplete()
1.81 + {
1.82 + return DoControl(EControlGeneralDefragDfcComplete);
1.83 + }
1.84 +
1.85 +inline TInt RDefragChannel::GeneralDefragSem()
1.86 + { return DoControl(EControlGeneralDefragSem); }
1.87 +
1.88 +inline TInt RDefragChannel::GeneralDefrag()
1.89 + { return DoControl(EControlGeneralDefrag); }
1.90 +
1.91 +inline TInt RDefragChannel::AllocLowestZone()
1.92 + { return DoControl(EControlAllocLowestZone); }
1.93 +
1.94 +inline TInt RDefragChannel::ClaimLowestZone()
1.95 + { return DoControl(EControlClaimLowestZone);}
1.96 +
1.97 +inline TInt RDefragChannel::CloseChunk()
1.98 + { return DoControl(EControlCloseChunk); }
1.99 +#endif
1.100 +
1.101 +#endif