epoc32/include/kernel/hal_int.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
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@4
     4
// under the terms of the License "Eclipse Public License v1.0"
williamr@2
     5
// which accompanies this distribution, and is available
williamr@4
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.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@4
    16
// WARNING: This file contains some APIs which are internal and are subject
williamr@4
    17
//          to change without notice. Such APIs should therefore not be used
williamr@4
    18
//          outside the Kernel and Hardware Services package.
williamr@2
    19
//
williamr@2
    20
williamr@2
    21
#ifndef __HAL_INT_H__
williamr@2
    22
#define __HAL_INT_H__
williamr@2
    23
williamr@2
    24
#include <hal.h>
williamr@2
    25
#include <e32svr.h>
williamr@2
    26
williamr@4
    27
// Work around data import/export restriction of X86 compilers
williamr@4
    28
#if defined(__X86__) || defined(__WINS__)
williamr@4
    29
#undef IMPORT_D
williamr@4
    30
#undef EXPORT_D
williamr@4
    31
#define IMPORT_D IMPORT_C
williamr@4
    32
#define EXPORT_D
williamr@4
    33
#endif
williamr@4
    34
williamr@2
    35
/**
williamr@2
    36
@publishedPartner
williamr@2
    37
@released
williamr@2
    38
williamr@2
    39
The signature for accessor functions for derived attributes
williamr@2
    40
williamr@2
    41
@param aDeviceNumber A device number is applicable when a system has
williamr@2
    42
multiple instances of a device. The parameter specifies which one to
williamr@2
    43
interrogate. Eg. a phone may have 2 displays, so it's HAL accessor functions
williamr@2
    44
would access different information depending on whether aDeviceNumber was 0 or 1.
williamr@2
    45
williamr@2
    46
@param aAttrib The HAL attribute to access.
williamr@2
    47
@param aSet ETrue if the specified attribute should be modified; EFalse for a read.
williamr@2
    48
@param aInOut A pointer to a TInt. If aSet is:
williamr@2
    49
	- ETrue it points to the new value to be written.
williamr@2
    50
	- EFalse it is used to return the value read.
williamr@2
    51
	  It may also be used to pass an argument in,
williamr@2
    52
	  in order to select one of multiple values to retreive.
williamr@2
    53
	  If it is equal to -1 then the function must
williamr@2
    54
	  return KErrArgument so that callers can identify that
williamr@2
    55
	  the function uses aInOut as an input even when aSet is false.
williamr@2
    56
williamr@2
    57
@return An error code
williamr@2
    58
	- KErrNone
williamr@2
    59
	- KErrArgument aInOut was invalid (may occur for aSet true or false)
williamr@2
    60
*/
williamr@2
    61
typedef TInt (*THalImplementation)(TInt aDeviceNumber, TInt aAttrib, TBool aSet, TAny* aInOut);
williamr@2
    62
williamr@2
    63
/**
williamr@2
    64
@internalComponent
williamr@2
    65
*/
williamr@2
    66
class HalInternal
williamr@2
    67
	{
williamr@2
    68
public:
williamr@2
    69
	static const TUint8 Properties[HAL::ENumHalAttributes];
williamr@2
    70
	static const TInt Offset[HAL::ENumHalAttributes];
williamr@2
    71
	// InitialValue[] is only exported for patchdata purposes (other executables
williamr@2
    72
	// must not import this array; all access should be through the published Hal
williamr@4
    73
	// APIs).  IMPORT_D needs to be on the declaration here so that it has external
williamr@2
    74
	// linkage (class data is treated differently to non-class data).
williamr@4
    75
	IMPORT_D static const TInt InitialValue[HAL::ENumHalAttributes];
williamr@2
    76
	static const THalImplementation Implementation[HAL::ENumHalAttributes];
williamr@2
    77
	static const TInt HalDataSize;
williamr@2
    78
williamr@2
    79
	enum THalPanic
williamr@2
    80
		{
williamr@2
    81
		EReadOffsetInvalid=0,
williamr@2
    82
		EWriteOffsetInvalid=1,
williamr@2
    83
		EInitialAllocFailed1=2,
williamr@2
    84
		EInitialAllocFailed2=3,
williamr@2
    85
		EInitialWriteFailed=4,
williamr@2
    86
		EInitialWriteFailed2=5,
williamr@2
    87
		ETlsSizeInvalid=6,
williamr@2
    88
		ENoSuchHalProp=7,
williamr@2
    89
		EGetPropFailed=8,
williamr@2
    90
		ESetPropFailed=9
williamr@2
    91
		};
williamr@2
    92
williamr@2
    93
	static void Panic(THalPanic aPanic);
williamr@2
    94
	static void InitialiseData();
williamr@2
    95
	static TInt ReadWord(TInt anOffset);
williamr@2
    96
	static TInt WriteWord(TInt anOffset, TInt aValue);
williamr@2
    97
	};
williamr@2
    98
williamr@2
    99
#endif