epoc32/include/kernel/hal_int.h
branchSymbian2
changeset 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/kernel/hal_int.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,88 @@
     1.4 +// Copyright (c) 1995-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 "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.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 +// hal\inc\hal_int.h
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#ifndef __HAL_INT_H__
    1.22 +#define __HAL_INT_H__
    1.23 +
    1.24 +#include <hal.h>
    1.25 +#include <e32svr.h>
    1.26 +
    1.27 +/**
    1.28 +@publishedPartner
    1.29 +@released
    1.30 +
    1.31 +The signature for accessor functions for derived attributes
    1.32 +
    1.33 +@param aDeviceNumber A device number is applicable when a system has
    1.34 +multiple instances of a device. The parameter specifies which one to
    1.35 +interrogate. Eg. a phone may have 2 displays, so it's HAL accessor functions
    1.36 +would access different information depending on whether aDeviceNumber was 0 or 1.
    1.37 +
    1.38 +@param aAttrib The HAL attribute to access.
    1.39 +@param aSet ETrue if the specified attribute should be modified; EFalse for a read.
    1.40 +@param aInOut A pointer to a TInt. If aSet is:
    1.41 +	- ETrue it points to the new value to be written.
    1.42 +	- EFalse it is used to return the value read.
    1.43 +	  It may also be used to pass an argument in,
    1.44 +	  in order to select one of multiple values to retreive.
    1.45 +	  If it is equal to -1 then the function must
    1.46 +	  return KErrArgument so that callers can identify that
    1.47 +	  the function uses aInOut as an input even when aSet is false.
    1.48 +
    1.49 +@return An error code
    1.50 +	- KErrNone
    1.51 +	- KErrArgument aInOut was invalid (may occur for aSet true or false)
    1.52 +*/
    1.53 +typedef TInt (*THalImplementation)(TInt aDeviceNumber, TInt aAttrib, TBool aSet, TAny* aInOut);
    1.54 +
    1.55 +/**
    1.56 +@internalComponent
    1.57 +*/
    1.58 +class HalInternal
    1.59 +	{
    1.60 +public:
    1.61 +	static const TUint8 Properties[HAL::ENumHalAttributes];
    1.62 +	static const TInt Offset[HAL::ENumHalAttributes];
    1.63 +	// InitialValue[] is only exported for patchdata purposes (other executables
    1.64 +	// must not import this array; all access should be through the published Hal
    1.65 +	// APIs).  EXPORT_C needs to be on the declaration here so that it has external
    1.66 +	// linkage (class data is treated differently to non-class data).
    1.67 +	EXPORT_C static const TInt InitialValue[HAL::ENumHalAttributes];
    1.68 +	static const THalImplementation Implementation[HAL::ENumHalAttributes];
    1.69 +	static const TInt HalDataSize;
    1.70 +
    1.71 +	enum THalPanic
    1.72 +		{
    1.73 +		EReadOffsetInvalid=0,
    1.74 +		EWriteOffsetInvalid=1,
    1.75 +		EInitialAllocFailed1=2,
    1.76 +		EInitialAllocFailed2=3,
    1.77 +		EInitialWriteFailed=4,
    1.78 +		EInitialWriteFailed2=5,
    1.79 +		ETlsSizeInvalid=6,
    1.80 +		ENoSuchHalProp=7,
    1.81 +		EGetPropFailed=8,
    1.82 +		ESetPropFailed=9
    1.83 +		};
    1.84 +
    1.85 +	static void Panic(THalPanic aPanic);
    1.86 +	static void InitialiseData();
    1.87 +	static TInt ReadWord(TInt anOffset);
    1.88 +	static TInt WriteWord(TInt anOffset, TInt aValue);
    1.89 +	};
    1.90 +
    1.91 +#endif