dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / arch / x86 / include / sys / acpi / acnamesp.h
blob11ee70d044ed3b92b0e42f3fdce4d2933ab966e8
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 AcpiNsOneCompleteParse (
148 UINT32 PassNumber,
149 UINT32 TableIndex,
150 ACPI_NAMESPACE_NODE *StartNode);
154 * nsaccess - Top-level namespace access
156 ACPI_STATUS
157 AcpiNsRootInitialize (
158 void);
160 ACPI_STATUS
161 AcpiNsLookup (
162 ACPI_GENERIC_STATE *ScopeInfo,
163 char *Name,
164 ACPI_OBJECT_TYPE Type,
165 ACPI_INTERPRETER_MODE InterpreterMode,
166 UINT32 Flags,
167 ACPI_WALK_STATE *WalkState,
168 ACPI_NAMESPACE_NODE **RetNode);
172 * nsalloc - Named object allocation/deallocation
174 ACPI_NAMESPACE_NODE *
175 AcpiNsCreateNode (
176 UINT32 Name);
178 void
179 AcpiNsDeleteNode (
180 ACPI_NAMESPACE_NODE *Node);
182 void
183 AcpiNsRemoveNode (
184 ACPI_NAMESPACE_NODE *Node);
186 void
187 AcpiNsDeleteNamespaceSubtree (
188 ACPI_NAMESPACE_NODE *ParentHandle);
190 void
191 AcpiNsDeleteNamespaceByOwner (
192 ACPI_OWNER_ID OwnerId);
194 void
195 AcpiNsDetachObject (
196 ACPI_NAMESPACE_NODE *Node);
198 void
199 AcpiNsDeleteChildren (
200 ACPI_NAMESPACE_NODE *Parent);
203 AcpiNsCompareNames (
204 char *Name1,
205 char *Name2);
209 * nsconvert - Dynamic object conversion routines
211 ACPI_STATUS
212 AcpiNsConvertToInteger (
213 ACPI_OPERAND_OBJECT *OriginalObject,
214 ACPI_OPERAND_OBJECT **ReturnObject);
216 ACPI_STATUS
217 AcpiNsConvertToString (
218 ACPI_OPERAND_OBJECT *OriginalObject,
219 ACPI_OPERAND_OBJECT **ReturnObject);
221 ACPI_STATUS
222 AcpiNsConvertToBuffer (
223 ACPI_OPERAND_OBJECT *OriginalObject,
224 ACPI_OPERAND_OBJECT **ReturnObject);
226 ACPI_STATUS
227 AcpiNsConvertToUnicode (
228 ACPI_NAMESPACE_NODE *Scope,
229 ACPI_OPERAND_OBJECT *OriginalObject,
230 ACPI_OPERAND_OBJECT **ReturnObject);
232 ACPI_STATUS
233 AcpiNsConvertToResource (
234 ACPI_NAMESPACE_NODE *Scope,
235 ACPI_OPERAND_OBJECT *OriginalObject,
236 ACPI_OPERAND_OBJECT **ReturnObject);
238 ACPI_STATUS
239 AcpiNsConvertToReference (
240 ACPI_NAMESPACE_NODE *Scope,
241 ACPI_OPERAND_OBJECT *OriginalObject,
242 ACPI_OPERAND_OBJECT **ReturnObject);
246 * nsdump - Namespace dump/print utilities
248 void
249 AcpiNsDumpTables (
250 ACPI_HANDLE SearchBase,
251 UINT32 MaxDepth);
253 void
254 AcpiNsDumpEntry (
255 ACPI_HANDLE Handle,
256 UINT32 DebugLevel);
258 void
259 AcpiNsDumpPathname (
260 ACPI_HANDLE Handle,
261 const char *Msg,
262 UINT32 Level,
263 UINT32 Component);
265 void
266 AcpiNsPrintPathname (
267 UINT32 NumSegments,
268 const char *Pathname);
270 ACPI_STATUS
271 AcpiNsDumpOneObject (
272 ACPI_HANDLE ObjHandle,
273 UINT32 Level,
274 void *Context,
275 void **ReturnValue);
277 void
278 AcpiNsDumpObjects (
279 ACPI_OBJECT_TYPE Type,
280 UINT8 DisplayType,
281 UINT32 MaxDepth,
282 ACPI_OWNER_ID OwnerId,
283 ACPI_HANDLE StartHandle);
285 void
286 AcpiNsDumpObjectPaths (
287 ACPI_OBJECT_TYPE Type,
288 UINT8 DisplayType,
289 UINT32 MaxDepth,
290 ACPI_OWNER_ID OwnerId,
291 ACPI_HANDLE StartHandle);
295 * nseval - Namespace evaluation functions
297 ACPI_STATUS
298 AcpiNsEvaluate (
299 ACPI_EVALUATE_INFO *Info);
301 void
302 AcpiNsExecModuleCodeList (
303 void);
307 * nsarguments - Argument count/type checking for predefined/reserved names
309 void
310 AcpiNsCheckArgumentCount (
311 char *Pathname,
312 ACPI_NAMESPACE_NODE *Node,
313 UINT32 UserParamCount,
314 const ACPI_PREDEFINED_INFO *Info);
316 void
317 AcpiNsCheckAcpiCompliance (
318 char *Pathname,
319 ACPI_NAMESPACE_NODE *Node,
320 const ACPI_PREDEFINED_INFO *Predefined);
322 void
323 AcpiNsCheckArgumentTypes (
324 ACPI_EVALUATE_INFO *Info);
328 * nspredef - Return value checking for predefined/reserved names
330 ACPI_STATUS
331 AcpiNsCheckReturnValue (
332 ACPI_NAMESPACE_NODE *Node,
333 ACPI_EVALUATE_INFO *Info,
334 UINT32 UserParamCount,
335 ACPI_STATUS ReturnStatus,
336 ACPI_OPERAND_OBJECT **ReturnObject);
338 ACPI_STATUS
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
349 ACPI_STATUS
350 AcpiNsCheckPackage (
351 ACPI_EVALUATE_INFO *Info,
352 ACPI_OPERAND_OBJECT **ReturnObjectPtr);
356 * nsnames - Name and Scope manipulation
358 UINT32
359 AcpiNsOpensScope (
360 ACPI_OBJECT_TYPE Type);
362 char *
363 AcpiNsGetExternalPathname (
364 ACPI_NAMESPACE_NODE *Node);
366 UINT32
367 AcpiNsBuildNormalizedPath (
368 ACPI_NAMESPACE_NODE *Node,
369 char *FullPath,
370 UINT32 PathSize,
371 BOOLEAN NoTrailing);
373 char *
374 AcpiNsGetNormalizedPathname (
375 ACPI_NAMESPACE_NODE *Node,
376 BOOLEAN NoTrailing);
378 char *
379 AcpiNsNameOfCurrentScope (
380 ACPI_WALK_STATE *WalkState);
382 ACPI_STATUS
383 AcpiNsHandleToPathname (
384 ACPI_HANDLE TargetHandle,
385 ACPI_BUFFER *Buffer,
386 BOOLEAN NoTrailing);
388 BOOLEAN
389 AcpiNsPatternMatch (
390 ACPI_NAMESPACE_NODE *ObjNode,
391 char *SearchFor);
393 ACPI_STATUS
394 AcpiNsGetNode (
395 ACPI_NAMESPACE_NODE *PrefixNode,
396 const char *ExternalPathname,
397 UINT32 Flags,
398 ACPI_NAMESPACE_NODE **OutNode);
400 ACPI_SIZE
401 AcpiNsGetPathnameLength (
402 ACPI_NAMESPACE_NODE *Node);
406 * nsobject - Object management for namespace nodes
408 ACPI_STATUS
409 AcpiNsAttachObject (
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);
422 ACPI_STATUS
423 AcpiNsAttachData (
424 ACPI_NAMESPACE_NODE *Node,
425 ACPI_OBJECT_HANDLER Handler,
426 void *Data);
428 ACPI_STATUS
429 AcpiNsDetachData (
430 ACPI_NAMESPACE_NODE *Node,
431 ACPI_OBJECT_HANDLER Handler);
433 ACPI_STATUS
434 AcpiNsGetAttachedData (
435 ACPI_NAMESPACE_NODE *Node,
436 ACPI_OBJECT_HANDLER Handler,
437 void **Data);
441 * nsrepair - General return object repair for all
442 * predefined methods/objects
444 ACPI_STATUS
445 AcpiNsSimpleRepair (
446 ACPI_EVALUATE_INFO *Info,
447 UINT32 ExpectedBtypes,
448 UINT32 PackageIndex,
449 ACPI_OPERAND_OBJECT **ReturnObjectPtr);
451 ACPI_STATUS
452 AcpiNsWrapWithPackage (
453 ACPI_EVALUATE_INFO *Info,
454 ACPI_OPERAND_OBJECT *OriginalObject,
455 ACPI_OPERAND_OBJECT **ObjDescPtr);
457 ACPI_STATUS
458 AcpiNsRepairNullElement (
459 ACPI_EVALUATE_INFO *Info,
460 UINT32 ExpectedBtypes,
461 UINT32 PackageIndex,
462 ACPI_OPERAND_OBJECT **ReturnObjectPtr);
464 void
465 AcpiNsRemoveNullElements (
466 ACPI_EVALUATE_INFO *Info,
467 UINT8 PackageType,
468 ACPI_OPERAND_OBJECT *ObjDesc);
472 * nsrepair2 - Return object repair for specific
473 * predefined methods/objects
475 ACPI_STATUS
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
486 ACPI_STATUS
487 AcpiNsSearchAndEnter (
488 UINT32 EntryName,
489 ACPI_WALK_STATE *WalkState,
490 ACPI_NAMESPACE_NODE *Node,
491 ACPI_INTERPRETER_MODE InterpreterMode,
492 ACPI_OBJECT_TYPE Type,
493 UINT32 Flags,
494 ACPI_NAMESPACE_NODE **RetNode);
496 ACPI_STATUS
497 AcpiNsSearchOneScope (
498 UINT32 EntryName,
499 ACPI_NAMESPACE_NODE *Node,
500 ACPI_OBJECT_TYPE Type,
501 ACPI_NAMESPACE_NODE **RetNode);
503 void
504 AcpiNsInstallNode (
505 ACPI_WALK_STATE *WalkState,
506 ACPI_NAMESPACE_NODE *ParentNode,
507 ACPI_NAMESPACE_NODE *Node,
508 ACPI_OBJECT_TYPE Type);
512 * nsutils - Utility functions
514 ACPI_OBJECT_TYPE
515 AcpiNsGetType (
516 ACPI_NAMESPACE_NODE *Node);
518 UINT32
519 AcpiNsLocal (
520 ACPI_OBJECT_TYPE Type);
522 void
523 AcpiNsPrintNodePathname (
524 ACPI_NAMESPACE_NODE *Node,
525 const char *Msg);
527 ACPI_STATUS
528 AcpiNsBuildInternalName (
529 ACPI_NAMESTRING_INFO *Info);
531 void
532 AcpiNsGetInternalNameLength (
533 ACPI_NAMESTRING_INFO *Info);
535 ACPI_STATUS
536 AcpiNsInternalizeName (
537 const char *DottedName,
538 char **ConvertedName);
540 ACPI_STATUS
541 AcpiNsExternalizeName (
542 UINT32 InternalNameLength,
543 const char *InternalName,
544 UINT32 *ConvertedNameLength,
545 char **ConvertedName);
547 ACPI_NAMESPACE_NODE *
548 AcpiNsValidateHandle (
549 ACPI_HANDLE Handle);
551 void
552 AcpiNsTerminate (
553 void);
555 #endif /* __ACNAMESP_H__ */