Fixed compatibility of output.
[AROS.git] / arch / all-pc / acpica / source / include / acinterp.h
blobebf4c9882e5334484c6408dcf9307f130c0f6af8
1 /******************************************************************************
3 * Name: acinterp.h - Interpreter 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 __ACINTERP_H__
45 #define __ACINTERP_H__
48 #define ACPI_WALK_OPERANDS (&(WalkState->Operands [WalkState->NumOperands -1]))
50 /* Macros for tables used for debug output */
52 #define ACPI_EXD_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_OPERAND_OBJECT,f)
53 #define ACPI_EXD_NSOFFSET(f) (UINT8) ACPI_OFFSET (ACPI_NAMESPACE_NODE,f)
54 #define ACPI_EXD_TABLE_SIZE(name) (sizeof(name) / sizeof (ACPI_EXDUMP_INFO))
57 * If possible, pack the following structures to byte alignment, since we
58 * don't care about performance for debug output. Two cases where we cannot
59 * pack the structures:
61 * 1) Hardware does not support misaligned memory transfers
62 * 2) Compiler does not support pointers within packed structures
64 #if (!defined(ACPI_MISALIGNMENT_NOT_SUPPORTED) && !defined(ACPI_PACKED_POINTERS_NOT_SUPPORTED))
65 #pragma pack(1)
66 #endif
68 typedef const struct acpi_exdump_info
70 UINT8 Opcode;
71 UINT8 Offset;
72 char *Name;
74 } ACPI_EXDUMP_INFO;
76 /* Values for the Opcode field above */
78 #define ACPI_EXD_INIT 0
79 #define ACPI_EXD_TYPE 1
80 #define ACPI_EXD_UINT8 2
81 #define ACPI_EXD_UINT16 3
82 #define ACPI_EXD_UINT32 4
83 #define ACPI_EXD_UINT64 5
84 #define ACPI_EXD_LITERAL 6
85 #define ACPI_EXD_POINTER 7
86 #define ACPI_EXD_ADDRESS 8
87 #define ACPI_EXD_STRING 9
88 #define ACPI_EXD_BUFFER 10
89 #define ACPI_EXD_PACKAGE 11
90 #define ACPI_EXD_FIELD 12
91 #define ACPI_EXD_REFERENCE 13
93 /* restore default alignment */
95 #pragma pack()
99 * exconvrt - object conversion
101 ACPI_STATUS
102 AcpiExConvertToInteger (
103 ACPI_OPERAND_OBJECT *ObjDesc,
104 ACPI_OPERAND_OBJECT **ResultDesc,
105 UINT32 Flags);
107 ACPI_STATUS
108 AcpiExConvertToBuffer (
109 ACPI_OPERAND_OBJECT *ObjDesc,
110 ACPI_OPERAND_OBJECT **ResultDesc);
112 ACPI_STATUS
113 AcpiExConvertToString (
114 ACPI_OPERAND_OBJECT *ObjDesc,
115 ACPI_OPERAND_OBJECT **ResultDesc,
116 UINT32 Type);
118 /* Types for ->String conversion */
120 #define ACPI_EXPLICIT_BYTE_COPY 0x00000000
121 #define ACPI_EXPLICIT_CONVERT_HEX 0x00000001
122 #define ACPI_IMPLICIT_CONVERT_HEX 0x00000002
123 #define ACPI_EXPLICIT_CONVERT_DECIMAL 0x00000003
125 ACPI_STATUS
126 AcpiExConvertToTargetType (
127 ACPI_OBJECT_TYPE DestinationType,
128 ACPI_OPERAND_OBJECT *SourceDesc,
129 ACPI_OPERAND_OBJECT **ResultDesc,
130 ACPI_WALK_STATE *WalkState);
134 * exdebug - AML debug object
136 void
137 AcpiExDoDebugObject (
138 ACPI_OPERAND_OBJECT *SourceDesc,
139 UINT32 Level,
140 UINT32 Index);
144 * exfield - ACPI AML (p-code) execution - field manipulation
146 ACPI_STATUS
147 AcpiExCommonBufferSetup (
148 ACPI_OPERAND_OBJECT *ObjDesc,
149 UINT32 BufferLength,
150 UINT32 *DatumCount);
152 ACPI_STATUS
153 AcpiExWriteWithUpdateRule (
154 ACPI_OPERAND_OBJECT *ObjDesc,
155 UINT64 Mask,
156 UINT64 FieldValue,
157 UINT32 FieldDatumByteOffset);
159 void
160 AcpiExGetBufferDatum(
161 UINT64 *Datum,
162 void *Buffer,
163 UINT32 BufferLength,
164 UINT32 ByteGranularity,
165 UINT32 BufferOffset);
167 void
168 AcpiExSetBufferDatum (
169 UINT64 MergedDatum,
170 void *Buffer,
171 UINT32 BufferLength,
172 UINT32 ByteGranularity,
173 UINT32 BufferOffset);
175 ACPI_STATUS
176 AcpiExReadDataFromField (
177 ACPI_WALK_STATE *WalkState,
178 ACPI_OPERAND_OBJECT *ObjDesc,
179 ACPI_OPERAND_OBJECT **RetBufferDesc);
181 ACPI_STATUS
182 AcpiExWriteDataToField (
183 ACPI_OPERAND_OBJECT *SourceDesc,
184 ACPI_OPERAND_OBJECT *ObjDesc,
185 ACPI_OPERAND_OBJECT **ResultDesc);
189 * exfldio - low level field I/O
191 ACPI_STATUS
192 AcpiExExtractFromField (
193 ACPI_OPERAND_OBJECT *ObjDesc,
194 void *Buffer,
195 UINT32 BufferLength);
197 ACPI_STATUS
198 AcpiExInsertIntoField (
199 ACPI_OPERAND_OBJECT *ObjDesc,
200 void *Buffer,
201 UINT32 BufferLength);
203 ACPI_STATUS
204 AcpiExAccessRegion (
205 ACPI_OPERAND_OBJECT *ObjDesc,
206 UINT32 FieldDatumByteOffset,
207 UINT64 *Value,
208 UINT32 ReadWrite);
212 * exmisc - misc support routines
214 ACPI_STATUS
215 AcpiExGetObjectReference (
216 ACPI_OPERAND_OBJECT *ObjDesc,
217 ACPI_OPERAND_OBJECT **ReturnDesc,
218 ACPI_WALK_STATE *WalkState);
220 ACPI_STATUS
221 AcpiExConcatTemplate (
222 ACPI_OPERAND_OBJECT *ObjDesc,
223 ACPI_OPERAND_OBJECT *ObjDesc2,
224 ACPI_OPERAND_OBJECT **ActualReturnDesc,
225 ACPI_WALK_STATE *WalkState);
227 ACPI_STATUS
228 AcpiExDoConcatenate (
229 ACPI_OPERAND_OBJECT *ObjDesc,
230 ACPI_OPERAND_OBJECT *ObjDesc2,
231 ACPI_OPERAND_OBJECT **ActualReturnDesc,
232 ACPI_WALK_STATE *WalkState);
234 ACPI_STATUS
235 AcpiExDoLogicalNumericOp (
236 UINT16 Opcode,
237 UINT64 Integer0,
238 UINT64 Integer1,
239 BOOLEAN *LogicalResult);
241 ACPI_STATUS
242 AcpiExDoLogicalOp (
243 UINT16 Opcode,
244 ACPI_OPERAND_OBJECT *Operand0,
245 ACPI_OPERAND_OBJECT *Operand1,
246 BOOLEAN *LogicalResult);
248 UINT64
249 AcpiExDoMathOp (
250 UINT16 Opcode,
251 UINT64 Operand0,
252 UINT64 Operand1);
254 ACPI_STATUS
255 AcpiExCreateMutex (
256 ACPI_WALK_STATE *WalkState);
258 ACPI_STATUS
259 AcpiExCreateProcessor (
260 ACPI_WALK_STATE *WalkState);
262 ACPI_STATUS
263 AcpiExCreatePowerResource (
264 ACPI_WALK_STATE *WalkState);
266 ACPI_STATUS
267 AcpiExCreateRegion (
268 UINT8 *AmlStart,
269 UINT32 AmlLength,
270 UINT8 RegionSpace,
271 ACPI_WALK_STATE *WalkState);
273 ACPI_STATUS
274 AcpiExCreateEvent (
275 ACPI_WALK_STATE *WalkState);
277 ACPI_STATUS
278 AcpiExCreateAlias (
279 ACPI_WALK_STATE *WalkState);
281 ACPI_STATUS
282 AcpiExCreateMethod (
283 UINT8 *AmlStart,
284 UINT32 AmlLength,
285 ACPI_WALK_STATE *WalkState);
289 * exconfig - dynamic table load/unload
291 ACPI_STATUS
292 AcpiExLoadOp (
293 ACPI_OPERAND_OBJECT *ObjDesc,
294 ACPI_OPERAND_OBJECT *Target,
295 ACPI_WALK_STATE *WalkState);
297 ACPI_STATUS
298 AcpiExLoadTableOp (
299 ACPI_WALK_STATE *WalkState,
300 ACPI_OPERAND_OBJECT **ReturnDesc);
302 ACPI_STATUS
303 AcpiExUnloadTable (
304 ACPI_OPERAND_OBJECT *DdbHandle);
308 * exmutex - mutex support
310 ACPI_STATUS
311 AcpiExAcquireMutex (
312 ACPI_OPERAND_OBJECT *TimeDesc,
313 ACPI_OPERAND_OBJECT *ObjDesc,
314 ACPI_WALK_STATE *WalkState);
316 ACPI_STATUS
317 AcpiExAcquireMutexObject (
318 UINT16 Timeout,
319 ACPI_OPERAND_OBJECT *ObjDesc,
320 ACPI_THREAD_ID ThreadId);
322 ACPI_STATUS
323 AcpiExReleaseMutex (
324 ACPI_OPERAND_OBJECT *ObjDesc,
325 ACPI_WALK_STATE *WalkState);
327 ACPI_STATUS
328 AcpiExReleaseMutexObject (
329 ACPI_OPERAND_OBJECT *ObjDesc);
331 void
332 AcpiExReleaseAllMutexes (
333 ACPI_THREAD_STATE *Thread);
335 void
336 AcpiExUnlinkMutex (
337 ACPI_OPERAND_OBJECT *ObjDesc);
341 * exprep - ACPI AML execution - prep utilities
343 ACPI_STATUS
344 AcpiExPrepCommonFieldObject (
345 ACPI_OPERAND_OBJECT *ObjDesc,
346 UINT8 FieldFlags,
347 UINT8 FieldAttribute,
348 UINT32 FieldBitPosition,
349 UINT32 FieldBitLength);
351 ACPI_STATUS
352 AcpiExPrepFieldValue (
353 ACPI_CREATE_FIELD_INFO *Info);
357 * exsystem - Interface to OS services
359 ACPI_STATUS
360 AcpiExSystemDoNotifyOp (
361 ACPI_OPERAND_OBJECT *Value,
362 ACPI_OPERAND_OBJECT *ObjDesc);
364 ACPI_STATUS
365 AcpiExSystemDoSleep(
366 UINT64 Time);
368 ACPI_STATUS
369 AcpiExSystemDoStall (
370 UINT32 Time);
372 ACPI_STATUS
373 AcpiExSystemSignalEvent(
374 ACPI_OPERAND_OBJECT *ObjDesc);
376 ACPI_STATUS
377 AcpiExSystemWaitEvent(
378 ACPI_OPERAND_OBJECT *Time,
379 ACPI_OPERAND_OBJECT *ObjDesc);
381 ACPI_STATUS
382 AcpiExSystemResetEvent(
383 ACPI_OPERAND_OBJECT *ObjDesc);
385 ACPI_STATUS
386 AcpiExSystemWaitSemaphore (
387 ACPI_SEMAPHORE Semaphore,
388 UINT16 Timeout);
390 ACPI_STATUS
391 AcpiExSystemWaitMutex (
392 ACPI_MUTEX Mutex,
393 UINT16 Timeout);
396 * exoparg1 - ACPI AML execution, 1 operand
398 ACPI_STATUS
399 AcpiExOpcode_0A_0T_1R (
400 ACPI_WALK_STATE *WalkState);
402 ACPI_STATUS
403 AcpiExOpcode_1A_0T_0R (
404 ACPI_WALK_STATE *WalkState);
406 ACPI_STATUS
407 AcpiExOpcode_1A_0T_1R (
408 ACPI_WALK_STATE *WalkState);
410 ACPI_STATUS
411 AcpiExOpcode_1A_1T_1R (
412 ACPI_WALK_STATE *WalkState);
414 ACPI_STATUS
415 AcpiExOpcode_1A_1T_0R (
416 ACPI_WALK_STATE *WalkState);
419 * exoparg2 - ACPI AML execution, 2 operands
421 ACPI_STATUS
422 AcpiExOpcode_2A_0T_0R (
423 ACPI_WALK_STATE *WalkState);
425 ACPI_STATUS
426 AcpiExOpcode_2A_0T_1R (
427 ACPI_WALK_STATE *WalkState);
429 ACPI_STATUS
430 AcpiExOpcode_2A_1T_1R (
431 ACPI_WALK_STATE *WalkState);
433 ACPI_STATUS
434 AcpiExOpcode_2A_2T_1R (
435 ACPI_WALK_STATE *WalkState);
439 * exoparg3 - ACPI AML execution, 3 operands
441 ACPI_STATUS
442 AcpiExOpcode_3A_0T_0R (
443 ACPI_WALK_STATE *WalkState);
445 ACPI_STATUS
446 AcpiExOpcode_3A_1T_1R (
447 ACPI_WALK_STATE *WalkState);
451 * exoparg6 - ACPI AML execution, 6 operands
453 ACPI_STATUS
454 AcpiExOpcode_6A_0T_1R (
455 ACPI_WALK_STATE *WalkState);
459 * exresolv - Object resolution and get value functions
461 ACPI_STATUS
462 AcpiExResolveToValue (
463 ACPI_OPERAND_OBJECT **StackPtr,
464 ACPI_WALK_STATE *WalkState);
466 ACPI_STATUS
467 AcpiExResolveMultiple (
468 ACPI_WALK_STATE *WalkState,
469 ACPI_OPERAND_OBJECT *Operand,
470 ACPI_OBJECT_TYPE *ReturnType,
471 ACPI_OPERAND_OBJECT **ReturnDesc);
475 * exresnte - resolve namespace node
477 ACPI_STATUS
478 AcpiExResolveNodeToValue (
479 ACPI_NAMESPACE_NODE **StackPtr,
480 ACPI_WALK_STATE *WalkState);
484 * exresop - resolve operand to value
486 ACPI_STATUS
487 AcpiExResolveOperands (
488 UINT16 Opcode,
489 ACPI_OPERAND_OBJECT **StackPtr,
490 ACPI_WALK_STATE *WalkState);
494 * exdump - Interpreter debug output routines
496 void
497 AcpiExDumpOperand (
498 ACPI_OPERAND_OBJECT *ObjDesc,
499 UINT32 Depth);
501 void
502 AcpiExDumpOperands (
503 ACPI_OPERAND_OBJECT **Operands,
504 const char *OpcodeName,
505 UINT32 NumOpcodes);
507 void
508 AcpiExDumpObjectDescriptor (
509 ACPI_OPERAND_OBJECT *Object,
510 UINT32 Flags);
512 void
513 AcpiExDumpNamespaceNode (
514 ACPI_NAMESPACE_NODE *Node,
515 UINT32 Flags);
519 * exnames - AML namestring support
521 ACPI_STATUS
522 AcpiExGetNameString (
523 ACPI_OBJECT_TYPE DataType,
524 UINT8 *InAmlAddress,
525 char **OutNameString,
526 UINT32 *OutNameLength);
530 * exstore - Object store support
532 ACPI_STATUS
533 AcpiExStore (
534 ACPI_OPERAND_OBJECT *ValDesc,
535 ACPI_OPERAND_OBJECT *DestDesc,
536 ACPI_WALK_STATE *WalkState);
538 ACPI_STATUS
539 AcpiExStoreObjectToNode (
540 ACPI_OPERAND_OBJECT *SourceDesc,
541 ACPI_NAMESPACE_NODE *Node,
542 ACPI_WALK_STATE *WalkState,
543 UINT8 ImplicitConversion);
545 #define ACPI_IMPLICIT_CONVERSION TRUE
546 #define ACPI_NO_IMPLICIT_CONVERSION FALSE
550 * exstoren - resolve/store object
552 ACPI_STATUS
553 AcpiExResolveObject (
554 ACPI_OPERAND_OBJECT **SourceDescPtr,
555 ACPI_OBJECT_TYPE TargetType,
556 ACPI_WALK_STATE *WalkState);
558 ACPI_STATUS
559 AcpiExStoreObjectToObject (
560 ACPI_OPERAND_OBJECT *SourceDesc,
561 ACPI_OPERAND_OBJECT *DestDesc,
562 ACPI_OPERAND_OBJECT **NewDesc,
563 ACPI_WALK_STATE *WalkState);
567 * exstorob - store object - buffer/string
569 ACPI_STATUS
570 AcpiExStoreBufferToBuffer (
571 ACPI_OPERAND_OBJECT *SourceDesc,
572 ACPI_OPERAND_OBJECT *TargetDesc);
574 ACPI_STATUS
575 AcpiExStoreStringToString (
576 ACPI_OPERAND_OBJECT *SourceDesc,
577 ACPI_OPERAND_OBJECT *TargetDesc);
581 * excopy - object copy
583 ACPI_STATUS
584 AcpiExCopyIntegerToIndexField (
585 ACPI_OPERAND_OBJECT *SourceDesc,
586 ACPI_OPERAND_OBJECT *TargetDesc);
588 ACPI_STATUS
589 AcpiExCopyIntegerToBankField (
590 ACPI_OPERAND_OBJECT *SourceDesc,
591 ACPI_OPERAND_OBJECT *TargetDesc);
593 ACPI_STATUS
594 AcpiExCopyDataToNamedField (
595 ACPI_OPERAND_OBJECT *SourceDesc,
596 ACPI_NAMESPACE_NODE *Node);
598 ACPI_STATUS
599 AcpiExCopyIntegerToBufferField (
600 ACPI_OPERAND_OBJECT *SourceDesc,
601 ACPI_OPERAND_OBJECT *TargetDesc);
605 * exutils - interpreter/scanner utilities
607 void
608 AcpiExEnterInterpreter (
609 void);
611 void
612 AcpiExExitInterpreter (
613 void);
615 void
616 AcpiExReacquireInterpreter (
617 void);
619 void
620 AcpiExRelinquishInterpreter (
621 void);
623 BOOLEAN
624 AcpiExTruncateFor32bitTable (
625 ACPI_OPERAND_OBJECT *ObjDesc);
627 void
628 AcpiExAcquireGlobalLock (
629 UINT32 Rule);
631 void
632 AcpiExReleaseGlobalLock (
633 UINT32 Rule);
635 void
636 AcpiExEisaIdToString (
637 char *Dest,
638 UINT64 CompressedId);
640 void
641 AcpiExIntegerToString (
642 char *Dest,
643 UINT64 Value);
645 BOOLEAN
646 AcpiIsValidSpaceId (
647 UINT8 SpaceId);
651 * exregion - default OpRegion handlers
653 ACPI_STATUS
654 AcpiExSystemMemorySpaceHandler (
655 UINT32 Function,
656 ACPI_PHYSICAL_ADDRESS Address,
657 UINT32 BitWidth,
658 UINT64 *Value,
659 void *HandlerContext,
660 void *RegionContext);
662 ACPI_STATUS
663 AcpiExSystemIoSpaceHandler (
664 UINT32 Function,
665 ACPI_PHYSICAL_ADDRESS Address,
666 UINT32 BitWidth,
667 UINT64 *Value,
668 void *HandlerContext,
669 void *RegionContext);
671 ACPI_STATUS
672 AcpiExPciConfigSpaceHandler (
673 UINT32 Function,
674 ACPI_PHYSICAL_ADDRESS Address,
675 UINT32 BitWidth,
676 UINT64 *Value,
677 void *HandlerContext,
678 void *RegionContext);
680 ACPI_STATUS
681 AcpiExCmosSpaceHandler (
682 UINT32 Function,
683 ACPI_PHYSICAL_ADDRESS Address,
684 UINT32 BitWidth,
685 UINT64 *Value,
686 void *HandlerContext,
687 void *RegionContext);
689 ACPI_STATUS
690 AcpiExPciBarSpaceHandler (
691 UINT32 Function,
692 ACPI_PHYSICAL_ADDRESS Address,
693 UINT32 BitWidth,
694 UINT64 *Value,
695 void *HandlerContext,
696 void *RegionContext);
698 ACPI_STATUS
699 AcpiExEmbeddedControllerSpaceHandler (
700 UINT32 Function,
701 ACPI_PHYSICAL_ADDRESS Address,
702 UINT32 BitWidth,
703 UINT64 *Value,
704 void *HandlerContext,
705 void *RegionContext);
707 ACPI_STATUS
708 AcpiExSmBusSpaceHandler (
709 UINT32 Function,
710 ACPI_PHYSICAL_ADDRESS Address,
711 UINT32 BitWidth,
712 UINT64 *Value,
713 void *HandlerContext,
714 void *RegionContext);
717 ACPI_STATUS
718 AcpiExDataTableSpaceHandler (
719 UINT32 Function,
720 ACPI_PHYSICAL_ADDRESS Address,
721 UINT32 BitWidth,
722 UINT64 *Value,
723 void *HandlerContext,
724 void *RegionContext);
726 #endif /* __INTERP_H__ */