Update contrib.
1 // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 // WARNING: This file contains some APIs which are internal and are subject
17 // to change without notice. Such APIs should therefore not be used
18 // outside the Kernel and Hardware Services package.
27 // Work around data import/export restriction of X86 compilers
28 #if defined(__X86__) || defined(__WINS__)
31 #define IMPORT_D IMPORT_C
39 The signature for accessor functions for derived attributes
41 @param aDeviceNumber A device number is applicable when a system has
42 multiple instances of a device. The parameter specifies which one to
43 interrogate. Eg. a phone may have 2 displays, so it's HAL accessor functions
44 would access different information depending on whether aDeviceNumber was 0 or 1.
46 @param aAttrib The HAL attribute to access.
47 @param aSet ETrue if the specified attribute should be modified; EFalse for a read.
48 @param aInOut A pointer to a TInt. If aSet is:
49 - ETrue it points to the new value to be written.
50 - EFalse it is used to return the value read.
51 It may also be used to pass an argument in,
52 in order to select one of multiple values to retreive.
53 If it is equal to -1 then the function must
54 return KErrArgument so that callers can identify that
55 the function uses aInOut as an input even when aSet is false.
59 - KErrArgument aInOut was invalid (may occur for aSet true or false)
61 typedef TInt (*THalImplementation)(TInt aDeviceNumber, TInt aAttrib, TBool aSet, TAny* aInOut);
69 static const TUint8 Properties[HAL::ENumHalAttributes];
70 static const TInt Offset[HAL::ENumHalAttributes];
71 // InitialValue[] is only exported for patchdata purposes (other executables
72 // must not import this array; all access should be through the published Hal
73 // APIs). IMPORT_D needs to be on the declaration here so that it has external
74 // linkage (class data is treated differently to non-class data).
75 IMPORT_D static const TInt InitialValue[HAL::ENumHalAttributes];
76 static const THalImplementation Implementation[HAL::ENumHalAttributes];
77 static const TInt HalDataSize;
82 EWriteOffsetInvalid=1,
83 EInitialAllocFailed1=2,
84 EInitialAllocFailed2=3,
85 EInitialWriteFailed=4,
86 EInitialWriteFailed2=5,
93 static void Panic(THalPanic aPanic);
94 static void InitialiseData();
95 static TInt ReadWord(TInt anOffset);
96 static TInt WriteWord(TInt anOffset, TInt aValue);