williamr@2: // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // hal\inc\hal_int.h williamr@2: // williamr@2: // williamr@2: williamr@2: #ifndef __HAL_INT_H__ williamr@2: #define __HAL_INT_H__ williamr@2: williamr@2: #include williamr@2: #include williamr@2: williamr@2: /** williamr@2: @publishedPartner williamr@2: @released williamr@2: williamr@2: The signature for accessor functions for derived attributes williamr@2: williamr@2: @param aDeviceNumber A device number is applicable when a system has williamr@2: multiple instances of a device. The parameter specifies which one to williamr@2: interrogate. Eg. a phone may have 2 displays, so it's HAL accessor functions williamr@2: would access different information depending on whether aDeviceNumber was 0 or 1. williamr@2: williamr@2: @param aAttrib The HAL attribute to access. williamr@2: @param aSet ETrue if the specified attribute should be modified; EFalse for a read. williamr@2: @param aInOut A pointer to a TInt. If aSet is: williamr@2: - ETrue it points to the new value to be written. williamr@2: - EFalse it is used to return the value read. williamr@2: It may also be used to pass an argument in, williamr@2: in order to select one of multiple values to retreive. williamr@2: If it is equal to -1 then the function must williamr@2: return KErrArgument so that callers can identify that williamr@2: the function uses aInOut as an input even when aSet is false. williamr@2: williamr@2: @return An error code williamr@2: - KErrNone williamr@2: - KErrArgument aInOut was invalid (may occur for aSet true or false) williamr@2: */ williamr@2: typedef TInt (*THalImplementation)(TInt aDeviceNumber, TInt aAttrib, TBool aSet, TAny* aInOut); williamr@2: williamr@2: /** williamr@2: @internalComponent williamr@2: */ williamr@2: class HalInternal williamr@2: { williamr@2: public: williamr@2: static const TUint8 Properties[HAL::ENumHalAttributes]; williamr@2: static const TInt Offset[HAL::ENumHalAttributes]; williamr@2: // InitialValue[] is only exported for patchdata purposes (other executables williamr@2: // must not import this array; all access should be through the published Hal williamr@2: // APIs). EXPORT_C needs to be on the declaration here so that it has external williamr@2: // linkage (class data is treated differently to non-class data). williamr@2: EXPORT_C static const TInt InitialValue[HAL::ENumHalAttributes]; williamr@2: static const THalImplementation Implementation[HAL::ENumHalAttributes]; williamr@2: static const TInt HalDataSize; williamr@2: williamr@2: enum THalPanic williamr@2: { williamr@2: EReadOffsetInvalid=0, williamr@2: EWriteOffsetInvalid=1, williamr@2: EInitialAllocFailed1=2, williamr@2: EInitialAllocFailed2=3, williamr@2: EInitialWriteFailed=4, williamr@2: EInitialWriteFailed2=5, williamr@2: ETlsSizeInvalid=6, williamr@2: ENoSuchHalProp=7, williamr@2: EGetPropFailed=8, williamr@2: ESetPropFailed=9 williamr@2: }; williamr@2: williamr@2: static void Panic(THalPanic aPanic); williamr@2: static void InitialiseData(); williamr@2: static TInt ReadWord(TInt anOffset); williamr@2: static TInt WriteWord(TInt anOffset, TInt aValue); williamr@2: }; williamr@2: williamr@2: #endif