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
);
147 AcpiNsOneCompleteParse (
150 ACPI_NAMESPACE_NODE
*StartNode
);
154 * nsaccess - Top-level namespace access
157 AcpiNsRootInitialize (
162 ACPI_GENERIC_STATE
*ScopeInfo
,
164 ACPI_OBJECT_TYPE Type
,
165 ACPI_INTERPRETER_MODE InterpreterMode
,
167 ACPI_WALK_STATE
*WalkState
,
168 ACPI_NAMESPACE_NODE
**RetNode
);
172 * nsalloc - Named object allocation/deallocation
174 ACPI_NAMESPACE_NODE
*
180 ACPI_NAMESPACE_NODE
*Node
);
184 ACPI_NAMESPACE_NODE
*Node
);
187 AcpiNsDeleteNamespaceSubtree (
188 ACPI_NAMESPACE_NODE
*ParentHandle
);
191 AcpiNsDeleteNamespaceByOwner (
192 ACPI_OWNER_ID OwnerId
);
196 ACPI_NAMESPACE_NODE
*Node
);
199 AcpiNsDeleteChildren (
200 ACPI_NAMESPACE_NODE
*Parent
);
209 * nsconvert - Dynamic object conversion routines
212 AcpiNsConvertToInteger (
213 ACPI_OPERAND_OBJECT
*OriginalObject
,
214 ACPI_OPERAND_OBJECT
**ReturnObject
);
217 AcpiNsConvertToString (
218 ACPI_OPERAND_OBJECT
*OriginalObject
,
219 ACPI_OPERAND_OBJECT
**ReturnObject
);
222 AcpiNsConvertToBuffer (
223 ACPI_OPERAND_OBJECT
*OriginalObject
,
224 ACPI_OPERAND_OBJECT
**ReturnObject
);
227 AcpiNsConvertToUnicode (
228 ACPI_NAMESPACE_NODE
*Scope
,
229 ACPI_OPERAND_OBJECT
*OriginalObject
,
230 ACPI_OPERAND_OBJECT
**ReturnObject
);
233 AcpiNsConvertToResource (
234 ACPI_NAMESPACE_NODE
*Scope
,
235 ACPI_OPERAND_OBJECT
*OriginalObject
,
236 ACPI_OPERAND_OBJECT
**ReturnObject
);
239 AcpiNsConvertToReference (
240 ACPI_NAMESPACE_NODE
*Scope
,
241 ACPI_OPERAND_OBJECT
*OriginalObject
,
242 ACPI_OPERAND_OBJECT
**ReturnObject
);
246 * nsdump - Namespace dump/print utilities
250 ACPI_HANDLE SearchBase
,
266 AcpiNsPrintPathname (
268 const char *Pathname
);
271 AcpiNsDumpOneObject (
272 ACPI_HANDLE ObjHandle
,
279 ACPI_OBJECT_TYPE Type
,
282 ACPI_OWNER_ID OwnerId
,
283 ACPI_HANDLE StartHandle
);
286 AcpiNsDumpObjectPaths (
287 ACPI_OBJECT_TYPE Type
,
290 ACPI_OWNER_ID OwnerId
,
291 ACPI_HANDLE StartHandle
);
295 * nseval - Namespace evaluation functions
299 ACPI_EVALUATE_INFO
*Info
);
302 AcpiNsExecModuleCodeList (
307 * nsarguments - Argument count/type checking for predefined/reserved names
310 AcpiNsCheckArgumentCount (
312 ACPI_NAMESPACE_NODE
*Node
,
313 UINT32 UserParamCount
,
314 const ACPI_PREDEFINED_INFO
*Info
);
317 AcpiNsCheckAcpiCompliance (
319 ACPI_NAMESPACE_NODE
*Node
,
320 const ACPI_PREDEFINED_INFO
*Predefined
);
323 AcpiNsCheckArgumentTypes (
324 ACPI_EVALUATE_INFO
*Info
);
328 * nspredef - Return value checking for predefined/reserved names
331 AcpiNsCheckReturnValue (
332 ACPI_NAMESPACE_NODE
*Node
,
333 ACPI_EVALUATE_INFO
*Info
,
334 UINT32 UserParamCount
,
335 ACPI_STATUS ReturnStatus
,
336 ACPI_OPERAND_OBJECT
**ReturnObject
);
339 AcpiNsCheckObjectType (
340 ACPI_EVALUATE_INFO
*Info
,
341 ACPI_OPERAND_OBJECT
**ReturnObjectPtr
,
342 UINT32 ExpectedBtypes
,
343 UINT32 PackageIndex
);
347 * nsprepkg - Validation of predefined name packages
351 ACPI_EVALUATE_INFO
*Info
,
352 ACPI_OPERAND_OBJECT
**ReturnObjectPtr
);
356 * nsnames - Name and Scope manipulation
360 ACPI_OBJECT_TYPE Type
);
363 AcpiNsGetExternalPathname (
364 ACPI_NAMESPACE_NODE
*Node
);
367 AcpiNsBuildNormalizedPath (
368 ACPI_NAMESPACE_NODE
*Node
,
374 AcpiNsGetNormalizedPathname (
375 ACPI_NAMESPACE_NODE
*Node
,
379 AcpiNsNameOfCurrentScope (
380 ACPI_WALK_STATE
*WalkState
);
383 AcpiNsHandleToPathname (
384 ACPI_HANDLE TargetHandle
,
390 ACPI_NAMESPACE_NODE
*ObjNode
,
395 ACPI_NAMESPACE_NODE
*PrefixNode
,
396 const char *ExternalPathname
,
398 ACPI_NAMESPACE_NODE
**OutNode
);
401 AcpiNsGetPathnameLength (
402 ACPI_NAMESPACE_NODE
*Node
);
406 * nsobject - Object management for namespace nodes
410 ACPI_NAMESPACE_NODE
*Node
,
411 ACPI_OPERAND_OBJECT
*Object
,
412 ACPI_OBJECT_TYPE Type
);
414 ACPI_OPERAND_OBJECT
*
415 AcpiNsGetAttachedObject (
416 ACPI_NAMESPACE_NODE
*Node
);
418 ACPI_OPERAND_OBJECT
*
419 AcpiNsGetSecondaryObject (
420 ACPI_OPERAND_OBJECT
*ObjDesc
);
424 ACPI_NAMESPACE_NODE
*Node
,
425 ACPI_OBJECT_HANDLER Handler
,
430 ACPI_NAMESPACE_NODE
*Node
,
431 ACPI_OBJECT_HANDLER Handler
);
434 AcpiNsGetAttachedData (
435 ACPI_NAMESPACE_NODE
*Node
,
436 ACPI_OBJECT_HANDLER Handler
,
441 * nsrepair - General return object repair for all
442 * predefined methods/objects
446 ACPI_EVALUATE_INFO
*Info
,
447 UINT32 ExpectedBtypes
,
449 ACPI_OPERAND_OBJECT
**ReturnObjectPtr
);
452 AcpiNsWrapWithPackage (
453 ACPI_EVALUATE_INFO
*Info
,
454 ACPI_OPERAND_OBJECT
*OriginalObject
,
455 ACPI_OPERAND_OBJECT
**ObjDescPtr
);
458 AcpiNsRepairNullElement (
459 ACPI_EVALUATE_INFO
*Info
,
460 UINT32 ExpectedBtypes
,
462 ACPI_OPERAND_OBJECT
**ReturnObjectPtr
);
465 AcpiNsRemoveNullElements (
466 ACPI_EVALUATE_INFO
*Info
,
468 ACPI_OPERAND_OBJECT
*ObjDesc
);
472 * nsrepair2 - Return object repair for specific
473 * predefined methods/objects
476 AcpiNsComplexRepairs (
477 ACPI_EVALUATE_INFO
*Info
,
478 ACPI_NAMESPACE_NODE
*Node
,
479 ACPI_STATUS ValidateStatus
,
480 ACPI_OPERAND_OBJECT
**ReturnObjectPtr
);
484 * nssearch - Namespace searching and entry
487 AcpiNsSearchAndEnter (
489 ACPI_WALK_STATE
*WalkState
,
490 ACPI_NAMESPACE_NODE
*Node
,
491 ACPI_INTERPRETER_MODE InterpreterMode
,
492 ACPI_OBJECT_TYPE Type
,
494 ACPI_NAMESPACE_NODE
**RetNode
);
497 AcpiNsSearchOneScope (
499 ACPI_NAMESPACE_NODE
*Node
,
500 ACPI_OBJECT_TYPE Type
,
501 ACPI_NAMESPACE_NODE
**RetNode
);
505 ACPI_WALK_STATE
*WalkState
,
506 ACPI_NAMESPACE_NODE
*ParentNode
,
507 ACPI_NAMESPACE_NODE
*Node
,
508 ACPI_OBJECT_TYPE Type
);
512 * nsutils - Utility functions
516 ACPI_NAMESPACE_NODE
*Node
);
520 ACPI_OBJECT_TYPE Type
);
523 AcpiNsPrintNodePathname (
524 ACPI_NAMESPACE_NODE
*Node
,
528 AcpiNsBuildInternalName (
529 ACPI_NAMESTRING_INFO
*Info
);
532 AcpiNsGetInternalNameLength (
533 ACPI_NAMESTRING_INFO
*Info
);
536 AcpiNsInternalizeName (
537 const char *DottedName
,
538 char **ConvertedName
);
541 AcpiNsExternalizeName (
542 UINT32 InternalNameLength
,
543 const char *InternalName
,
544 UINT32
*ConvertedNameLength
,
545 char **ConvertedName
);
547 ACPI_NAMESPACE_NODE
*
548 AcpiNsValidateHandle (
555 #endif /* __ACNAMESP_H__ */