1 /******************************************************************************
3 * Name: acnamesp.h - Namespace subcomponent prototypes and defines
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2015, 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
82 /* Always emit warning message, not dependent on node flags */
84 #define ACPI_WARN_ALWAYS 0
88 * nsinit - Namespace initialization
91 AcpiNsInitializeObjects (
95 AcpiNsInitializeDevices (
100 * nsload - Namespace loading
103 AcpiNsLoadNamespace (
109 ACPI_NAMESPACE_NODE
*Node
);
113 * nswalk - walk the namespace
116 AcpiNsWalkNamespace (
117 ACPI_OBJECT_TYPE Type
,
118 ACPI_HANDLE StartObject
,
121 ACPI_WALK_CALLBACK DescendingCallback
,
122 ACPI_WALK_CALLBACK AscendingCallback
,
126 ACPI_NAMESPACE_NODE
*
128 ACPI_NAMESPACE_NODE
*Parent
,
129 ACPI_NAMESPACE_NODE
*Child
);
131 ACPI_NAMESPACE_NODE
*
132 AcpiNsGetNextNodeTyped (
133 ACPI_OBJECT_TYPE Type
,
134 ACPI_NAMESPACE_NODE
*Parent
,
135 ACPI_NAMESPACE_NODE
*Child
);
138 * nsparse - table parsing
143 ACPI_NAMESPACE_NODE
*StartNode
);
146 AcpiNsOneCompleteParse (
149 ACPI_NAMESPACE_NODE
*StartNode
);
153 * nsaccess - Top-level namespace access
156 AcpiNsRootInitialize (
161 ACPI_GENERIC_STATE
*ScopeInfo
,
163 ACPI_OBJECT_TYPE Type
,
164 ACPI_INTERPRETER_MODE InterpreterMode
,
166 ACPI_WALK_STATE
*WalkState
,
167 ACPI_NAMESPACE_NODE
**RetNode
);
171 * nsalloc - Named object allocation/deallocation
173 ACPI_NAMESPACE_NODE
*
179 ACPI_NAMESPACE_NODE
*Node
);
183 ACPI_NAMESPACE_NODE
*Node
);
186 AcpiNsDeleteNamespaceSubtree (
187 ACPI_NAMESPACE_NODE
*ParentHandle
);
190 AcpiNsDeleteNamespaceByOwner (
191 ACPI_OWNER_ID OwnerId
);
195 ACPI_NAMESPACE_NODE
*Node
);
198 AcpiNsDeleteChildren (
199 ACPI_NAMESPACE_NODE
*Parent
);
208 * nsconvert - Dynamic object conversion routines
211 AcpiNsConvertToInteger (
212 ACPI_OPERAND_OBJECT
*OriginalObject
,
213 ACPI_OPERAND_OBJECT
**ReturnObject
);
216 AcpiNsConvertToString (
217 ACPI_OPERAND_OBJECT
*OriginalObject
,
218 ACPI_OPERAND_OBJECT
**ReturnObject
);
221 AcpiNsConvertToBuffer (
222 ACPI_OPERAND_OBJECT
*OriginalObject
,
223 ACPI_OPERAND_OBJECT
**ReturnObject
);
226 AcpiNsConvertToUnicode (
227 ACPI_OPERAND_OBJECT
*OriginalObject
,
228 ACPI_OPERAND_OBJECT
**ReturnObject
);
231 AcpiNsConvertToResource (
232 ACPI_OPERAND_OBJECT
*OriginalObject
,
233 ACPI_OPERAND_OBJECT
**ReturnObject
);
237 * nsdump - Namespace dump/print utilities
241 ACPI_HANDLE SearchBase
,
257 AcpiNsPrintPathname (
262 AcpiNsDumpOneObject (
263 ACPI_HANDLE ObjHandle
,
270 ACPI_OBJECT_TYPE Type
,
273 ACPI_OWNER_ID OwnerId
,
274 ACPI_HANDLE StartHandle
);
277 AcpiNsDumpObjectPaths (
278 ACPI_OBJECT_TYPE Type
,
281 ACPI_OWNER_ID OwnerId
,
282 ACPI_HANDLE StartHandle
);
286 * nseval - Namespace evaluation functions
290 ACPI_EVALUATE_INFO
*Info
);
293 AcpiNsExecModuleCodeList (
298 * nsarguments - Argument count/type checking for predefined/reserved names
301 AcpiNsCheckArgumentCount (
303 ACPI_NAMESPACE_NODE
*Node
,
304 UINT32 UserParamCount
,
305 const ACPI_PREDEFINED_INFO
*Info
);
308 AcpiNsCheckAcpiCompliance (
310 ACPI_NAMESPACE_NODE
*Node
,
311 const ACPI_PREDEFINED_INFO
*Predefined
);
314 AcpiNsCheckArgumentTypes (
315 ACPI_EVALUATE_INFO
*Info
);
319 * nspredef - Return value checking for predefined/reserved names
322 AcpiNsCheckReturnValue (
323 ACPI_NAMESPACE_NODE
*Node
,
324 ACPI_EVALUATE_INFO
*Info
,
325 UINT32 UserParamCount
,
326 ACPI_STATUS ReturnStatus
,
327 ACPI_OPERAND_OBJECT
**ReturnObject
);
330 AcpiNsCheckObjectType (
331 ACPI_EVALUATE_INFO
*Info
,
332 ACPI_OPERAND_OBJECT
**ReturnObjectPtr
,
333 UINT32 ExpectedBtypes
,
334 UINT32 PackageIndex
);
338 * nsprepkg - Validation of predefined name packages
342 ACPI_EVALUATE_INFO
*Info
,
343 ACPI_OPERAND_OBJECT
**ReturnObjectPtr
);
347 * nsnames - Name and Scope manipulation
351 ACPI_OBJECT_TYPE Type
);
354 AcpiNsGetExternalPathname (
355 ACPI_NAMESPACE_NODE
*Node
);
358 AcpiNsBuildNormalizedPath (
359 ACPI_NAMESPACE_NODE
*Node
,
365 AcpiNsGetNormalizedPathname (
366 ACPI_NAMESPACE_NODE
*Node
,
370 AcpiNsNameOfCurrentScope (
371 ACPI_WALK_STATE
*WalkState
);
374 AcpiNsHandleToPathname (
375 ACPI_HANDLE TargetHandle
,
381 ACPI_NAMESPACE_NODE
*ObjNode
,
386 ACPI_NAMESPACE_NODE
*PrefixNode
,
387 const char *ExternalPathname
,
389 ACPI_NAMESPACE_NODE
**OutNode
);
392 AcpiNsGetPathnameLength (
393 ACPI_NAMESPACE_NODE
*Node
);
397 * nsobject - Object management for namespace nodes
401 ACPI_NAMESPACE_NODE
*Node
,
402 ACPI_OPERAND_OBJECT
*Object
,
403 ACPI_OBJECT_TYPE Type
);
405 ACPI_OPERAND_OBJECT
*
406 AcpiNsGetAttachedObject (
407 ACPI_NAMESPACE_NODE
*Node
);
409 ACPI_OPERAND_OBJECT
*
410 AcpiNsGetSecondaryObject (
411 ACPI_OPERAND_OBJECT
*ObjDesc
);
415 ACPI_NAMESPACE_NODE
*Node
,
416 ACPI_OBJECT_HANDLER Handler
,
421 ACPI_NAMESPACE_NODE
*Node
,
422 ACPI_OBJECT_HANDLER Handler
);
425 AcpiNsGetAttachedData (
426 ACPI_NAMESPACE_NODE
*Node
,
427 ACPI_OBJECT_HANDLER Handler
,
432 * nsrepair - General return object repair for all
433 * predefined methods/objects
437 ACPI_EVALUATE_INFO
*Info
,
438 UINT32 ExpectedBtypes
,
440 ACPI_OPERAND_OBJECT
**ReturnObjectPtr
);
443 AcpiNsWrapWithPackage (
444 ACPI_EVALUATE_INFO
*Info
,
445 ACPI_OPERAND_OBJECT
*OriginalObject
,
446 ACPI_OPERAND_OBJECT
**ObjDescPtr
);
449 AcpiNsRepairNullElement (
450 ACPI_EVALUATE_INFO
*Info
,
451 UINT32 ExpectedBtypes
,
453 ACPI_OPERAND_OBJECT
**ReturnObjectPtr
);
456 AcpiNsRemoveNullElements (
457 ACPI_EVALUATE_INFO
*Info
,
459 ACPI_OPERAND_OBJECT
*ObjDesc
);
463 * nsrepair2 - Return object repair for specific
464 * predefined methods/objects
467 AcpiNsComplexRepairs (
468 ACPI_EVALUATE_INFO
*Info
,
469 ACPI_NAMESPACE_NODE
*Node
,
470 ACPI_STATUS ValidateStatus
,
471 ACPI_OPERAND_OBJECT
**ReturnObjectPtr
);
475 * nssearch - Namespace searching and entry
478 AcpiNsSearchAndEnter (
480 ACPI_WALK_STATE
*WalkState
,
481 ACPI_NAMESPACE_NODE
*Node
,
482 ACPI_INTERPRETER_MODE InterpreterMode
,
483 ACPI_OBJECT_TYPE Type
,
485 ACPI_NAMESPACE_NODE
**RetNode
);
488 AcpiNsSearchOneScope (
490 ACPI_NAMESPACE_NODE
*Node
,
491 ACPI_OBJECT_TYPE Type
,
492 ACPI_NAMESPACE_NODE
**RetNode
);
496 ACPI_WALK_STATE
*WalkState
,
497 ACPI_NAMESPACE_NODE
*ParentNode
,
498 ACPI_NAMESPACE_NODE
*Node
,
499 ACPI_OBJECT_TYPE Type
);
503 * nsutils - Utility functions
507 ACPI_NAMESPACE_NODE
*Node
);
511 ACPI_OBJECT_TYPE Type
);
514 AcpiNsPrintNodePathname (
515 ACPI_NAMESPACE_NODE
*Node
,
519 AcpiNsBuildInternalName (
520 ACPI_NAMESTRING_INFO
*Info
);
523 AcpiNsGetInternalNameLength (
524 ACPI_NAMESTRING_INFO
*Info
);
527 AcpiNsInternalizeName (
528 const char *DottedName
,
529 char **ConvertedName
);
532 AcpiNsExternalizeName (
533 UINT32 InternalNameLength
,
534 const char *InternalName
,
535 UINT32
*ConvertedNameLength
,
536 char **ConvertedName
);
538 ACPI_NAMESPACE_NODE
*
539 AcpiNsValidateHandle (
546 #endif /* __ACNAMESP_H__ */