2005-06-29 23:48:24 +04:00
|
|
|
/*
|
2005-06-29 23:49:27 +04:00
|
|
|
__________________________________________________________________________
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Copyright (C) Intel Corporation 1994-1996
|
|
|
|
|
|
|
|
|
| All rights reserved. No part of this program or publication may be
|
|
|
|
| reproduced, transmitted, transcribed, stored in a retrieval system, or
|
|
|
|
| translated into any language or computer language, in any form or by any
|
|
|
|
| means, electronic, mechanical, magnetic, optical, chemical, manual, or
|
|
|
|
| otherwise, without the prior written permission of Intel Corporation.
|
|
|
|
|__________________________________________________________________________
|
|
|
|
|
|
2005-06-29 23:49:39 +04:00
|
|
|
| FILENAME: namespace.h - prototypes for accessing namespace
|
2005-06-29 23:49:27 +04:00
|
|
|
|__________________________________________________________________________
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2005-06-29 23:49:39 +04:00
|
|
|
#ifndef __NAMESPACE_H__
|
|
|
|
#define __NAMESPACE_H__
|
|
|
|
|
2005-06-29 23:49:40 +04:00
|
|
|
#include <datatypes.h>
|
|
|
|
#include <acpitables.h>
|
2005-06-29 23:49:39 +04:00
|
|
|
#include <acpiobj.h>
|
|
|
|
#include <pnp.h>
|
2005-06-29 23:49:27 +04:00
|
|
|
|
|
|
|
|
2005-06-29 23:49:41 +04:00
|
|
|
/*
|
|
|
|
* If USE_HASHING is not set, there will be an (nte *) prefix to each name
|
|
|
|
* table, containing either a NULL pointer or the address of the next array
|
|
|
|
* of nte's in the scope.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef USE_HASHING
|
|
|
|
#define NEXTSEG(NameTbl) ((nte **)NameTbl)[-1]
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-06-29 23:49:30 +04:00
|
|
|
/*
|
|
|
|
* An NsHandle (which is actually an nte *) can appear in some contexts,
|
2005-06-29 23:49:27 +04:00
|
|
|
* such as on apObjStack, where a pointer to an OBJECT_DESCRIPTOR can also
|
|
|
|
* appear. This macro is used to distinguish them.
|
|
|
|
*
|
|
|
|
* The first byte of an nte is a character of the name segment, which will
|
|
|
|
* be accepted by NcOK(). The first byte of an OBJECT_DESCRIPTOR is the
|
2005-06-29 23:49:36 +04:00
|
|
|
* ValTyp field, whose (UINT8) value comes from the NsType enumeration.
|
2005-06-29 23:49:27 +04:00
|
|
|
* Valid NsType values must not include any character acceptable in a name.
|
2005-06-29 22:18:17 +04:00
|
|
|
*/
|
2005-06-29 23:49:30 +04:00
|
|
|
|
2005-06-29 23:49:39 +04:00
|
|
|
#define IsNsHandle(h) (NcOK ((INT32) * (char *) (h)))
|
2005-06-29 23:46:58 +04:00
|
|
|
|
2005-06-29 23:49:27 +04:00
|
|
|
|
2005-06-29 23:49:31 +04:00
|
|
|
/* To search the entire name space, pass this as SearchBase */
|
2005-06-29 23:49:30 +04:00
|
|
|
|
2005-06-29 23:49:39 +04:00
|
|
|
#define NS_ALL ((NsHandle)0)
|
2005-06-29 23:49:30 +04:00
|
|
|
|
2005-06-29 23:49:27 +04:00
|
|
|
|
2005-06-29 23:49:41 +04:00
|
|
|
#define NUM_NS_TYPES 37
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Elements of NsProperties are bit significant
|
|
|
|
* and should be one-to-one with values of NsType in acpinmsp.h
|
|
|
|
*/
|
|
|
|
#define NEWSCOPE 1 /* a definition of this type opens a name scope */
|
|
|
|
#define LOCAL 2 /* suppress search of enclosing scopes */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Names built-in to the interpreter
|
|
|
|
*
|
|
|
|
* Initial values are currently supported only for types String and Number.
|
|
|
|
* To avoid type punning, both are specified as strings in this table.
|
|
|
|
*/
|
|
|
|
|
|
|
|
static struct InitVal {
|
|
|
|
char *Name;
|
|
|
|
NsType Type;
|
|
|
|
char *Val;
|
|
|
|
} PreDefinedNames[] = {
|
|
|
|
{"_GPE", DefAny},
|
|
|
|
{"_PR_", DefAny},
|
|
|
|
{"_SB_", DefAny},
|
|
|
|
{"_SI_", DefAny},
|
|
|
|
{"_TZ_", DefAny},
|
|
|
|
{"_REV", Number, "2"},
|
|
|
|
{"_OS_", String, "Intel AML interpreter"},
|
|
|
|
{"_GL_", Mutex},
|
|
|
|
|
|
|
|
/* Table terminator */
|
|
|
|
|
|
|
|
{(char *)0, Any}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* Namespace globals */
|
|
|
|
|
2005-06-29 23:49:44 +04:00
|
|
|
extern SCOPE_STACK ScopeStack[];
|
|
|
|
extern SCOPE_STACK *CurrentScope;
|
|
|
|
extern char BadType[];
|
|
|
|
extern char *NsTypeNames[NUM_NS_TYPES];
|
|
|
|
extern INT32 NsProperties[NUM_NS_TYPES];
|
2005-06-29 23:49:41 +04:00
|
|
|
|
|
|
|
|
2005-06-29 23:49:27 +04:00
|
|
|
|
2005-06-29 23:49:30 +04:00
|
|
|
|
2005-06-29 23:49:36 +04:00
|
|
|
/* Prototypes */
|
2005-06-29 23:49:35 +04:00
|
|
|
|
2005-06-29 23:49:36 +04:00
|
|
|
INT32
|
2005-06-29 23:49:39 +04:00
|
|
|
PriUnloadNameSpace (
|
|
|
|
void);
|
2005-06-29 23:49:30 +04:00
|
|
|
|
2005-06-29 22:18:17 +04:00
|
|
|
void
|
2005-06-29 23:49:39 +04:00
|
|
|
NsPushMethodScope (
|
|
|
|
NsHandle nNewScope);
|
2005-06-29 23:49:30 +04:00
|
|
|
|
2005-06-29 23:49:36 +04:00
|
|
|
INT32
|
2005-06-29 23:49:39 +04:00
|
|
|
AcpiExecuteMethod (
|
|
|
|
char *MethodName,
|
|
|
|
OBJECT_DESCRIPTOR **ReturnValue,
|
|
|
|
OBJECT_DESCRIPTOR **Params);
|
2005-06-29 23:49:30 +04:00
|
|
|
|
2005-06-29 23:49:38 +04:00
|
|
|
int
|
2005-06-29 23:49:39 +04:00
|
|
|
AcpiInit (
|
|
|
|
char *);
|
2005-06-29 23:49:38 +04:00
|
|
|
|
2005-06-29 23:49:36 +04:00
|
|
|
INT32
|
2005-06-29 23:49:39 +04:00
|
|
|
AcpiLoadNameSpace (
|
|
|
|
INT32 DisplayAmlDuringLoad);
|
2005-06-29 22:18:17 +04:00
|
|
|
|
2005-06-29 23:49:36 +04:00
|
|
|
INT32
|
2005-06-29 23:49:39 +04:00
|
|
|
AcpiUnloadNameSpace (
|
|
|
|
void);
|
2005-06-29 23:49:30 +04:00
|
|
|
|
2005-06-29 23:49:35 +04:00
|
|
|
void
|
2005-06-29 23:49:43 +04:00
|
|
|
AcpiLocalCleanup (
|
2005-06-29 23:49:39 +04:00
|
|
|
void);
|
2005-06-29 22:18:17 +04:00
|
|
|
|
2005-06-29 23:49:27 +04:00
|
|
|
NsType
|
2005-06-29 23:49:39 +04:00
|
|
|
NsValType (
|
|
|
|
NsHandle h);
|
2005-06-29 23:49:30 +04:00
|
|
|
|
2005-06-29 23:49:27 +04:00
|
|
|
void *
|
2005-06-29 23:49:39 +04:00
|
|
|
NsValPtr (
|
|
|
|
NsHandle h);
|
2005-06-29 23:49:30 +04:00
|
|
|
|
2005-06-29 22:18:17 +04:00
|
|
|
void
|
2005-06-29 23:49:39 +04:00
|
|
|
NsSetup (
|
|
|
|
void);
|
2005-06-29 23:49:30 +04:00
|
|
|
|
2005-06-29 23:49:36 +04:00
|
|
|
INT32
|
2005-06-29 23:49:39 +04:00
|
|
|
NsPopCurrent (
|
|
|
|
NsType Type);
|
2005-06-29 23:49:30 +04:00
|
|
|
|
2005-06-29 23:49:27 +04:00
|
|
|
NsHandle
|
2005-06-29 23:49:39 +04:00
|
|
|
NsEnter (
|
|
|
|
char *Name,
|
|
|
|
NsType Type,
|
|
|
|
OpMode iLE);
|
2005-06-29 23:49:30 +04:00
|
|
|
|
|
|
|
NsHandle
|
2005-06-29 23:49:39 +04:00
|
|
|
GetParentHandle (
|
|
|
|
NsHandle Look);
|
2005-06-29 23:49:30 +04:00
|
|
|
|
2005-06-29 23:49:27 +04:00
|
|
|
char *
|
2005-06-29 23:49:39 +04:00
|
|
|
NsNameOfCurrentScope (
|
|
|
|
void);
|
2005-06-29 23:49:30 +04:00
|
|
|
|
2005-06-29 23:49:27 +04:00
|
|
|
char *
|
2005-06-29 23:49:39 +04:00
|
|
|
NsFullyQualifiedName (
|
|
|
|
NsHandle Look);
|
2005-06-29 23:49:30 +04:00
|
|
|
|
2005-06-29 23:48:24 +04:00
|
|
|
void
|
2005-06-29 23:49:39 +04:00
|
|
|
NsSetMethod (
|
|
|
|
NsHandle h,
|
|
|
|
ptrdiff_t Offset,
|
|
|
|
INT32 Length);
|
|
|
|
|
2005-06-29 23:35:46 +04:00
|
|
|
void
|
2005-06-29 23:49:39 +04:00
|
|
|
NsSetValue (
|
|
|
|
NsHandle h,
|
|
|
|
ACPI_OBJECT_HANDLE v,
|
|
|
|
UINT8 ValTyp);
|
2005-06-29 23:49:30 +04:00
|
|
|
|
2005-06-29 23:48:52 +04:00
|
|
|
void
|
2005-06-29 23:49:39 +04:00
|
|
|
NsDumpTables (
|
|
|
|
NsHandle SearchBase,
|
|
|
|
INT32 MaxDepth);
|
2005-06-29 23:49:30 +04:00
|
|
|
|
2005-06-29 23:48:24 +04:00
|
|
|
void
|
2005-06-29 23:49:39 +04:00
|
|
|
NsDumpEntry (
|
2005-06-29 23:49:42 +04:00
|
|
|
NsHandle h);
|
2005-06-29 23:49:30 +04:00
|
|
|
|
2005-06-29 23:49:27 +04:00
|
|
|
NsHandle *
|
2005-06-29 23:49:39 +04:00
|
|
|
NsFindNames (
|
|
|
|
char *SearchFor,
|
|
|
|
NsHandle SearchBase,
|
|
|
|
INT32 MaxDepth);
|
2005-06-29 23:49:30 +04:00
|
|
|
|
2005-06-29 23:49:27 +04:00
|
|
|
NsHandle
|
2005-06-29 23:49:39 +04:00
|
|
|
NsGetHandle (
|
|
|
|
char *Name,
|
|
|
|
NsHandle Scope);
|
2005-06-29 23:49:30 +04:00
|
|
|
|
2005-06-29 23:49:36 +04:00
|
|
|
INT32
|
2005-06-29 23:49:39 +04:00
|
|
|
IsNsValue (
|
|
|
|
OBJECT_DESCRIPTOR *pOD);
|
2005-06-29 23:48:55 +04:00
|
|
|
|
2005-06-29 23:49:36 +04:00
|
|
|
INT32
|
2005-06-29 23:49:39 +04:00
|
|
|
NsMarkNS(
|
|
|
|
void);
|
2005-06-29 23:49:30 +04:00
|
|
|
|
2005-06-29 23:48:54 +04:00
|
|
|
|
2005-06-29 23:49:27 +04:00
|
|
|
#ifndef PLUMBER
|
2005-06-29 23:49:30 +04:00
|
|
|
|
2005-06-29 23:49:27 +04:00
|
|
|
/* dummy macros to make calls go away */
|
2005-06-29 23:49:30 +04:00
|
|
|
|
2005-06-29 23:49:31 +04:00
|
|
|
#define MarkStaticBlocks(Count)
|
|
|
|
#define RegisterStaticBlockPtr(BP)
|
2005-06-29 23:49:30 +04:00
|
|
|
|
2005-06-29 23:49:27 +04:00
|
|
|
#else
|
2005-06-29 23:48:24 +04:00
|
|
|
|
2005-06-29 23:48:52 +04:00
|
|
|
void
|
2005-06-29 23:49:39 +04:00
|
|
|
RegisterStaticBlockPtr (
|
|
|
|
void **BP);
|
2005-06-29 22:18:17 +04:00
|
|
|
|
|
|
|
void
|
2005-06-29 23:49:39 +04:00
|
|
|
MarkStaticBlocks (
|
|
|
|
INT32 *Count);
|
2005-06-29 23:01:37 +04:00
|
|
|
|
2005-06-29 23:49:27 +04:00
|
|
|
#endif /* PLUMBER */
|
2005-06-29 22:18:17 +04:00
|
|
|
|
2005-06-29 23:49:38 +04:00
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* The following are the publically defined APIs published and exposed to the OSD
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
INT32
|
2005-06-29 23:49:39 +04:00
|
|
|
AcpiLoadNameSpace (
|
|
|
|
INT32 DisplayAmlDuringLoad);
|
|
|
|
|
2005-06-29 23:49:38 +04:00
|
|
|
NsHandle
|
2005-06-29 23:49:39 +04:00
|
|
|
AcpiLoadTable (
|
|
|
|
NsHandle OpRegion);
|
2005-06-29 23:49:38 +04:00
|
|
|
|
|
|
|
INT32
|
2005-06-29 23:49:39 +04:00
|
|
|
AcpiUnLoadTable (
|
|
|
|
NsHandle TableHandle);
|
2005-06-29 23:49:38 +04:00
|
|
|
|
|
|
|
NsHandle
|
2005-06-29 23:49:39 +04:00
|
|
|
AcpiLoadTableFromFile (
|
|
|
|
char *FileName);
|
2005-06-29 23:49:38 +04:00
|
|
|
|
|
|
|
INT32
|
2005-06-29 23:49:39 +04:00
|
|
|
AcpiEnumerateDevice (
|
|
|
|
NsHandle DeviceHandle,
|
|
|
|
DEVICE_ID *HidPtr,
|
|
|
|
BOOLEAN *EnumPtr);
|
2005-06-29 23:49:38 +04:00
|
|
|
|
|
|
|
NsHandle
|
2005-06-29 23:49:39 +04:00
|
|
|
AcpiGetNextSubDevice(
|
|
|
|
NsHandle DeviceHandle,
|
|
|
|
UINT32 Count);
|
2005-06-29 23:49:38 +04:00
|
|
|
|
|
|
|
NsHandle
|
2005-06-29 23:49:39 +04:00
|
|
|
AcpiNameToHandle (
|
|
|
|
char *NsName,
|
|
|
|
NsHandle Scope);
|
2005-06-29 23:49:38 +04:00
|
|
|
|
|
|
|
char *
|
2005-06-29 23:49:39 +04:00
|
|
|
AcpiHandleToName (
|
|
|
|
NsHandle InHandle);
|
2005-06-29 23:49:38 +04:00
|
|
|
|
|
|
|
NsHandle
|
2005-06-29 23:49:39 +04:00
|
|
|
AcpiGetParentHandle (
|
|
|
|
NsHandle ChildHandle);
|
2005-06-29 23:49:38 +04:00
|
|
|
|
|
|
|
NsType
|
2005-06-29 23:49:39 +04:00
|
|
|
AcpiValueType (
|
|
|
|
NsHandle Handle);
|
2005-06-29 23:49:38 +04:00
|
|
|
|
|
|
|
char *
|
2005-06-29 23:49:39 +04:00
|
|
|
AcpiCurrentScopeName (
|
|
|
|
void);
|
2005-06-29 23:49:38 +04:00
|
|
|
|
|
|
|
BOOLEAN
|
2005-06-29 23:49:39 +04:00
|
|
|
AcpiIsNameSpaceHandle (
|
|
|
|
NsHandle QueryHandle);
|
2005-06-29 23:49:38 +04:00
|
|
|
|
|
|
|
BOOLEAN
|
2005-06-29 23:49:39 +04:00
|
|
|
AcpiIsNameSpaceValue (
|
|
|
|
NsType Value);
|
2005-06-29 23:49:38 +04:00
|
|
|
|
|
|
|
INT32
|
2005-06-29 23:49:39 +04:00
|
|
|
AcpiSetFirmwareWakingVector (
|
|
|
|
UINT32 PhysicalAddress);
|
2005-06-29 23:49:38 +04:00
|
|
|
|
|
|
|
INT32
|
2005-06-29 23:49:39 +04:00
|
|
|
AcpiGetFirmwareWakingVector (
|
|
|
|
UINT32 *PhysicalAddress);
|
2005-06-29 23:49:38 +04:00
|
|
|
|
|
|
|
ACPI_TABLE_HEADER *
|
2005-06-29 23:49:39 +04:00
|
|
|
AcpiGetTableHeader (
|
|
|
|
NsHandle Handle);
|
2005-06-29 23:49:38 +04:00
|
|
|
|
|
|
|
ACPI_TABLE_HEADER *
|
2005-06-29 23:49:39 +04:00
|
|
|
AcpiGetTable (
|
|
|
|
NsHandle Handle);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define ACPILIB_DATA_FILE_VERSION "ADF-001"
|
|
|
|
|
|
|
|
/* ACPI Table Prototypes */
|
|
|
|
|
|
|
|
/* functions visable outside of the library itself */
|
|
|
|
|
|
|
|
void
|
|
|
|
InitAcpiLibGlobals (
|
|
|
|
void);
|
|
|
|
|
|
|
|
INT32
|
|
|
|
LoadNameSpace (
|
|
|
|
INT32 DisplayAmlDuringLoad);
|
|
|
|
|
|
|
|
INT32
|
|
|
|
AcpiSetFirmwareWakingVector (
|
|
|
|
UINT32 PhysicalAddress);
|
|
|
|
|
|
|
|
INT32
|
|
|
|
AcpiGetFirmwareWakingVector (
|
|
|
|
UINT32 *PhysicalAddress);
|
|
|
|
|
|
|
|
/* functions private to the library */
|
|
|
|
|
|
|
|
INT32
|
|
|
|
FindRootSystemDescriptorPointer (
|
|
|
|
ROOT_SYSTEM_DESCRIPTOR_POINTER ** RSDP,
|
|
|
|
OSD_FILE *InputFile);
|
|
|
|
|
|
|
|
INT32
|
|
|
|
VerifyTableChecksum (
|
|
|
|
void *TableHeader,
|
|
|
|
INT32 DisplayBitFlags);
|
|
|
|
|
|
|
|
void *
|
|
|
|
GetTable (
|
|
|
|
UINT32 PhysicalAddress,
|
|
|
|
OSD_FILE *InputFile);
|
|
|
|
|
|
|
|
void *
|
|
|
|
GetFACS (
|
|
|
|
OSD_FILE *InputFile);
|
|
|
|
|
2005-06-29 23:49:38 +04:00
|
|
|
|
2005-06-29 23:49:41 +04:00
|
|
|
|
|
|
|
|
|
|
|
/* nsaccess functions */
|
|
|
|
|
|
|
|
|
|
|
|
INT32
|
|
|
|
ExistDownstreamSibling (
|
|
|
|
nte *ThisEntry,
|
|
|
|
INT32 Size,
|
|
|
|
nte *Appendage);
|
|
|
|
|
|
|
|
|
|
|
|
char *
|
|
|
|
InternalizeName (
|
|
|
|
char *DottedName);
|
|
|
|
|
|
|
|
void
|
|
|
|
NsPushCurrentScope (
|
|
|
|
nte *NewScope,
|
|
|
|
NsType Type);
|
|
|
|
|
|
|
|
nte *
|
|
|
|
AllocateNteDesc (
|
|
|
|
INT32 Size);
|
|
|
|
|
|
|
|
nte *
|
|
|
|
SearchTable (
|
|
|
|
char *NamSeg,
|
|
|
|
nte *NameTbl,
|
|
|
|
INT32 TableSize,
|
|
|
|
OpMode LoadMode,
|
|
|
|
NsType Type);
|
|
|
|
|
|
|
|
INT32
|
|
|
|
NsOpensScope (
|
|
|
|
NsType Type);
|
|
|
|
|
|
|
|
NsHandle
|
|
|
|
NsFindpVal (
|
|
|
|
OBJECT_DESCRIPTOR *ObjDesc,
|
|
|
|
NsHandle SearchBase,
|
|
|
|
INT32 MaxDepth);
|
|
|
|
|
|
|
|
char *
|
|
|
|
FindParentName (
|
|
|
|
nte *EntryToSearch,
|
|
|
|
INT32 Trace);
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-06-29 23:49:39 +04:00
|
|
|
#endif /* __NAMESPACE_H__ */
|