1 /******************************************************************************
3 * Name: acnamesp.h - Namespace subcomponent prototypes and defines
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2016, Intel Corp.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
44 #ifndef __ACNAMESP_H__
45 #define __ACNAMESP_H__
48 /* To search the entire name space, pass this as SearchBase */
50 #define ACPI_NS_ALL ((ACPI_HANDLE)0)
53 * Elements of AcpiNsProperties are bit significant
54 * and should be one-to-one with values of ACPI_OBJECT_TYPE
56 #define ACPI_NS_NORMAL 0
57 #define ACPI_NS_NEWSCOPE 1 /* a definition of this type opens a name scope */
58 #define ACPI_NS_LOCAL 2 /* suppress search of enclosing scopes */
60 /* Flags for AcpiNsLookup, AcpiNsSearchAndEnter */
62 #define ACPI_NS_NO_UPSEARCH 0
63 #define ACPI_NS_SEARCH_PARENT 0x01
64 #define ACPI_NS_DONT_OPEN_SCOPE 0x02
65 #define ACPI_NS_NO_PEER_SEARCH 0x04
66 #define ACPI_NS_ERROR_IF_FOUND 0x08
67 #define ACPI_NS_PREFIX_IS_SCOPE 0x10
68 #define ACPI_NS_EXTERNAL 0x20
69 #define ACPI_NS_TEMPORARY 0x40
70 #define ACPI_NS_OVERRIDE_IF_FOUND 0x80
72 /* Flags for AcpiNsWalkNamespace */
74 #define ACPI_NS_WALK_NO_UNLOCK 0
75 #define ACPI_NS_WALK_UNLOCK 0x01
76 #define ACPI_NS_WALK_TEMP_NODES 0x02
78 /* Object is not a package element */
80 #define ACPI_NOT_PACKAGE_ELEMENT ACPI_UINT32_MAX
81 #define ACPI_ALL_PACKAGE_ELEMENTS (ACPI_UINT32_MAX-1)
83 /* Always emit warning message, not dependent on node flags */
85 #define ACPI_WARN_ALWAYS 0
89 * nsinit - Namespace initialization
92 AcpiNsInitializeObjects (
96 AcpiNsInitializeDevices (
101 * nsload - Namespace loading
104 AcpiNsLoadNamespace (
110 ACPI_NAMESPACE_NODE
*Node
);
114 * nswalk - walk the namespace
117 AcpiNsWalkNamespace (
118 ACPI_OBJECT_TYPE Type
,
119 ACPI_HANDLE StartObject
,
122 ACPI_WALK_CALLBACK DescendingCallback
,
123 ACPI_WALK_CALLBACK AscendingCallback
,
127 ACPI_NAMESPACE_NODE
*
129 ACPI_NAMESPACE_NODE
*Parent
,
130 ACPI_NAMESPACE_NODE
*Child
);
132 ACPI_NAMESPACE_NODE
*
133 AcpiNsGetNextNodeTyped (
134 ACPI_OBJECT_TYPE Type
,
135 ACPI_NAMESPACE_NODE
*Parent
,
136 ACPI_NAMESPACE_NODE
*Child
);
139 * nsparse - table parsing
144 ACPI_NAMESPACE_NODE
*StartNode
);
149 ACPI_NAMESPACE_NODE
*StartNode
);
152 AcpiNsOneCompleteParse (
155 ACPI_NAMESPACE_NODE
*StartNode
);
159 * nsaccess - Top-level namespace access
162 AcpiNsRootInitialize (
167 ACPI_GENERIC_STATE
*ScopeInfo
,
169 ACPI_OBJECT_TYPE Type
,
170 ACPI_INTERPRETER_MODE InterpreterMode
,
172 ACPI_WALK_STATE
*WalkState
,
173 ACPI_NAMESPACE_NODE
**RetNode
);
177 * nsalloc - Named object allocation/deallocation
179 ACPI_NAMESPACE_NODE
*
185 ACPI_NAMESPACE_NODE
*Node
);
189 ACPI_NAMESPACE_NODE
*Node
);
192 AcpiNsDeleteNamespaceSubtree (
193 ACPI_NAMESPACE_NODE
*ParentHandle
);
196 AcpiNsDeleteNamespaceByOwner (
197 ACPI_OWNER_ID OwnerId
);
201 ACPI_NAMESPACE_NODE
*Node
);
204 AcpiNsDeleteChildren (
205 ACPI_NAMESPACE_NODE
*Parent
);
214 * nsconvert - Dynamic object conversion routines
217 AcpiNsConvertToInteger (
218 ACPI_OPERAND_OBJECT
*OriginalObject
,
219 ACPI_OPERAND_OBJECT
**ReturnObject
);
222 AcpiNsConvertToString (
223 ACPI_OPERAND_OBJECT
*OriginalObject
,
224 ACPI_OPERAND_OBJECT
**ReturnObject
);
227 AcpiNsConvertToBuffer (
228 ACPI_OPERAND_OBJECT
*OriginalObject
,
229 ACPI_OPERAND_OBJECT
**ReturnObject
);
232 AcpiNsConvertToUnicode (
233 ACPI_NAMESPACE_NODE
*Scope
,
234 ACPI_OPERAND_OBJECT
*OriginalObject
,
235 ACPI_OPERAND_OBJECT
**ReturnObject
);
238 AcpiNsConvertToResource (
239 ACPI_NAMESPACE_NODE
*Scope
,
240 ACPI_OPERAND_OBJECT
*OriginalObject
,
241 ACPI_OPERAND_OBJECT
**ReturnObject
);
244 AcpiNsConvertToReference (
245 ACPI_NAMESPACE_NODE
*Scope
,
246 ACPI_OPERAND_OBJECT
*OriginalObject
,
247 ACPI_OPERAND_OBJECT
**ReturnObject
);
251 * nsdump - Namespace dump/print utilities
255 ACPI_HANDLE SearchBase
,
271 AcpiNsPrintPathname (
273 const char *Pathname
);
276 AcpiNsDumpOneObject (
277 ACPI_HANDLE ObjHandle
,
284 ACPI_OBJECT_TYPE Type
,
287 ACPI_OWNER_ID OwnerId
,
288 ACPI_HANDLE StartHandle
);
291 AcpiNsDumpObjectPaths (
292 ACPI_OBJECT_TYPE Type
,
295 ACPI_OWNER_ID OwnerId
,
296 ACPI_HANDLE StartHandle
);
300 * nseval - Namespace evaluation functions
304 ACPI_EVALUATE_INFO
*Info
);
307 AcpiNsExecModuleCodeList (
312 * nsarguments - Argument count/type checking for predefined/reserved names
315 AcpiNsCheckArgumentCount (
317 ACPI_NAMESPACE_NODE
*Node
,
318 UINT32 UserParamCount
,
319 const ACPI_PREDEFINED_INFO
*Info
);
322 AcpiNsCheckAcpiCompliance (
324 ACPI_NAMESPACE_NODE
*Node
,
325 const ACPI_PREDEFINED_INFO
*Predefined
);
328 AcpiNsCheckArgumentTypes (
329 ACPI_EVALUATE_INFO
*Info
);
333 * nspredef - Return value checking for predefined/reserved names
336 AcpiNsCheckReturnValue (
337 ACPI_NAMESPACE_NODE
*Node
,
338 ACPI_EVALUATE_INFO
*Info
,
339 UINT32 UserParamCount
,
340 ACPI_STATUS ReturnStatus
,
341 ACPI_OPERAND_OBJECT
**ReturnObject
);
344 AcpiNsCheckObjectType (
345 ACPI_EVALUATE_INFO
*Info
,
346 ACPI_OPERAND_OBJECT
**ReturnObjectPtr
,
347 UINT32 ExpectedBtypes
,
348 UINT32 PackageIndex
);
352 * nsprepkg - Validation of predefined name packages
356 ACPI_EVALUATE_INFO
*Info
,
357 ACPI_OPERAND_OBJECT
**ReturnObjectPtr
);
361 * nsnames - Name and Scope manipulation
365 ACPI_OBJECT_TYPE Type
);
368 AcpiNsGetExternalPathname (
369 ACPI_NAMESPACE_NODE
*Node
);
372 AcpiNsBuildNormalizedPath (
373 ACPI_NAMESPACE_NODE
*Node
,
379 AcpiNsGetNormalizedPathname (
380 ACPI_NAMESPACE_NODE
*Node
,
384 AcpiNsNameOfCurrentScope (
385 ACPI_WALK_STATE
*WalkState
);
388 AcpiNsHandleToPathname (
389 ACPI_HANDLE TargetHandle
,
395 ACPI_NAMESPACE_NODE
*ObjNode
,
399 AcpiNsGetNodeUnlocked (
400 ACPI_NAMESPACE_NODE
*PrefixNode
,
401 const char *ExternalPathname
,
403 ACPI_NAMESPACE_NODE
**OutNode
);
407 ACPI_NAMESPACE_NODE
*PrefixNode
,
408 const char *ExternalPathname
,
410 ACPI_NAMESPACE_NODE
**OutNode
);
413 AcpiNsGetPathnameLength (
414 ACPI_NAMESPACE_NODE
*Node
);
418 * nsobject - Object management for namespace nodes
422 ACPI_NAMESPACE_NODE
*Node
,
423 ACPI_OPERAND_OBJECT
*Object
,
424 ACPI_OBJECT_TYPE Type
);
426 ACPI_OPERAND_OBJECT
*
427 AcpiNsGetAttachedObject (
428 ACPI_NAMESPACE_NODE
*Node
);
430 ACPI_OPERAND_OBJECT
*
431 AcpiNsGetSecondaryObject (
432 ACPI_OPERAND_OBJECT
*ObjDesc
);
436 ACPI_NAMESPACE_NODE
*Node
,
437 ACPI_OBJECT_HANDLER Handler
,
442 ACPI_NAMESPACE_NODE
*Node
,
443 ACPI_OBJECT_HANDLER Handler
);
446 AcpiNsGetAttachedData (
447 ACPI_NAMESPACE_NODE
*Node
,
448 ACPI_OBJECT_HANDLER Handler
,
453 * nsrepair - General return object repair for all
454 * predefined methods/objects
458 ACPI_EVALUATE_INFO
*Info
,
459 UINT32 ExpectedBtypes
,
461 ACPI_OPERAND_OBJECT
**ReturnObjectPtr
);
464 AcpiNsWrapWithPackage (
465 ACPI_EVALUATE_INFO
*Info
,
466 ACPI_OPERAND_OBJECT
*OriginalObject
,
467 ACPI_OPERAND_OBJECT
**ObjDescPtr
);
470 AcpiNsRepairNullElement (
471 ACPI_EVALUATE_INFO
*Info
,
472 UINT32 ExpectedBtypes
,
474 ACPI_OPERAND_OBJECT
**ReturnObjectPtr
);
477 AcpiNsRemoveNullElements (
478 ACPI_EVALUATE_INFO
*Info
,
480 ACPI_OPERAND_OBJECT
*ObjDesc
);
484 * nsrepair2 - Return object repair for specific
485 * predefined methods/objects
488 AcpiNsComplexRepairs (
489 ACPI_EVALUATE_INFO
*Info
,
490 ACPI_NAMESPACE_NODE
*Node
,
491 ACPI_STATUS ValidateStatus
,
492 ACPI_OPERAND_OBJECT
**ReturnObjectPtr
);
496 * nssearch - Namespace searching and entry
499 AcpiNsSearchAndEnter (
501 ACPI_WALK_STATE
*WalkState
,
502 ACPI_NAMESPACE_NODE
*Node
,
503 ACPI_INTERPRETER_MODE InterpreterMode
,
504 ACPI_OBJECT_TYPE Type
,
506 ACPI_NAMESPACE_NODE
**RetNode
);
509 AcpiNsSearchOneScope (
511 ACPI_NAMESPACE_NODE
*Node
,
512 ACPI_OBJECT_TYPE Type
,
513 ACPI_NAMESPACE_NODE
**RetNode
);
517 ACPI_WALK_STATE
*WalkState
,
518 ACPI_NAMESPACE_NODE
*ParentNode
,
519 ACPI_NAMESPACE_NODE
*Node
,
520 ACPI_OBJECT_TYPE Type
);
524 * nsutils - Utility functions
528 ACPI_NAMESPACE_NODE
*Node
);
532 ACPI_OBJECT_TYPE Type
);
535 AcpiNsPrintNodePathname (
536 ACPI_NAMESPACE_NODE
*Node
,
540 AcpiNsBuildInternalName (
541 ACPI_NAMESTRING_INFO
*Info
);
544 AcpiNsGetInternalNameLength (
545 ACPI_NAMESTRING_INFO
*Info
);
548 AcpiNsInternalizeName (
549 const char *DottedName
,
550 char **ConvertedName
);
553 AcpiNsExternalizeName (
554 UINT32 InternalNameLength
,
555 const char *InternalName
,
556 UINT32
*ConvertedNameLength
,
557 char **ConvertedName
);
559 ACPI_NAMESPACE_NODE
*
560 AcpiNsValidateHandle (
567 #endif /* __ACNAMESP_H__ */