1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/halservices/hal/inc/hal_int.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,99 @@
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 "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 +// hal\inc\hal_int.h
1.18 +//
1.19 +// WARNING: This file contains some APIs which are internal and are subject
1.20 +// to change without notice. Such APIs should therefore not be used
1.21 +// outside the Kernel and Hardware Services package.
1.22 +//
1.23 +
1.24 +#ifndef __HAL_INT_H__
1.25 +#define __HAL_INT_H__
1.26 +
1.27 +#include <hal.h>
1.28 +#include <e32svr.h>
1.29 +
1.30 +// Work around data import/export restriction of X86 compilers
1.31 +#if defined(__X86__) || defined(__WINS__)
1.32 +#undef IMPORT_D
1.33 +#undef EXPORT_D
1.34 +#define IMPORT_D IMPORT_C
1.35 +#define EXPORT_D
1.36 +#endif
1.37 +
1.38 +/**
1.39 +@publishedPartner
1.40 +@released
1.41 +
1.42 +The signature for accessor functions for derived attributes
1.43 +
1.44 +@param aDeviceNumber A device number is applicable when a system has
1.45 +multiple instances of a device. The parameter specifies which one to
1.46 +interrogate. Eg. a phone may have 2 displays, so it's HAL accessor functions
1.47 +would access different information depending on whether aDeviceNumber was 0 or 1.
1.48 +
1.49 +@param aAttrib The HAL attribute to access.
1.50 +@param aSet ETrue if the specified attribute should be modified; EFalse for a read.
1.51 +@param aInOut A pointer to a TInt. If aSet is:
1.52 + - ETrue it points to the new value to be written.
1.53 + - EFalse it is used to return the value read.
1.54 + It may also be used to pass an argument in,
1.55 + in order to select one of multiple values to retreive.
1.56 + If it is equal to -1 then the function must
1.57 + return KErrArgument so that callers can identify that
1.58 + the function uses aInOut as an input even when aSet is false.
1.59 +
1.60 +@return An error code
1.61 + - KErrNone
1.62 + - KErrArgument aInOut was invalid (may occur for aSet true or false)
1.63 +*/
1.64 +typedef TInt (*THalImplementation)(TInt aDeviceNumber, TInt aAttrib, TBool aSet, TAny* aInOut);
1.65 +
1.66 +/**
1.67 +@internalComponent
1.68 +*/
1.69 +class HalInternal
1.70 + {
1.71 +public:
1.72 + static const TUint8 Properties[HAL::ENumHalAttributes];
1.73 + static const TInt Offset[HAL::ENumHalAttributes];
1.74 + // InitialValue[] is only exported for patchdata purposes (other executables
1.75 + // must not import this array; all access should be through the published Hal
1.76 + // APIs). IMPORT_D needs to be on the declaration here so that it has external
1.77 + // linkage (class data is treated differently to non-class data).
1.78 + IMPORT_D static const TInt InitialValue[HAL::ENumHalAttributes];
1.79 + static const THalImplementation Implementation[HAL::ENumHalAttributes];
1.80 + static const TInt HalDataSize;
1.81 +
1.82 + enum THalPanic
1.83 + {
1.84 + EReadOffsetInvalid=0,
1.85 + EWriteOffsetInvalid=1,
1.86 + EInitialAllocFailed1=2,
1.87 + EInitialAllocFailed2=3,
1.88 + EInitialWriteFailed=4,
1.89 + EInitialWriteFailed2=5,
1.90 + ETlsSizeInvalid=6,
1.91 + ENoSuchHalProp=7,
1.92 + EGetPropFailed=8,
1.93 + ESetPropFailed=9
1.94 + };
1.95 +
1.96 + static void Panic(THalPanic aPanic);
1.97 + static void InitialiseData();
1.98 + static TInt ReadWord(TInt anOffset);
1.99 + static TInt WriteWord(TInt anOffset, TInt aValue);
1.100 + };
1.101 +
1.102 +#endif