Sync ACPICA with Intel's version 20150717.
[dragonfly.git] / sys / contrib / dev / acpica / source / include / acnamesp.h
blobbea4ebf0ad7cc5daf01c52c99555aa9854b99949
1 /******************************************************************************
3 * Name: acnamesp.h - Namespace subcomponent prototypes and defines
5 *****************************************************************************/
7 /*
8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
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.
30 * NO WARRANTY
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
90 ACPI_STATUS
91 AcpiNsInitializeObjects (
92 void);
94 ACPI_STATUS
95 AcpiNsInitializeDevices (
96 void);
100 * nsload - Namespace loading
102 ACPI_STATUS
103 AcpiNsLoadNamespace (
104 void);
106 ACPI_STATUS
107 AcpiNsLoadTable (
108 UINT32 TableIndex,
109 ACPI_NAMESPACE_NODE *Node);
113 * nswalk - walk the namespace
115 ACPI_STATUS
116 AcpiNsWalkNamespace (
117 ACPI_OBJECT_TYPE Type,
118 ACPI_HANDLE StartObject,
119 UINT32 MaxDepth,
120 UINT32 Flags,
121 ACPI_WALK_CALLBACK DescendingCallback,
122 ACPI_WALK_CALLBACK AscendingCallback,
123 void *Context,
124 void **ReturnValue);
126 ACPI_NAMESPACE_NODE *
127 AcpiNsGetNextNode (
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
140 ACPI_STATUS
141 AcpiNsParseTable (
142 UINT32 TableIndex,
143 ACPI_NAMESPACE_NODE *StartNode);
145 ACPI_STATUS
146 AcpiNsOneCompleteParse (
147 UINT32 PassNumber,
148 UINT32 TableIndex,
149 ACPI_NAMESPACE_NODE *StartNode);
153 * nsaccess - Top-level namespace access
155 ACPI_STATUS
156 AcpiNsRootInitialize (
157 void);
159 ACPI_STATUS
160 AcpiNsLookup (
161 ACPI_GENERIC_STATE *ScopeInfo,
162 char *Name,
163 ACPI_OBJECT_TYPE Type,
164 ACPI_INTERPRETER_MODE InterpreterMode,
165 UINT32 Flags,
166 ACPI_WALK_STATE *WalkState,
167 ACPI_NAMESPACE_NODE **RetNode);
171 * nsalloc - Named object allocation/deallocation
173 ACPI_NAMESPACE_NODE *
174 AcpiNsCreateNode (
175 UINT32 Name);
177 void
178 AcpiNsDeleteNode (
179 ACPI_NAMESPACE_NODE *Node);
181 void
182 AcpiNsRemoveNode (
183 ACPI_NAMESPACE_NODE *Node);
185 void
186 AcpiNsDeleteNamespaceSubtree (
187 ACPI_NAMESPACE_NODE *ParentHandle);
189 void
190 AcpiNsDeleteNamespaceByOwner (
191 ACPI_OWNER_ID OwnerId);
193 void
194 AcpiNsDetachObject (
195 ACPI_NAMESPACE_NODE *Node);
197 void
198 AcpiNsDeleteChildren (
199 ACPI_NAMESPACE_NODE *Parent);
202 AcpiNsCompareNames (
203 char *Name1,
204 char *Name2);
208 * nsconvert - Dynamic object conversion routines
210 ACPI_STATUS
211 AcpiNsConvertToInteger (
212 ACPI_OPERAND_OBJECT *OriginalObject,
213 ACPI_OPERAND_OBJECT **ReturnObject);
215 ACPI_STATUS
216 AcpiNsConvertToString (
217 ACPI_OPERAND_OBJECT *OriginalObject,
218 ACPI_OPERAND_OBJECT **ReturnObject);
220 ACPI_STATUS
221 AcpiNsConvertToBuffer (
222 ACPI_OPERAND_OBJECT *OriginalObject,
223 ACPI_OPERAND_OBJECT **ReturnObject);
225 ACPI_STATUS
226 AcpiNsConvertToUnicode (
227 ACPI_OPERAND_OBJECT *OriginalObject,
228 ACPI_OPERAND_OBJECT **ReturnObject);
230 ACPI_STATUS
231 AcpiNsConvertToResource (
232 ACPI_OPERAND_OBJECT *OriginalObject,
233 ACPI_OPERAND_OBJECT **ReturnObject);
237 * nsdump - Namespace dump/print utilities
239 void
240 AcpiNsDumpTables (
241 ACPI_HANDLE SearchBase,
242 UINT32 MaxDepth);
244 void
245 AcpiNsDumpEntry (
246 ACPI_HANDLE Handle,
247 UINT32 DebugLevel);
249 void
250 AcpiNsDumpPathname (
251 ACPI_HANDLE Handle,
252 char *Msg,
253 UINT32 Level,
254 UINT32 Component);
256 void
257 AcpiNsPrintPathname (
258 UINT32 NumSegments,
259 char *Pathname);
261 ACPI_STATUS
262 AcpiNsDumpOneObject (
263 ACPI_HANDLE ObjHandle,
264 UINT32 Level,
265 void *Context,
266 void **ReturnValue);
268 void
269 AcpiNsDumpObjects (
270 ACPI_OBJECT_TYPE Type,
271 UINT8 DisplayType,
272 UINT32 MaxDepth,
273 ACPI_OWNER_ID OwnerId,
274 ACPI_HANDLE StartHandle);
276 void
277 AcpiNsDumpObjectPaths (
278 ACPI_OBJECT_TYPE Type,
279 UINT8 DisplayType,
280 UINT32 MaxDepth,
281 ACPI_OWNER_ID OwnerId,
282 ACPI_HANDLE StartHandle);
286 * nseval - Namespace evaluation functions
288 ACPI_STATUS
289 AcpiNsEvaluate (
290 ACPI_EVALUATE_INFO *Info);
292 void
293 AcpiNsExecModuleCodeList (
294 void);
298 * nsarguments - Argument count/type checking for predefined/reserved names
300 void
301 AcpiNsCheckArgumentCount (
302 char *Pathname,
303 ACPI_NAMESPACE_NODE *Node,
304 UINT32 UserParamCount,
305 const ACPI_PREDEFINED_INFO *Info);
307 void
308 AcpiNsCheckAcpiCompliance (
309 char *Pathname,
310 ACPI_NAMESPACE_NODE *Node,
311 const ACPI_PREDEFINED_INFO *Predefined);
313 void
314 AcpiNsCheckArgumentTypes (
315 ACPI_EVALUATE_INFO *Info);
319 * nspredef - Return value checking for predefined/reserved names
321 ACPI_STATUS
322 AcpiNsCheckReturnValue (
323 ACPI_NAMESPACE_NODE *Node,
324 ACPI_EVALUATE_INFO *Info,
325 UINT32 UserParamCount,
326 ACPI_STATUS ReturnStatus,
327 ACPI_OPERAND_OBJECT **ReturnObject);
329 ACPI_STATUS
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
340 ACPI_STATUS
341 AcpiNsCheckPackage (
342 ACPI_EVALUATE_INFO *Info,
343 ACPI_OPERAND_OBJECT **ReturnObjectPtr);
347 * nsnames - Name and Scope manipulation
349 UINT32
350 AcpiNsOpensScope (
351 ACPI_OBJECT_TYPE Type);
353 char *
354 AcpiNsGetExternalPathname (
355 ACPI_NAMESPACE_NODE *Node);
357 UINT32
358 AcpiNsBuildNormalizedPath (
359 ACPI_NAMESPACE_NODE *Node,
360 char *FullPath,
361 UINT32 PathSize,
362 BOOLEAN NoTrailing);
364 char *
365 AcpiNsGetNormalizedPathname (
366 ACPI_NAMESPACE_NODE *Node,
367 BOOLEAN NoTrailing);
369 char *
370 AcpiNsNameOfCurrentScope (
371 ACPI_WALK_STATE *WalkState);
373 ACPI_STATUS
374 AcpiNsHandleToPathname (
375 ACPI_HANDLE TargetHandle,
376 ACPI_BUFFER *Buffer,
377 BOOLEAN NoTrailing);
379 BOOLEAN
380 AcpiNsPatternMatch (
381 ACPI_NAMESPACE_NODE *ObjNode,
382 char *SearchFor);
384 ACPI_STATUS
385 AcpiNsGetNode (
386 ACPI_NAMESPACE_NODE *PrefixNode,
387 const char *ExternalPathname,
388 UINT32 Flags,
389 ACPI_NAMESPACE_NODE **OutNode);
391 ACPI_SIZE
392 AcpiNsGetPathnameLength (
393 ACPI_NAMESPACE_NODE *Node);
397 * nsobject - Object management for namespace nodes
399 ACPI_STATUS
400 AcpiNsAttachObject (
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);
413 ACPI_STATUS
414 AcpiNsAttachData (
415 ACPI_NAMESPACE_NODE *Node,
416 ACPI_OBJECT_HANDLER Handler,
417 void *Data);
419 ACPI_STATUS
420 AcpiNsDetachData (
421 ACPI_NAMESPACE_NODE *Node,
422 ACPI_OBJECT_HANDLER Handler);
424 ACPI_STATUS
425 AcpiNsGetAttachedData (
426 ACPI_NAMESPACE_NODE *Node,
427 ACPI_OBJECT_HANDLER Handler,
428 void **Data);
432 * nsrepair - General return object repair for all
433 * predefined methods/objects
435 ACPI_STATUS
436 AcpiNsSimpleRepair (
437 ACPI_EVALUATE_INFO *Info,
438 UINT32 ExpectedBtypes,
439 UINT32 PackageIndex,
440 ACPI_OPERAND_OBJECT **ReturnObjectPtr);
442 ACPI_STATUS
443 AcpiNsWrapWithPackage (
444 ACPI_EVALUATE_INFO *Info,
445 ACPI_OPERAND_OBJECT *OriginalObject,
446 ACPI_OPERAND_OBJECT **ObjDescPtr);
448 ACPI_STATUS
449 AcpiNsRepairNullElement (
450 ACPI_EVALUATE_INFO *Info,
451 UINT32 ExpectedBtypes,
452 UINT32 PackageIndex,
453 ACPI_OPERAND_OBJECT **ReturnObjectPtr);
455 void
456 AcpiNsRemoveNullElements (
457 ACPI_EVALUATE_INFO *Info,
458 UINT8 PackageType,
459 ACPI_OPERAND_OBJECT *ObjDesc);
463 * nsrepair2 - Return object repair for specific
464 * predefined methods/objects
466 ACPI_STATUS
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
477 ACPI_STATUS
478 AcpiNsSearchAndEnter (
479 UINT32 EntryName,
480 ACPI_WALK_STATE *WalkState,
481 ACPI_NAMESPACE_NODE *Node,
482 ACPI_INTERPRETER_MODE InterpreterMode,
483 ACPI_OBJECT_TYPE Type,
484 UINT32 Flags,
485 ACPI_NAMESPACE_NODE **RetNode);
487 ACPI_STATUS
488 AcpiNsSearchOneScope (
489 UINT32 EntryName,
490 ACPI_NAMESPACE_NODE *Node,
491 ACPI_OBJECT_TYPE Type,
492 ACPI_NAMESPACE_NODE **RetNode);
494 void
495 AcpiNsInstallNode (
496 ACPI_WALK_STATE *WalkState,
497 ACPI_NAMESPACE_NODE *ParentNode,
498 ACPI_NAMESPACE_NODE *Node,
499 ACPI_OBJECT_TYPE Type);
503 * nsutils - Utility functions
505 ACPI_OBJECT_TYPE
506 AcpiNsGetType (
507 ACPI_NAMESPACE_NODE *Node);
509 UINT32
510 AcpiNsLocal (
511 ACPI_OBJECT_TYPE Type);
513 void
514 AcpiNsPrintNodePathname (
515 ACPI_NAMESPACE_NODE *Node,
516 const char *Msg);
518 ACPI_STATUS
519 AcpiNsBuildInternalName (
520 ACPI_NAMESTRING_INFO *Info);
522 void
523 AcpiNsGetInternalNameLength (
524 ACPI_NAMESTRING_INFO *Info);
526 ACPI_STATUS
527 AcpiNsInternalizeName (
528 const char *DottedName,
529 char **ConvertedName);
531 ACPI_STATUS
532 AcpiNsExternalizeName (
533 UINT32 InternalNameLength,
534 const char *InternalName,
535 UINT32 *ConvertedNameLength,
536 char **ConvertedName);
538 ACPI_NAMESPACE_NODE *
539 AcpiNsValidateHandle (
540 ACPI_HANDLE Handle);
542 void
543 AcpiNsTerminate (
544 void);
546 #endif /* __ACNAMESP_H__ */