acnamesp.h revision 151937
159110Sarchie/****************************************************************************** 259110Sarchie * 379727Sschweikh * Name: acnamesp.h - Namespace subcomponent prototypes and defines 459110Sarchie * $Revision: 1.142 $ 559110Sarchie * 659110Sarchie *****************************************************************************/ 759110Sarchie 859110Sarchie/****************************************************************************** 959110Sarchie * 1059110Sarchie * 1. Copyright Notice 1159110Sarchie * 1259110Sarchie * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp. 1359110Sarchie * All rights reserved. 1479727Sschweikh * 1559110Sarchie * 2. License 1659110Sarchie * 1759110Sarchie * 2.1. This is your license from Intel Corp. under its intellectual property 1859110Sarchie * rights. You may have additional license terms from the party that provided 1959110Sarchie * you this software, covering your right to use that party's intellectual 2059110Sarchie * property rights. 2159110Sarchie * 2259110Sarchie * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 2359110Sarchie * copy of the source code appearing in this file ("Covered Code") an 2459110Sarchie * irrevocable, perpetual, worldwide license under Intel's copyrights in the 2559110Sarchie * base code distributed originally by Intel ("Original Intel Code") to copy, 2659110Sarchie * make derivatives, distribute, use and display any portion of the Covered 2759110Sarchie * Code in any form, with the right to sublicense such rights; and 2859110Sarchie * 2959110Sarchie * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 3059110Sarchie * license (with the right to sublicense), under only those claims of Intel 3159110Sarchie * patents that are infringed by the Original Intel Code, to make, use, sell, 3279727Sschweikh * offer to sell, and import the Covered Code and derivative works thereof 3367627Sasmodai * solely to the minimum extent necessary to exercise the above copyright 3459110Sarchie * license, and in no event shall the patent license extend to any additions 3559110Sarchie * to or modifications of the Original Intel Code. No other license or right 3659110Sarchie * is granted directly or by implication, estoppel or otherwise; 3759110Sarchie * 3859110Sarchie * The above copyright and patent license is granted only if the following 3959982Sarchie * conditions are met: 4079538Sru * 4159110Sarchie * 3. Conditions 4259110Sarchie * 4359110Sarchie * 3.1. Redistribution of Source with Rights to Further Distribute Source. 4459110Sarchie * Redistribution of source code of any substantial portion of the Covered 4584306Sru * Code or modification with rights to further distribute source must include 4684306Sru * the above Copyright Notice, the above License, this list of Conditions, 4759110Sarchie * and the following Disclaimer and Export Compliance provision. In addition, 4859110Sarchie * Licensee must cause all Covered Code to which Licensee contributes to 4959110Sarchie * contain a file documenting the changes Licensee made to create that Covered 5059110Sarchie * Code and the date of any change. Licensee must include in that file the 5159110Sarchie * documentation of any changes made by any predecessor Licensee. Licensee 5259110Sarchie * must include a prominent statement that the modification is derived, 5359110Sarchie * directly or indirectly, from Original Intel Code. 5459110Sarchie * 5559110Sarchie * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 5659110Sarchie * Redistribution of source code of any substantial portion of the Covered 5759110Sarchie * Code or modification without rights to further distribute source must 5859110Sarchie * include the following Disclaimer and Export Compliance provision in the 5959110Sarchie * documentation and/or other materials provided with distribution. In 6059110Sarchie * addition, Licensee may not authorize further sublicense of source of any 6159110Sarchie * portion of the Covered Code, and must include terms to the effect that the 6259982Sarchie * license from Licensee to its licensee is limited to the intellectual 6359110Sarchie * property embodied in the software Licensee provides to its licensee, and 6459110Sarchie * not to intellectual property embodied in modifications its licensee may 6559110Sarchie * make. 6659110Sarchie * 67242997Sjoel * 3.3. Redistribution of Executable. Redistribution in executable form of any 68242997Sjoel * substantial portion of the Covered Code or modification must reproduce the 6959110Sarchie * above Copyright Notice, and the following Disclaimer and Export Compliance 7059982Sarchie * provision in the documentation and/or other materials provided with the 7159110Sarchie * distribution. 7259110Sarchie * 7359110Sarchie * 3.4. Intel retains all right, title, and interest in and to the Original 7459110Sarchie * Intel Code. 75242997Sjoel * 7659110Sarchie * 3.5. Neither the name Intel nor any other trademark owned or controlled by 7759982Sarchie * Intel shall be used in advertising or otherwise to promote the sale, use or 7859110Sarchie * other dealings in products derived from or relating to the Covered Code 7959110Sarchie * without prior written authorization from Intel. 8059110Sarchie * 8159110Sarchie * 4. Disclaimer and Export Compliance 8259110Sarchie * 8359110Sarchie * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 8459110Sarchie * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 8559110Sarchie * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 8659110Sarchie * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 8759110Sarchie * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 8859110Sarchie * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 8959110Sarchie * PARTICULAR PURPOSE. 9059110Sarchie * 9159110Sarchie * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 9274039Sru * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 9359110Sarchie * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 9459110Sarchie * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 9559110Sarchie * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 9659110Sarchie * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 9759110Sarchie * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 9859110Sarchie * LIMITED REMEDY. 9992810Sarchie * 10059110Sarchie * 4.3. Licensee shall not export, either directly or indirectly, any of this 10192810Sarchie * software or system incorporating such software without first obtaining any 10259110Sarchie * required license or other approval from the U. S. Department of Commerce or 10392810Sarchie * any other agency or department of the United States Government. In the 10459110Sarchie * event Licensee exports any such software from the United States or 10559110Sarchie * re-exports any such software from a foreign destination, Licensee shall 10659110Sarchie * ensure that the distribution and export/re-export of the software is in 10759110Sarchie * compliance with all laws, regulations, orders, or other restrictions of the 108231564Sed * U.S. Export Administration Regulations. Licensee agrees that neither it nor 10959110Sarchie * any of its subsidiaries will export/re-export any technical data, process, 11059110Sarchie * software, or service, directly or indirectly, to any country for which the 11159110Sarchie * United States government or any agency thereof requires an export license, 11259110Sarchie * other governmental approval, or letter of assurance, without first obtaining 11359110Sarchie * such license, approval or letter. 11459110Sarchie * 11559110Sarchie *****************************************************************************/ 11659110Sarchie 11759110Sarchie#ifndef __ACNAMESP_H__ 11859110Sarchie#define __ACNAMESP_H__ 11959110Sarchie 12059110Sarchie 12159110Sarchie/* To search the entire name space, pass this as SearchBase */ 12259110Sarchie 12359110Sarchie#define ACPI_NS_ALL ((ACPI_HANDLE)0) 12459110Sarchie 12559110Sarchie/* 12659110Sarchie * Elements of AcpiNsProperties are bit significant 12759110Sarchie * and should be one-to-one with values of ACPI_OBJECT_TYPE 12859110Sarchie */ 12959110Sarchie#define ACPI_NS_NORMAL 0 13059110Sarchie#define ACPI_NS_NEWSCOPE 1 /* a definition of this type opens a name scope */ 13159110Sarchie#define ACPI_NS_LOCAL 2 /* suppress search of enclosing scopes */ 13259110Sarchie 13359110Sarchie/* Flags for AcpiNsLookup, AcpiNsSearchAndEnter */ 13459110Sarchie 13559110Sarchie#define ACPI_NS_NO_UPSEARCH 0 13659110Sarchie#define ACPI_NS_SEARCH_PARENT 0x01 13759110Sarchie#define ACPI_NS_DONT_OPEN_SCOPE 0x02 13859110Sarchie#define ACPI_NS_NO_PEER_SEARCH 0x04 13959110Sarchie#define ACPI_NS_ERROR_IF_FOUND 0x08 14059110Sarchie 14159110Sarchie#define ACPI_NS_WALK_UNLOCK TRUE 14259110Sarchie#define ACPI_NS_WALK_NO_UNLOCK FALSE 14359110Sarchie 14459110Sarchie 14559110Sarchie/* 14659110Sarchie * nsinit - Namespace initialization 14759110Sarchie */ 14859110SarchieACPI_STATUS 14959110SarchieAcpiNsInitializeObjects ( 15059110Sarchie void); 15159110Sarchie 15259110SarchieACPI_STATUS 15359110SarchieAcpiNsInitializeDevices ( 15459110Sarchie void); 15559110Sarchie 15659110Sarchie 15759110Sarchie/* 15859110Sarchie * nsload - Namespace loading 15959110Sarchie */ 16059110SarchieACPI_STATUS 16159110SarchieAcpiNsLoadNamespace ( 16259110Sarchie void); 16359110Sarchie 16459982SarchieACPI_STATUS 16559110SarchieAcpiNsLoadTable ( 16659110Sarchie ACPI_TABLE_DESC *TableDesc, 16759110Sarchie ACPI_NAMESPACE_NODE *Node); 16859110Sarchie 16959110Sarchie 17059110Sarchie/* 17159110Sarchie * nswalk - walk the namespace 17259110Sarchie */ 17359110SarchieACPI_STATUS 17459110SarchieAcpiNsWalkNamespace ( 17559110Sarchie ACPI_OBJECT_TYPE Type, 17659110Sarchie ACPI_HANDLE StartObject, 17759110Sarchie UINT32 MaxDepth, 17859110Sarchie BOOLEAN UnlockBeforeCallback, 17959110Sarchie ACPI_WALK_CALLBACK UserFunction, 18059110Sarchie void *Context, 18159110Sarchie void **ReturnValue); 18259110Sarchie 18359110SarchieACPI_NAMESPACE_NODE * 18459110SarchieAcpiNsGetNextNode ( 18559110Sarchie ACPI_OBJECT_TYPE Type, 18659110Sarchie ACPI_NAMESPACE_NODE *Parent, 18760052Sarchie ACPI_NAMESPACE_NODE *Child); 18881588Sru 189140561Sru 190140561Sru/* 191140561Sru * nsparse - table parsing 192140561Sru */ 193140561SruACPI_STATUS 194AcpiNsParseTable ( 195 ACPI_TABLE_DESC *TableDesc, 196 ACPI_NAMESPACE_NODE *Scope); 197 198ACPI_STATUS 199AcpiNsOneCompleteParse ( 200 UINT8 PassNumber, 201 ACPI_TABLE_DESC *TableDesc); 202 203 204/* 205 * nsaccess - Top-level namespace access 206 */ 207ACPI_STATUS 208AcpiNsRootInitialize ( 209 void); 210 211ACPI_STATUS 212AcpiNsLookup ( 213 ACPI_GENERIC_STATE *ScopeInfo, 214 char *Name, 215 ACPI_OBJECT_TYPE Type, 216 ACPI_INTERPRETER_MODE InterpreterMode, 217 UINT32 Flags, 218 ACPI_WALK_STATE *WalkState, 219 ACPI_NAMESPACE_NODE **RetNode); 220 221 222/* 223 * nsalloc - Named object allocation/deallocation 224 */ 225ACPI_NAMESPACE_NODE * 226AcpiNsCreateNode ( 227 UINT32 Name); 228 229void 230AcpiNsDeleteNode ( 231 ACPI_NAMESPACE_NODE *Node); 232 233void 234AcpiNsDeleteNamespaceSubtree ( 235 ACPI_NAMESPACE_NODE *ParentHandle); 236 237void 238AcpiNsDeleteNamespaceByOwner ( 239 ACPI_OWNER_ID OwnerId); 240 241void 242AcpiNsDetachObject ( 243 ACPI_NAMESPACE_NODE *Node); 244 245void 246AcpiNsDeleteChildren ( 247 ACPI_NAMESPACE_NODE *Parent); 248 249int 250AcpiNsCompareNames ( 251 char *Name1, 252 char *Name2); 253 254 255/* 256 * nsdump - Namespace dump/print utilities 257 */ 258void 259AcpiNsDumpTables ( 260 ACPI_HANDLE SearchBase, 261 UINT32 MaxDepth); 262 263void 264AcpiNsDumpEntry ( 265 ACPI_HANDLE Handle, 266 UINT32 DebugLevel); 267 268void 269AcpiNsDumpPathname ( 270 ACPI_HANDLE Handle, 271 char *Msg, 272 UINT32 Level, 273 UINT32 Component); 274 275void 276AcpiNsPrintPathname ( 277 UINT32 NumSegments, 278 char *Pathname); 279 280ACPI_STATUS 281AcpiNsDumpOneObject ( 282 ACPI_HANDLE ObjHandle, 283 UINT32 Level, 284 void *Context, 285 void **ReturnValue); 286 287void 288AcpiNsDumpObjects ( 289 ACPI_OBJECT_TYPE Type, 290 UINT8 DisplayType, 291 UINT32 MaxDepth, 292 ACPI_OWNER_ID OwnerId, 293 ACPI_HANDLE StartHandle); 294 295 296/* 297 * nseval - Namespace evaluation functions 298 */ 299ACPI_STATUS 300AcpiNsEvaluateByHandle ( 301 ACPI_PARAMETER_INFO *Info); 302 303ACPI_STATUS 304AcpiNsEvaluateByName ( 305 char *Pathname, 306 ACPI_PARAMETER_INFO *Info); 307 308ACPI_STATUS 309AcpiNsEvaluateRelative ( 310 char *Pathname, 311 ACPI_PARAMETER_INFO *Info); 312 313 314/* 315 * nsnames - Name and Scope manipulation 316 */ 317UINT32 318AcpiNsOpensScope ( 319 ACPI_OBJECT_TYPE Type); 320 321char * 322AcpiNsGetExternalPathname ( 323 ACPI_NAMESPACE_NODE *Node); 324 325char * 326AcpiNsNameOfCurrentScope ( 327 ACPI_WALK_STATE *WalkState); 328 329ACPI_STATUS 330AcpiNsHandleToPathname ( 331 ACPI_HANDLE TargetHandle, 332 ACPI_BUFFER *Buffer); 333 334BOOLEAN 335AcpiNsPatternMatch ( 336 ACPI_NAMESPACE_NODE *ObjNode, 337 char *SearchFor); 338 339ACPI_STATUS 340AcpiNsGetNodeByPath ( 341 char *ExternalPathname, 342 ACPI_NAMESPACE_NODE *InPrefixNode, 343 UINT32 Flags, 344 ACPI_NAMESPACE_NODE **OutNode); 345 346ACPI_SIZE 347AcpiNsGetPathnameLength ( 348 ACPI_NAMESPACE_NODE *Node); 349 350 351/* 352 * nsobject - Object management for namespace nodes 353 */ 354ACPI_STATUS 355AcpiNsAttachObject ( 356 ACPI_NAMESPACE_NODE *Node, 357 ACPI_OPERAND_OBJECT *Object, 358 ACPI_OBJECT_TYPE Type); 359 360ACPI_OPERAND_OBJECT * 361AcpiNsGetAttachedObject ( 362 ACPI_NAMESPACE_NODE *Node); 363 364ACPI_OPERAND_OBJECT * 365AcpiNsGetSecondaryObject ( 366 ACPI_OPERAND_OBJECT *ObjDesc); 367 368ACPI_STATUS 369AcpiNsAttachData ( 370 ACPI_NAMESPACE_NODE *Node, 371 ACPI_OBJECT_HANDLER Handler, 372 void *Data); 373 374ACPI_STATUS 375AcpiNsDetachData ( 376 ACPI_NAMESPACE_NODE *Node, 377 ACPI_OBJECT_HANDLER Handler); 378 379ACPI_STATUS 380AcpiNsGetAttachedData ( 381 ACPI_NAMESPACE_NODE *Node, 382 ACPI_OBJECT_HANDLER Handler, 383 void **Data); 384 385 386/* 387 * nssearch - Namespace searching and entry 388 */ 389ACPI_STATUS 390AcpiNsSearchAndEnter ( 391 UINT32 EntryName, 392 ACPI_WALK_STATE *WalkState, 393 ACPI_NAMESPACE_NODE *Node, 394 ACPI_INTERPRETER_MODE InterpreterMode, 395 ACPI_OBJECT_TYPE Type, 396 UINT32 Flags, 397 ACPI_NAMESPACE_NODE **RetNode); 398 399ACPI_STATUS 400AcpiNsSearchNode ( 401 UINT32 EntryName, 402 ACPI_NAMESPACE_NODE *Node, 403 ACPI_OBJECT_TYPE Type, 404 ACPI_NAMESPACE_NODE **RetNode); 405 406void 407AcpiNsInstallNode ( 408 ACPI_WALK_STATE *WalkState, 409 ACPI_NAMESPACE_NODE *ParentNode, 410 ACPI_NAMESPACE_NODE *Node, 411 ACPI_OBJECT_TYPE Type); 412 413 414/* 415 * nsutils - Utility functions 416 */ 417BOOLEAN 418AcpiNsValidRootPrefix ( 419 char Prefix); 420 421ACPI_OBJECT_TYPE 422AcpiNsGetType ( 423 ACPI_NAMESPACE_NODE *Node); 424 425UINT32 426AcpiNsLocal ( 427 ACPI_OBJECT_TYPE Type); 428 429void 430AcpiNsReportError ( 431 char *ModuleName, 432 UINT32 LineNumber, 433 UINT32 ComponentId, 434 char *InternalName, 435 ACPI_STATUS LookupStatus); 436 437void 438AcpiNsReportMethodError ( 439 char *ModuleName, 440 UINT32 LineNumber, 441 UINT32 ComponentId, 442 char *Message, 443 ACPI_NAMESPACE_NODE *Node, 444 char *Path, 445 ACPI_STATUS LookupStatus); 446 447void 448AcpiNsPrintNodePathname ( 449 ACPI_NAMESPACE_NODE *Node, 450 char *Msg); 451 452ACPI_STATUS 453AcpiNsBuildInternalName ( 454 ACPI_NAMESTRING_INFO *Info); 455 456void 457AcpiNsGetInternalNameLength ( 458 ACPI_NAMESTRING_INFO *Info); 459 460ACPI_STATUS 461AcpiNsInternalizeName ( 462 char *DottedName, 463 char **ConvertedName); 464 465ACPI_STATUS 466AcpiNsExternalizeName ( 467 UINT32 InternalNameLength, 468 char *InternalName, 469 UINT32 *ConvertedNameLength, 470 char **ConvertedName); 471 472ACPI_NAMESPACE_NODE * 473AcpiNsMapHandleToNode ( 474 ACPI_HANDLE Handle); 475 476ACPI_HANDLE 477AcpiNsConvertEntryToHandle( 478 ACPI_NAMESPACE_NODE *Node); 479 480void 481AcpiNsTerminate ( 482 void); 483 484ACPI_NAMESPACE_NODE * 485AcpiNsGetParentNode ( 486 ACPI_NAMESPACE_NODE *Node); 487 488 489ACPI_NAMESPACE_NODE * 490AcpiNsGetNextValidNode ( 491 ACPI_NAMESPACE_NODE *Node); 492 493#endif /* __ACNAMESP_H__ */ 494