Sync ACPICA with Intel's version 20160831.
[dragonfly.git] / sys / contrib / dev / acpica / source / include / acnamesp.h
blob440ff5b940ebf46063a0a377df3b3cf83f995b57
1 /******************************************************************************
3 * Name: acnamesp.h - Namespace subcomponent prototypes and defines
5 *****************************************************************************/
7 /*
8 * Copyright (C) 2000 - 2016, 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
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
91 ACPI_STATUS
92 AcpiNsInitializeObjects (
93 void);
95 ACPI_STATUS
96 AcpiNsInitializeDevices (
97 UINT32 Flags);
101 * nsload - Namespace loading
103 ACPI_STATUS
104 AcpiNsLoadNamespace (
105 void);
107 ACPI_STATUS
108 AcpiNsLoadTable (
109 UINT32 TableIndex,
110 ACPI_NAMESPACE_NODE *Node);
114 * nswalk - walk the namespace
116 ACPI_STATUS
117 AcpiNsWalkNamespace (
118 ACPI_OBJECT_TYPE Type,
119 ACPI_HANDLE StartObject,
120 UINT32 MaxDepth,
121 UINT32 Flags,
122 ACPI_WALK_CALLBACK DescendingCallback,
123 ACPI_WALK_CALLBACK AscendingCallback,
124 void *Context,
125 void **ReturnValue);
127 ACPI_NAMESPACE_NODE *
128 AcpiNsGetNextNode (
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
141 ACPI_STATUS
142 AcpiNsParseTable (
143 UINT32 TableIndex,
144 ACPI_NAMESPACE_NODE *StartNode);
146 ACPI_STATUS
147 AcpiNsExecuteTable (
148 UINT32 TableIndex,
149 ACPI_NAMESPACE_NODE *StartNode);
151 ACPI_STATUS
152 AcpiNsOneCompleteParse (
153 UINT32 PassNumber,
154 UINT32 TableIndex,
155 ACPI_NAMESPACE_NODE *StartNode);
159 * nsaccess - Top-level namespace access
161 ACPI_STATUS
162 AcpiNsRootInitialize (
163 void);
165 ACPI_STATUS
166 AcpiNsLookup (
167 ACPI_GENERIC_STATE *ScopeInfo,
168 char *Name,
169 ACPI_OBJECT_TYPE Type,
170 ACPI_INTERPRETER_MODE InterpreterMode,
171 UINT32 Flags,
172 ACPI_WALK_STATE *WalkState,
173 ACPI_NAMESPACE_NODE **RetNode);
177 * nsalloc - Named object allocation/deallocation
179 ACPI_NAMESPACE_NODE *
180 AcpiNsCreateNode (
181 UINT32 Name);
183 void
184 AcpiNsDeleteNode (
185 ACPI_NAMESPACE_NODE *Node);
187 void
188 AcpiNsRemoveNode (
189 ACPI_NAMESPACE_NODE *Node);
191 void
192 AcpiNsDeleteNamespaceSubtree (
193 ACPI_NAMESPACE_NODE *ParentHandle);
195 void
196 AcpiNsDeleteNamespaceByOwner (
197 ACPI_OWNER_ID OwnerId);
199 void
200 AcpiNsDetachObject (
201 ACPI_NAMESPACE_NODE *Node);
203 void
204 AcpiNsDeleteChildren (
205 ACPI_NAMESPACE_NODE *Parent);
208 AcpiNsCompareNames (
209 char *Name1,
210 char *Name2);
214 * nsconvert - Dynamic object conversion routines
216 ACPI_STATUS
217 AcpiNsConvertToInteger (
218 ACPI_OPERAND_OBJECT *OriginalObject,
219 ACPI_OPERAND_OBJECT **ReturnObject);
221 ACPI_STATUS
222 AcpiNsConvertToString (
223 ACPI_OPERAND_OBJECT *OriginalObject,
224 ACPI_OPERAND_OBJECT **ReturnObject);
226 ACPI_STATUS
227 AcpiNsConvertToBuffer (
228 ACPI_OPERAND_OBJECT *OriginalObject,
229 ACPI_OPERAND_OBJECT **ReturnObject);
231 ACPI_STATUS
232 AcpiNsConvertToUnicode (
233 ACPI_NAMESPACE_NODE *Scope,
234 ACPI_OPERAND_OBJECT *OriginalObject,
235 ACPI_OPERAND_OBJECT **ReturnObject);
237 ACPI_STATUS
238 AcpiNsConvertToResource (
239 ACPI_NAMESPACE_NODE *Scope,
240 ACPI_OPERAND_OBJECT *OriginalObject,
241 ACPI_OPERAND_OBJECT **ReturnObject);
243 ACPI_STATUS
244 AcpiNsConvertToReference (
245 ACPI_NAMESPACE_NODE *Scope,
246 ACPI_OPERAND_OBJECT *OriginalObject,
247 ACPI_OPERAND_OBJECT **ReturnObject);
251 * nsdump - Namespace dump/print utilities
253 void
254 AcpiNsDumpTables (
255 ACPI_HANDLE SearchBase,
256 UINT32 MaxDepth);
258 void
259 AcpiNsDumpEntry (
260 ACPI_HANDLE Handle,
261 UINT32 DebugLevel);
263 void
264 AcpiNsDumpPathname (
265 ACPI_HANDLE Handle,
266 const char *Msg,
267 UINT32 Level,
268 UINT32 Component);
270 void
271 AcpiNsPrintPathname (
272 UINT32 NumSegments,
273 const char *Pathname);
275 ACPI_STATUS
276 AcpiNsDumpOneObject (
277 ACPI_HANDLE ObjHandle,
278 UINT32 Level,
279 void *Context,
280 void **ReturnValue);
282 void
283 AcpiNsDumpObjects (
284 ACPI_OBJECT_TYPE Type,
285 UINT8 DisplayType,
286 UINT32 MaxDepth,
287 ACPI_OWNER_ID OwnerId,
288 ACPI_HANDLE StartHandle);
290 void
291 AcpiNsDumpObjectPaths (
292 ACPI_OBJECT_TYPE Type,
293 UINT8 DisplayType,
294 UINT32 MaxDepth,
295 ACPI_OWNER_ID OwnerId,
296 ACPI_HANDLE StartHandle);
300 * nseval - Namespace evaluation functions
302 ACPI_STATUS
303 AcpiNsEvaluate (
304 ACPI_EVALUATE_INFO *Info);
306 void
307 AcpiNsExecModuleCodeList (
308 void);
312 * nsarguments - Argument count/type checking for predefined/reserved names
314 void
315 AcpiNsCheckArgumentCount (
316 char *Pathname,
317 ACPI_NAMESPACE_NODE *Node,
318 UINT32 UserParamCount,
319 const ACPI_PREDEFINED_INFO *Info);
321 void
322 AcpiNsCheckAcpiCompliance (
323 char *Pathname,
324 ACPI_NAMESPACE_NODE *Node,
325 const ACPI_PREDEFINED_INFO *Predefined);
327 void
328 AcpiNsCheckArgumentTypes (
329 ACPI_EVALUATE_INFO *Info);
333 * nspredef - Return value checking for predefined/reserved names
335 ACPI_STATUS
336 AcpiNsCheckReturnValue (
337 ACPI_NAMESPACE_NODE *Node,
338 ACPI_EVALUATE_INFO *Info,
339 UINT32 UserParamCount,
340 ACPI_STATUS ReturnStatus,
341 ACPI_OPERAND_OBJECT **ReturnObject);
343 ACPI_STATUS
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
354 ACPI_STATUS
355 AcpiNsCheckPackage (
356 ACPI_EVALUATE_INFO *Info,
357 ACPI_OPERAND_OBJECT **ReturnObjectPtr);
361 * nsnames - Name and Scope manipulation
363 UINT32
364 AcpiNsOpensScope (
365 ACPI_OBJECT_TYPE Type);
367 char *
368 AcpiNsGetExternalPathname (
369 ACPI_NAMESPACE_NODE *Node);
371 UINT32
372 AcpiNsBuildNormalizedPath (
373 ACPI_NAMESPACE_NODE *Node,
374 char *FullPath,
375 UINT32 PathSize,
376 BOOLEAN NoTrailing);
378 char *
379 AcpiNsGetNormalizedPathname (
380 ACPI_NAMESPACE_NODE *Node,
381 BOOLEAN NoTrailing);
383 char *
384 AcpiNsNameOfCurrentScope (
385 ACPI_WALK_STATE *WalkState);
387 ACPI_STATUS
388 AcpiNsHandleToPathname (
389 ACPI_HANDLE TargetHandle,
390 ACPI_BUFFER *Buffer,
391 BOOLEAN NoTrailing);
393 BOOLEAN
394 AcpiNsPatternMatch (
395 ACPI_NAMESPACE_NODE *ObjNode,
396 char *SearchFor);
398 ACPI_STATUS
399 AcpiNsGetNodeUnlocked (
400 ACPI_NAMESPACE_NODE *PrefixNode,
401 const char *ExternalPathname,
402 UINT32 Flags,
403 ACPI_NAMESPACE_NODE **OutNode);
405 ACPI_STATUS
406 AcpiNsGetNode (
407 ACPI_NAMESPACE_NODE *PrefixNode,
408 const char *ExternalPathname,
409 UINT32 Flags,
410 ACPI_NAMESPACE_NODE **OutNode);
412 ACPI_SIZE
413 AcpiNsGetPathnameLength (
414 ACPI_NAMESPACE_NODE *Node);
418 * nsobject - Object management for namespace nodes
420 ACPI_STATUS
421 AcpiNsAttachObject (
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);
434 ACPI_STATUS
435 AcpiNsAttachData (
436 ACPI_NAMESPACE_NODE *Node,
437 ACPI_OBJECT_HANDLER Handler,
438 void *Data);
440 ACPI_STATUS
441 AcpiNsDetachData (
442 ACPI_NAMESPACE_NODE *Node,
443 ACPI_OBJECT_HANDLER Handler);
445 ACPI_STATUS
446 AcpiNsGetAttachedData (
447 ACPI_NAMESPACE_NODE *Node,
448 ACPI_OBJECT_HANDLER Handler,
449 void **Data);
453 * nsrepair - General return object repair for all
454 * predefined methods/objects
456 ACPI_STATUS
457 AcpiNsSimpleRepair (
458 ACPI_EVALUATE_INFO *Info,
459 UINT32 ExpectedBtypes,
460 UINT32 PackageIndex,
461 ACPI_OPERAND_OBJECT **ReturnObjectPtr);
463 ACPI_STATUS
464 AcpiNsWrapWithPackage (
465 ACPI_EVALUATE_INFO *Info,
466 ACPI_OPERAND_OBJECT *OriginalObject,
467 ACPI_OPERAND_OBJECT **ObjDescPtr);
469 ACPI_STATUS
470 AcpiNsRepairNullElement (
471 ACPI_EVALUATE_INFO *Info,
472 UINT32 ExpectedBtypes,
473 UINT32 PackageIndex,
474 ACPI_OPERAND_OBJECT **ReturnObjectPtr);
476 void
477 AcpiNsRemoveNullElements (
478 ACPI_EVALUATE_INFO *Info,
479 UINT8 PackageType,
480 ACPI_OPERAND_OBJECT *ObjDesc);
484 * nsrepair2 - Return object repair for specific
485 * predefined methods/objects
487 ACPI_STATUS
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
498 ACPI_STATUS
499 AcpiNsSearchAndEnter (
500 UINT32 EntryName,
501 ACPI_WALK_STATE *WalkState,
502 ACPI_NAMESPACE_NODE *Node,
503 ACPI_INTERPRETER_MODE InterpreterMode,
504 ACPI_OBJECT_TYPE Type,
505 UINT32 Flags,
506 ACPI_NAMESPACE_NODE **RetNode);
508 ACPI_STATUS
509 AcpiNsSearchOneScope (
510 UINT32 EntryName,
511 ACPI_NAMESPACE_NODE *Node,
512 ACPI_OBJECT_TYPE Type,
513 ACPI_NAMESPACE_NODE **RetNode);
515 void
516 AcpiNsInstallNode (
517 ACPI_WALK_STATE *WalkState,
518 ACPI_NAMESPACE_NODE *ParentNode,
519 ACPI_NAMESPACE_NODE *Node,
520 ACPI_OBJECT_TYPE Type);
524 * nsutils - Utility functions
526 ACPI_OBJECT_TYPE
527 AcpiNsGetType (
528 ACPI_NAMESPACE_NODE *Node);
530 UINT32
531 AcpiNsLocal (
532 ACPI_OBJECT_TYPE Type);
534 void
535 AcpiNsPrintNodePathname (
536 ACPI_NAMESPACE_NODE *Node,
537 const char *Msg);
539 ACPI_STATUS
540 AcpiNsBuildInternalName (
541 ACPI_NAMESTRING_INFO *Info);
543 void
544 AcpiNsGetInternalNameLength (
545 ACPI_NAMESTRING_INFO *Info);
547 ACPI_STATUS
548 AcpiNsInternalizeName (
549 const char *DottedName,
550 char **ConvertedName);
552 ACPI_STATUS
553 AcpiNsExternalizeName (
554 UINT32 InternalNameLength,
555 const char *InternalName,
556 UINT32 *ConvertedNameLength,
557 char **ConvertedName);
559 ACPI_NAMESPACE_NODE *
560 AcpiNsValidateHandle (
561 ACPI_HANDLE Handle);
563 void
564 AcpiNsTerminate (
565 void);
567 #endif /* __ACNAMESP_H__ */