Indentation fix, cleanup.
[AROS.git] / arch / all-pc / acpica / source / include / acnamesp.h
blob2dba62907129b26dce6cf2b8a95a04e339a303c2
1 /******************************************************************************
3 * Name: acnamesp.h - Namespace subcomponent prototypes and defines
5 *****************************************************************************/
7 /*
8 * Copyright (C) 2000 - 2013, 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
71 /* Flags for AcpiNsWalkNamespace */
73 #define ACPI_NS_WALK_NO_UNLOCK 0
74 #define ACPI_NS_WALK_UNLOCK 0x01
75 #define ACPI_NS_WALK_TEMP_NODES 0x02
77 /* Object is not a package element */
79 #define ACPI_NOT_PACKAGE_ELEMENT ACPI_UINT32_MAX
81 /* Always emit warning message, not dependent on node flags */
83 #define ACPI_WARN_ALWAYS 0
87 * nsinit - Namespace initialization
89 ACPI_STATUS
90 AcpiNsInitializeObjects (
91 void);
93 ACPI_STATUS
94 AcpiNsInitializeDevices (
95 void);
99 * nsload - Namespace loading
101 ACPI_STATUS
102 AcpiNsLoadNamespace (
103 void);
105 ACPI_STATUS
106 AcpiNsLoadTable (
107 UINT32 TableIndex,
108 ACPI_NAMESPACE_NODE *Node);
112 * nswalk - walk the namespace
114 ACPI_STATUS
115 AcpiNsWalkNamespace (
116 ACPI_OBJECT_TYPE Type,
117 ACPI_HANDLE StartObject,
118 UINT32 MaxDepth,
119 UINT32 Flags,
120 ACPI_WALK_CALLBACK DescendingCallback,
121 ACPI_WALK_CALLBACK AscendingCallback,
122 void *Context,
123 void **ReturnValue);
125 ACPI_NAMESPACE_NODE *
126 AcpiNsGetNextNode (
127 ACPI_NAMESPACE_NODE *Parent,
128 ACPI_NAMESPACE_NODE *Child);
130 ACPI_NAMESPACE_NODE *
131 AcpiNsGetNextNodeTyped (
132 ACPI_OBJECT_TYPE Type,
133 ACPI_NAMESPACE_NODE *Parent,
134 ACPI_NAMESPACE_NODE *Child);
137 * nsparse - table parsing
139 ACPI_STATUS
140 AcpiNsParseTable (
141 UINT32 TableIndex,
142 ACPI_NAMESPACE_NODE *StartNode);
144 ACPI_STATUS
145 AcpiNsOneCompleteParse (
146 UINT32 PassNumber,
147 UINT32 TableIndex,
148 ACPI_NAMESPACE_NODE *StartNode);
152 * nsaccess - Top-level namespace access
154 ACPI_STATUS
155 AcpiNsRootInitialize (
156 void);
158 ACPI_STATUS
159 AcpiNsLookup (
160 ACPI_GENERIC_STATE *ScopeInfo,
161 char *Name,
162 ACPI_OBJECT_TYPE Type,
163 ACPI_INTERPRETER_MODE InterpreterMode,
164 UINT32 Flags,
165 ACPI_WALK_STATE *WalkState,
166 ACPI_NAMESPACE_NODE **RetNode);
170 * nsalloc - Named object allocation/deallocation
172 ACPI_NAMESPACE_NODE *
173 AcpiNsCreateNode (
174 UINT32 Name);
176 void
177 AcpiNsDeleteNode (
178 ACPI_NAMESPACE_NODE *Node);
180 void
181 AcpiNsRemoveNode (
182 ACPI_NAMESPACE_NODE *Node);
184 void
185 AcpiNsDeleteNamespaceSubtree (
186 ACPI_NAMESPACE_NODE *ParentHandle);
188 void
189 AcpiNsDeleteNamespaceByOwner (
190 ACPI_OWNER_ID OwnerId);
192 void
193 AcpiNsDetachObject (
194 ACPI_NAMESPACE_NODE *Node);
196 void
197 AcpiNsDeleteChildren (
198 ACPI_NAMESPACE_NODE *Parent);
201 AcpiNsCompareNames (
202 char *Name1,
203 char *Name2);
207 * nsconvert - Dynamic object conversion routines
209 ACPI_STATUS
210 AcpiNsConvertToInteger (
211 ACPI_OPERAND_OBJECT *OriginalObject,
212 ACPI_OPERAND_OBJECT **ReturnObject);
214 ACPI_STATUS
215 AcpiNsConvertToString (
216 ACPI_OPERAND_OBJECT *OriginalObject,
217 ACPI_OPERAND_OBJECT **ReturnObject);
219 ACPI_STATUS
220 AcpiNsConvertToBuffer (
221 ACPI_OPERAND_OBJECT *OriginalObject,
222 ACPI_OPERAND_OBJECT **ReturnObject);
224 ACPI_STATUS
225 AcpiNsConvertToUnicode (
226 ACPI_OPERAND_OBJECT *OriginalObject,
227 ACPI_OPERAND_OBJECT **ReturnObject);
229 ACPI_STATUS
230 AcpiNsConvertToResource (
231 ACPI_OPERAND_OBJECT *OriginalObject,
232 ACPI_OPERAND_OBJECT **ReturnObject);
236 * nsdump - Namespace dump/print utilities
238 void
239 AcpiNsDumpTables (
240 ACPI_HANDLE SearchBase,
241 UINT32 MaxDepth);
243 void
244 AcpiNsDumpEntry (
245 ACPI_HANDLE Handle,
246 UINT32 DebugLevel);
248 void
249 AcpiNsDumpPathname (
250 ACPI_HANDLE Handle,
251 char *Msg,
252 UINT32 Level,
253 UINT32 Component);
255 void
256 AcpiNsPrintPathname (
257 UINT32 NumSegments,
258 char *Pathname);
260 ACPI_STATUS
261 AcpiNsDumpOneObject (
262 ACPI_HANDLE ObjHandle,
263 UINT32 Level,
264 void *Context,
265 void **ReturnValue);
267 void
268 AcpiNsDumpObjects (
269 ACPI_OBJECT_TYPE Type,
270 UINT8 DisplayType,
271 UINT32 MaxDepth,
272 ACPI_OWNER_ID OwnerId,
273 ACPI_HANDLE StartHandle);
275 void
276 AcpiNsDumpObjectPaths (
277 ACPI_OBJECT_TYPE Type,
278 UINT8 DisplayType,
279 UINT32 MaxDepth,
280 ACPI_OWNER_ID OwnerId,
281 ACPI_HANDLE StartHandle);
285 * nseval - Namespace evaluation functions
287 ACPI_STATUS
288 AcpiNsEvaluate (
289 ACPI_EVALUATE_INFO *Info);
291 void
292 AcpiNsExecModuleCodeList (
293 void);
297 * nsarguments - Argument count/type checking for predefined/reserved names
299 void
300 AcpiNsCheckArgumentCount (
301 char *Pathname,
302 ACPI_NAMESPACE_NODE *Node,
303 UINT32 UserParamCount,
304 const ACPI_PREDEFINED_INFO *Info);
306 void
307 AcpiNsCheckAcpiCompliance (
308 char *Pathname,
309 ACPI_NAMESPACE_NODE *Node,
310 const ACPI_PREDEFINED_INFO *Predefined);
312 void
313 AcpiNsCheckArgumentTypes (
314 ACPI_EVALUATE_INFO *Info);
318 * nspredef - Return value checking for predefined/reserved names
320 ACPI_STATUS
321 AcpiNsCheckReturnValue (
322 ACPI_NAMESPACE_NODE *Node,
323 ACPI_EVALUATE_INFO *Info,
324 UINT32 UserParamCount,
325 ACPI_STATUS ReturnStatus,
326 ACPI_OPERAND_OBJECT **ReturnObject);
328 ACPI_STATUS
329 AcpiNsCheckObjectType (
330 ACPI_EVALUATE_INFO *Info,
331 ACPI_OPERAND_OBJECT **ReturnObjectPtr,
332 UINT32 ExpectedBtypes,
333 UINT32 PackageIndex);
337 * nsprepkg - Validation of predefined name packages
339 ACPI_STATUS
340 AcpiNsCheckPackage (
341 ACPI_EVALUATE_INFO *Info,
342 ACPI_OPERAND_OBJECT **ReturnObjectPtr);
346 * nsnames - Name and Scope manipulation
348 UINT32
349 AcpiNsOpensScope (
350 ACPI_OBJECT_TYPE Type);
352 ACPI_STATUS
353 AcpiNsBuildExternalPath (
354 ACPI_NAMESPACE_NODE *Node,
355 ACPI_SIZE Size,
356 char *NameBuffer);
358 char *
359 AcpiNsGetExternalPathname (
360 ACPI_NAMESPACE_NODE *Node);
362 char *
363 AcpiNsNameOfCurrentScope (
364 ACPI_WALK_STATE *WalkState);
366 ACPI_STATUS
367 AcpiNsHandleToPathname (
368 ACPI_HANDLE TargetHandle,
369 ACPI_BUFFER *Buffer);
371 BOOLEAN
372 AcpiNsPatternMatch (
373 ACPI_NAMESPACE_NODE *ObjNode,
374 char *SearchFor);
376 ACPI_STATUS
377 AcpiNsGetNode (
378 ACPI_NAMESPACE_NODE *PrefixNode,
379 const char *ExternalPathname,
380 UINT32 Flags,
381 ACPI_NAMESPACE_NODE **OutNode);
383 ACPI_SIZE
384 AcpiNsGetPathnameLength (
385 ACPI_NAMESPACE_NODE *Node);
389 * nsobject - Object management for namespace nodes
391 ACPI_STATUS
392 AcpiNsAttachObject (
393 ACPI_NAMESPACE_NODE *Node,
394 ACPI_OPERAND_OBJECT *Object,
395 ACPI_OBJECT_TYPE Type);
397 ACPI_OPERAND_OBJECT *
398 AcpiNsGetAttachedObject (
399 ACPI_NAMESPACE_NODE *Node);
401 ACPI_OPERAND_OBJECT *
402 AcpiNsGetSecondaryObject (
403 ACPI_OPERAND_OBJECT *ObjDesc);
405 ACPI_STATUS
406 AcpiNsAttachData (
407 ACPI_NAMESPACE_NODE *Node,
408 ACPI_OBJECT_HANDLER Handler,
409 void *Data);
411 ACPI_STATUS
412 AcpiNsDetachData (
413 ACPI_NAMESPACE_NODE *Node,
414 ACPI_OBJECT_HANDLER Handler);
416 ACPI_STATUS
417 AcpiNsGetAttachedData (
418 ACPI_NAMESPACE_NODE *Node,
419 ACPI_OBJECT_HANDLER Handler,
420 void **Data);
424 * nsrepair - General return object repair for all
425 * predefined methods/objects
427 ACPI_STATUS
428 AcpiNsSimpleRepair (
429 ACPI_EVALUATE_INFO *Info,
430 UINT32 ExpectedBtypes,
431 UINT32 PackageIndex,
432 ACPI_OPERAND_OBJECT **ReturnObjectPtr);
434 ACPI_STATUS
435 AcpiNsWrapWithPackage (
436 ACPI_EVALUATE_INFO *Info,
437 ACPI_OPERAND_OBJECT *OriginalObject,
438 ACPI_OPERAND_OBJECT **ObjDescPtr);
440 ACPI_STATUS
441 AcpiNsRepairNullElement (
442 ACPI_EVALUATE_INFO *Info,
443 UINT32 ExpectedBtypes,
444 UINT32 PackageIndex,
445 ACPI_OPERAND_OBJECT **ReturnObjectPtr);
447 void
448 AcpiNsRemoveNullElements (
449 ACPI_EVALUATE_INFO *Info,
450 UINT8 PackageType,
451 ACPI_OPERAND_OBJECT *ObjDesc);
455 * nsrepair2 - Return object repair for specific
456 * predefined methods/objects
458 ACPI_STATUS
459 AcpiNsComplexRepairs (
460 ACPI_EVALUATE_INFO *Info,
461 ACPI_NAMESPACE_NODE *Node,
462 ACPI_STATUS ValidateStatus,
463 ACPI_OPERAND_OBJECT **ReturnObjectPtr);
467 * nssearch - Namespace searching and entry
469 ACPI_STATUS
470 AcpiNsSearchAndEnter (
471 UINT32 EntryName,
472 ACPI_WALK_STATE *WalkState,
473 ACPI_NAMESPACE_NODE *Node,
474 ACPI_INTERPRETER_MODE InterpreterMode,
475 ACPI_OBJECT_TYPE Type,
476 UINT32 Flags,
477 ACPI_NAMESPACE_NODE **RetNode);
479 ACPI_STATUS
480 AcpiNsSearchOneScope (
481 UINT32 EntryName,
482 ACPI_NAMESPACE_NODE *Node,
483 ACPI_OBJECT_TYPE Type,
484 ACPI_NAMESPACE_NODE **RetNode);
486 void
487 AcpiNsInstallNode (
488 ACPI_WALK_STATE *WalkState,
489 ACPI_NAMESPACE_NODE *ParentNode,
490 ACPI_NAMESPACE_NODE *Node,
491 ACPI_OBJECT_TYPE Type);
495 * nsutils - Utility functions
497 ACPI_OBJECT_TYPE
498 AcpiNsGetType (
499 ACPI_NAMESPACE_NODE *Node);
501 UINT32
502 AcpiNsLocal (
503 ACPI_OBJECT_TYPE Type);
505 void
506 AcpiNsPrintNodePathname (
507 ACPI_NAMESPACE_NODE *Node,
508 const char *Msg);
510 ACPI_STATUS
511 AcpiNsBuildInternalName (
512 ACPI_NAMESTRING_INFO *Info);
514 void
515 AcpiNsGetInternalNameLength (
516 ACPI_NAMESTRING_INFO *Info);
518 ACPI_STATUS
519 AcpiNsInternalizeName (
520 const char *DottedName,
521 char **ConvertedName);
523 ACPI_STATUS
524 AcpiNsExternalizeName (
525 UINT32 InternalNameLength,
526 const char *InternalName,
527 UINT32 *ConvertedNameLength,
528 char **ConvertedName);
530 ACPI_NAMESPACE_NODE *
531 AcpiNsValidateHandle (
532 ACPI_HANDLE Handle);
534 void
535 AcpiNsTerminate (
536 void);
538 #endif /* __ACNAMESP_H__ */