epoc32/include/kernel/hal_int.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@2
     4
// 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
     5
// which accompanies this distribution, and is available
williamr@2
     6
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
// hal\inc\hal_int.h
williamr@2
    15
// 
williamr@2
    16
//
williamr@2
    17
williamr@2
    18
#ifndef __HAL_INT_H__
williamr@2
    19
#define __HAL_INT_H__
williamr@2
    20
williamr@2
    21
#include <hal.h>
williamr@2
    22
#include <e32svr.h>
williamr@2
    23
williamr@2
    24
/**
williamr@2
    25
@publishedPartner
williamr@2
    26
@released
williamr@2
    27
williamr@2
    28
The signature for accessor functions for derived attributes
williamr@2
    29
williamr@2
    30
@param aDeviceNumber A device number is applicable when a system has
williamr@2
    31
multiple instances of a device. The parameter specifies which one to
williamr@2
    32
interrogate. Eg. a phone may have 2 displays, so it's HAL accessor functions
williamr@2
    33
would access different information depending on whether aDeviceNumber was 0 or 1.
williamr@2
    34
williamr@2
    35
@param aAttrib The HAL attribute to access.
williamr@2
    36
@param aSet ETrue if the specified attribute should be modified; EFalse for a read.
williamr@2
    37
@param aInOut A pointer to a TInt. If aSet is:
williamr@2
    38
	- ETrue it points to the new value to be written.
williamr@2
    39
	- EFalse it is used to return the value read.
williamr@2
    40
	  It may also be used to pass an argument in,
williamr@2
    41
	  in order to select one of multiple values to retreive.
williamr@2
    42
	  If it is equal to -1 then the function must
williamr@2
    43
	  return KErrArgument so that callers can identify that
williamr@2
    44
	  the function uses aInOut as an input even when aSet is false.
williamr@2
    45
williamr@2
    46
@return An error code
williamr@2
    47
	- KErrNone
williamr@2
    48
	- KErrArgument aInOut was invalid (may occur for aSet true or false)
williamr@2
    49
*/
williamr@2
    50
typedef TInt (*THalImplementation)(TInt aDeviceNumber, TInt aAttrib, TBool aSet, TAny* aInOut);
williamr@2
    51
williamr@2
    52
/**
williamr@2
    53
@internalComponent
williamr@2
    54
*/
williamr@2
    55
class HalInternal
williamr@2
    56
	{
williamr@2
    57
public:
williamr@2
    58
	static const TUint8 Properties[HAL::ENumHalAttributes];
williamr@2
    59
	static const TInt Offset[HAL::ENumHalAttributes];
williamr@2
    60
	// InitialValue[] is only exported for patchdata purposes (other executables
williamr@2
    61
	// must not import this array; all access should be through the published Hal
williamr@2
    62
	// APIs).  EXPORT_C needs to be on the declaration here so that it has external
williamr@2
    63
	// linkage (class data is treated differently to non-class data).
williamr@2
    64
	EXPORT_C static const TInt InitialValue[HAL::ENumHalAttributes];
williamr@2
    65
	static const THalImplementation Implementation[HAL::ENumHalAttributes];
williamr@2
    66
	static const TInt HalDataSize;
williamr@2
    67
williamr@2
    68
	enum THalPanic
williamr@2
    69
		{
williamr@2
    70
		EReadOffsetInvalid=0,
williamr@2
    71
		EWriteOffsetInvalid=1,
williamr@2
    72
		EInitialAllocFailed1=2,
williamr@2
    73
		EInitialAllocFailed2=3,
williamr@2
    74
		EInitialWriteFailed=4,
williamr@2
    75
		EInitialWriteFailed2=5,
williamr@2
    76
		ETlsSizeInvalid=6,
williamr@2
    77
		ENoSuchHalProp=7,
williamr@2
    78
		EGetPropFailed=8,
williamr@2
    79
		ESetPropFailed=9
williamr@2
    80
		};
williamr@2
    81
williamr@2
    82
	static void Panic(THalPanic aPanic);
williamr@2
    83
	static void InitialiseData();
williamr@2
    84
	static TInt ReadWord(TInt anOffset);
williamr@2
    85
	static TInt WriteWord(TInt anOffset, TInt aValue);
williamr@2
    86
	};
williamr@2
    87
williamr@2
    88
#endif