xref: /freebsd/sys/contrib/dev/acpica/include/actypes.h (revision 84bbfc32a3f47bd2e32741247afe516cbeff7789)
1 /******************************************************************************
2  *
3  * Name: actypes.h - Common data types for the entire ACPI subsystem
4  *
5  *****************************************************************************/
6 
7 /******************************************************************************
8  *
9  * 1. Copyright Notice
10  *
11  * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
12  * All rights reserved.
13  *
14  * 2. License
15  *
16  * 2.1. This is your license from Intel Corp. under its intellectual property
17  * rights. You may have additional license terms from the party that provided
18  * you this software, covering your right to use that party's intellectual
19  * property rights.
20  *
21  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22  * copy of the source code appearing in this file ("Covered Code") an
23  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24  * base code distributed originally by Intel ("Original Intel Code") to copy,
25  * make derivatives, distribute, use and display any portion of the Covered
26  * Code in any form, with the right to sublicense such rights; and
27  *
28  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29  * license (with the right to sublicense), under only those claims of Intel
30  * patents that are infringed by the Original Intel Code, to make, use, sell,
31  * offer to sell, and import the Covered Code and derivative works thereof
32  * solely to the minimum extent necessary to exercise the above copyright
33  * license, and in no event shall the patent license extend to any additions
34  * to or modifications of the Original Intel Code. No other license or right
35  * is granted directly or by implication, estoppel or otherwise;
36  *
37  * The above copyright and patent license is granted only if the following
38  * conditions are met:
39  *
40  * 3. Conditions
41  *
42  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43  * Redistribution of source code of any substantial portion of the Covered
44  * Code or modification with rights to further distribute source must include
45  * the above Copyright Notice, the above License, this list of Conditions,
46  * and the following Disclaimer and Export Compliance provision. In addition,
47  * Licensee must cause all Covered Code to which Licensee contributes to
48  * contain a file documenting the changes Licensee made to create that Covered
49  * Code and the date of any change. Licensee must include in that file the
50  * documentation of any changes made by any predecessor Licensee. Licensee
51  * must include a prominent statement that the modification is derived,
52  * directly or indirectly, from Original Intel Code.
53  *
54  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55  * Redistribution of source code of any substantial portion of the Covered
56  * Code or modification without rights to further distribute source must
57  * include the following Disclaimer and Export Compliance provision in the
58  * documentation and/or other materials provided with distribution. In
59  * addition, Licensee may not authorize further sublicense of source of any
60  * portion of the Covered Code, and must include terms to the effect that the
61  * license from Licensee to its licensee is limited to the intellectual
62  * property embodied in the software Licensee provides to its licensee, and
63  * not to intellectual property embodied in modifications its licensee may
64  * make.
65  *
66  * 3.3. Redistribution of Executable. Redistribution in executable form of any
67  * substantial portion of the Covered Code or modification must reproduce the
68  * above Copyright Notice, and the following Disclaimer and Export Compliance
69  * provision in the documentation and/or other materials provided with the
70  * distribution.
71  *
72  * 3.4. Intel retains all right, title, and interest in and to the Original
73  * Intel Code.
74  *
75  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76  * Intel shall be used in advertising or otherwise to promote the sale, use or
77  * other dealings in products derived from or relating to the Covered Code
78  * without prior written authorization from Intel.
79  *
80  * 4. Disclaimer and Export Compliance
81  *
82  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83  * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85  * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86  * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
88  * PARTICULAR PURPOSE.
89  *
90  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
97  * LIMITED REMEDY.
98  *
99  * 4.3. Licensee shall not export, either directly or indirectly, any of this
100  * software or system incorporating such software without first obtaining any
101  * required license or other approval from the U. S. Department of Commerce or
102  * any other agency or department of the United States Government. In the
103  * event Licensee exports any such software from the United States or
104  * re-exports any such software from a foreign destination, Licensee shall
105  * ensure that the distribution and export/re-export of the software is in
106  * compliance with all laws, regulations, orders, or other restrictions of the
107  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108  * any of its subsidiaries will export/re-export any technical data, process,
109  * software, or service, directly or indirectly, to any country for which the
110  * United States government or any agency thereof requires an export license,
111  * other governmental approval, or letter of assurance, without first obtaining
112  * such license, approval or letter.
113  *
114  *****************************************************************************
115  *
116  * Alternatively, you may choose to be licensed under the terms of the
117  * following license:
118  *
119  * Redistribution and use in source and binary forms, with or without
120  * modification, are permitted provided that the following conditions
121  * are met:
122  * 1. Redistributions of source code must retain the above copyright
123  *    notice, this list of conditions, and the following disclaimer,
124  *    without modification.
125  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
126  *    substantially similar to the "NO WARRANTY" disclaimer below
127  *    ("Disclaimer") and any redistribution must be conditioned upon
128  *    including a substantially similar Disclaimer requirement for further
129  *    binary redistribution.
130  * 3. Neither the names of the above-listed copyright holders nor the names
131  *    of any contributors may be used to endorse or promote products derived
132  *    from this software without specific prior written permission.
133  *
134  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
135  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
136  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
137  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
138  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
139  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
140  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
141  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
142  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
144  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
145  *
146  * Alternatively, you may choose to be licensed under the terms of the
147  * GNU General Public License ("GPL") version 2 as published by the Free
148  * Software Foundation.
149  *
150  *****************************************************************************/
151 
152 #ifndef __ACTYPES_H__
153 #define __ACTYPES_H__
154 
155 /* acpisrc:StructDefs -- for acpisrc conversion */
156 
157 /*
158  * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent
159  * header and must be either 32 or 64. 16-bit ACPICA is no longer
160  * supported, as of 12/2006.
161  */
162 #ifndef ACPI_MACHINE_WIDTH
163 #error ACPI_MACHINE_WIDTH not defined
164 #endif
165 
166 /*
167  * Data type ranges
168  * Note: These macros are designed to be compiler independent as well as
169  * working around problems that some 32-bit compilers have with 64-bit
170  * constants.
171  */
172 #define ACPI_UINT8_MAX                  (UINT8) (~((UINT8)  0)) /* 0xFF               */
173 #define ACPI_UINT16_MAX                 (UINT16)(~((UINT16) 0)) /* 0xFFFF             */
174 #define ACPI_UINT32_MAX                 (UINT32)(~((UINT32) 0)) /* 0xFFFFFFFF         */
175 #define ACPI_UINT64_MAX                 (UINT64)(~((UINT64) 0)) /* 0xFFFFFFFFFFFFFFFF */
176 #define ACPI_ASCII_MAX                  0x7F
177 
178 
179 /*
180  * Architecture-specific ACPICA Subsystem Data Types
181  *
182  * The goal of these types is to provide source code portability across
183  * 16-bit, 32-bit, and 64-bit targets.
184  *
185  * 1) The following types are of fixed size for all targets (16/32/64):
186  *
187  * BOOLEAN      Logical boolean
188  *
189  * UINT8        8-bit  (1 byte) unsigned value
190  * UINT16       16-bit (2 byte) unsigned value
191  * UINT32       32-bit (4 byte) unsigned value
192  * UINT64       64-bit (8 byte) unsigned value
193  *
194  * INT16        16-bit (2 byte) signed value
195  * INT32        32-bit (4 byte) signed value
196  * INT64        64-bit (8 byte) signed value
197  *
198  * COMPILER_DEPENDENT_UINT64/INT64 - These types are defined in the
199  * compiler-dependent header(s) and were introduced because there is no
200  * common 64-bit integer type across the various compilation models, as
201  * shown in the table below.
202  *
203  * Datatype  LP64 ILP64 LLP64 ILP32 LP32 16bit
204  * char      8    8     8     8     8    8
205  * short     16   16    16    16    16   16
206  * _int32         32
207  * int       32   64    32    32    16   16
208  * long      64   64    32    32    32   32
209  * long long            64    64
210  * pointer   64   64    64    32    32   32
211  *
212  * Note: ILP64 and LP32 are currently not supported.
213  *
214  *
215  * 2) These types represent the native word size of the target mode of the
216  * processor, and may be 16-bit, 32-bit, or 64-bit as required. They are
217  * usually used for memory allocation, efficient loop counters, and array
218  * indexes. The types are similar to the size_t type in the C library and
219  * are required because there is no C type that consistently represents the
220  * native data width. ACPI_SIZE is needed because there is no guarantee
221  * that a kernel-level C library is present.
222  *
223  * ACPI_SIZE        16/32/64-bit unsigned value
224  * ACPI_NATIVE_INT  16/32/64-bit signed value
225  */
226 
227 /*******************************************************************************
228  *
229  * Common types for all compilers, all targets
230  *
231  ******************************************************************************/
232 
233 #ifndef ACPI_USE_SYSTEM_INTTYPES
234 
235 typedef unsigned char                   BOOLEAN;
236 typedef unsigned char                   UINT8;
237 typedef unsigned short                  UINT16;
238 typedef short                           INT16;
239 typedef COMPILER_DEPENDENT_UINT64       UINT64;
240 typedef COMPILER_DEPENDENT_INT64        INT64;
241 
242 #endif /* ACPI_USE_SYSTEM_INTTYPES */
243 
244 /*
245  * Value returned by AcpiOsGetThreadId. There is no standard "thread_id"
246  * across operating systems or even the various UNIX systems. Since ACPICA
247  * only needs the thread ID as a unique thread identifier, we use a UINT64
248  * as the only common data type - it will accommodate any type of pointer or
249  * any type of integer. It is up to the host-dependent OSL to cast the
250  * native thread ID type to a UINT64 (in AcpiOsGetThreadId).
251  */
252 #define ACPI_THREAD_ID                  UINT64
253 
254 
255 /*******************************************************************************
256  *
257  * Types specific to 64-bit targets
258  *
259  ******************************************************************************/
260 
261 #if ACPI_MACHINE_WIDTH == 64
262 
263 #ifndef ACPI_USE_SYSTEM_INTTYPES
264 
265 typedef unsigned int                    UINT32;
266 typedef int                             INT32;
267 
268 #endif /* ACPI_USE_SYSTEM_INTTYPES */
269 
270 
271 typedef INT64                           ACPI_NATIVE_INT;
272 typedef UINT64                          ACPI_SIZE;
273 typedef UINT64                          ACPI_IO_ADDRESS;
274 typedef UINT64                          ACPI_PHYSICAL_ADDRESS;
275 
276 #define ACPI_MAX_PTR                    ACPI_UINT64_MAX
277 #define ACPI_SIZE_MAX                   ACPI_UINT64_MAX
278 #define ACPI_USE_NATIVE_DIVIDE          /* Has native 64-bit integer support */
279 #define ACPI_USE_NATIVE_MATH64          /* Has native 64-bit integer support */
280 
281 /*
282  * In the case of the Itanium Processor Family (IPF), the hardware does not
283  * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED
284  * flag to indicate that special precautions must be taken to avoid alignment
285  * faults. (IA64 or ia64 is currently used by existing compilers to indicate
286  * IPF.)
287  *
288  * Note: EM64T and other X86-64 processors support misaligned transfers,
289  * so there is no need to define this flag.
290  */
291 #if defined (__IA64__) || defined (__ia64__)
292 #define ACPI_MISALIGNMENT_NOT_SUPPORTED
293 #endif
294 
295 
296 /*******************************************************************************
297  *
298  * Types specific to 32-bit targets
299  *
300  ******************************************************************************/
301 
302 #elif ACPI_MACHINE_WIDTH == 32
303 
304 #ifndef ACPI_USE_SYSTEM_INTTYPES
305 
306 typedef unsigned int                    UINT32;
307 typedef int                             INT32;
308 
309 #endif /* ACPI_USE_SYSTEM_INTTYPES */
310 
311 
312 typedef INT32                           ACPI_NATIVE_INT;
313 typedef UINT32                          ACPI_SIZE;
314 
315 #ifdef ACPI_32BIT_PHYSICAL_ADDRESS
316 
317 /*
318  * OSPMs can define this to shrink the size of the structures for 32-bit
319  * none PAE environment. ASL compiler may always define this to generate
320  * 32-bit OSPM compliant tables.
321  */
322 typedef UINT32                          ACPI_IO_ADDRESS;
323 typedef UINT32                          ACPI_PHYSICAL_ADDRESS;
324 
325 #else /* ACPI_32BIT_PHYSICAL_ADDRESS */
326 
327 /*
328  * It is reported that, after some calculations, the physical addresses can
329  * wrap over the 32-bit boundary on 32-bit PAE environment.
330  * https://bugzilla.kernel.org/show_bug.cgi?id=87971
331  */
332 typedef UINT64                          ACPI_IO_ADDRESS;
333 typedef UINT64                          ACPI_PHYSICAL_ADDRESS;
334 
335 #endif /* ACPI_32BIT_PHYSICAL_ADDRESS */
336 
337 #define ACPI_MAX_PTR                    ACPI_UINT32_MAX
338 #define ACPI_SIZE_MAX                   ACPI_UINT32_MAX
339 
340 #else
341 
342 /* ACPI_MACHINE_WIDTH must be either 64 or 32 */
343 
344 #error unknown ACPI_MACHINE_WIDTH
345 #endif
346 
347 
348 /*******************************************************************************
349  *
350  * OS-dependent types
351  *
352  * If the defaults below are not appropriate for the host system, they can
353  * be defined in the OS-specific header, and this will take precedence.
354  *
355  ******************************************************************************/
356 
357 /* Flags for AcpiOsAcquireLock/AcpiOsReleaseLock */
358 
359 #ifndef ACPI_CPU_FLAGS
360 #define ACPI_CPU_FLAGS                  ACPI_SIZE
361 #endif
362 
363 /* Object returned from AcpiOsCreateCache */
364 
365 #ifndef ACPI_CACHE_T
366 #ifdef ACPI_USE_LOCAL_CACHE
367 #define ACPI_CACHE_T                    ACPI_MEMORY_LIST
368 #else
369 #define ACPI_CACHE_T                    void *
370 #endif
371 #endif
372 
373 /*
374  * Synchronization objects - Mutexes, Semaphores, and SpinLocks
375  */
376 #if (ACPI_MUTEX_TYPE == ACPI_BINARY_SEMAPHORE)
377 /*
378  * These macros are used if the host OS does not support a mutex object.
379  * Map the OSL Mutex interfaces to binary semaphores.
380  */
381 #define ACPI_MUTEX                      ACPI_SEMAPHORE
382 #define AcpiOsCreateMutex(OutHandle)    AcpiOsCreateSemaphore (1, 1, OutHandle)
383 #define AcpiOsDeleteMutex(Handle)       (void) AcpiOsDeleteSemaphore (Handle)
384 #define AcpiOsAcquireMutex(Handle,Time) AcpiOsWaitSemaphore (Handle, 1, Time)
385 #define AcpiOsReleaseMutex(Handle)      (void) AcpiOsSignalSemaphore (Handle, 1)
386 #endif
387 
388 /* Configurable types for synchronization objects */
389 
390 #ifndef ACPI_SPINLOCK
391 #define ACPI_SPINLOCK                   void *
392 #endif
393 
394 #ifndef ACPI_SEMAPHORE
395 #define ACPI_SEMAPHORE                  void *
396 #endif
397 
398 #ifndef ACPI_MUTEX
399 #define ACPI_MUTEX                      void *
400 #endif
401 
402 
403 /*******************************************************************************
404  *
405  * Compiler-dependent types
406  *
407  * If the defaults below are not appropriate for the host compiler, they can
408  * be defined in the compiler-specific header, and this will take precedence.
409  *
410  ******************************************************************************/
411 
412 /* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */
413 
414 #ifndef ACPI_UINTPTR_T
415 #define ACPI_UINTPTR_T                  void *
416 #endif
417 
418 /*
419  * ACPI_PRINTF_LIKE is used to tag functions as "printf-like" because
420  * some compilers can catch printf format string problems
421  */
422 #ifndef ACPI_PRINTF_LIKE
423 #define ACPI_PRINTF_LIKE(c)
424 #endif
425 
426 /*
427  * Some compilers complain about unused variables. Sometimes we don't want
428  * to use all the variables (for example, _AcpiModuleName). This allows us
429  * to tell the compiler in a per-variable manner that a variable
430  * is unused
431  */
432 #ifndef ACPI_UNUSED_VAR
433 #define ACPI_UNUSED_VAR
434 #endif
435 
436 /*
437  * All ACPICA external functions that are available to the rest of the
438  * kernel are tagged with these macros which can be defined as appropriate
439  * for the host.
440  *
441  * Notes:
442  * ACPI_EXPORT_SYMBOL_INIT is used for initialization and termination
443  * interfaces that may need special processing.
444  * ACPI_EXPORT_SYMBOL is used for all other public external functions.
445  */
446 #ifndef ACPI_EXPORT_SYMBOL_INIT
447 #define ACPI_EXPORT_SYMBOL_INIT(Symbol)
448 #endif
449 
450 #ifndef ACPI_EXPORT_SYMBOL
451 #define ACPI_EXPORT_SYMBOL(Symbol)
452 #endif
453 
454 /*
455  * Compiler/Clibrary-dependent debug initialization. Used for ACPICA
456  * utilities only.
457  */
458 #ifndef ACPI_DEBUG_INITIALIZE
459 #define ACPI_DEBUG_INITIALIZE()
460 #endif
461 
462 
463 /*******************************************************************************
464  *
465  * Configuration
466  *
467  ******************************************************************************/
468 
469 #ifdef ACPI_NO_MEM_ALLOCATIONS
470 
471 #define ACPI_ALLOCATE(a)                NULL
472 #define ACPI_ALLOCATE_ZEROED(a)         NULL
473 #define ACPI_FREE(a)
474 #define ACPI_MEM_TRACKING(a)
475 
476 #else /* ACPI_NO_MEM_ALLOCATIONS */
477 
478 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
479 /*
480  * Memory allocation tracking (used by AcpiExec to detect memory leaks)
481  */
482 #define ACPI_MEM_PARAMETERS             _COMPONENT, _AcpiModuleName, __LINE__
483 #define ACPI_ALLOCATE(a)                AcpiUtAllocateAndTrack ((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS)
484 #define ACPI_ALLOCATE_ZEROED(a)         AcpiUtAllocateZeroedAndTrack ((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS)
485 #define ACPI_FREE(a)                    AcpiUtFreeAndTrack (a, ACPI_MEM_PARAMETERS)
486 #define ACPI_MEM_TRACKING(a)            a
487 
488 #else
489 /*
490  * Normal memory allocation directly via the OS services layer
491  */
492 #define ACPI_ALLOCATE(a)                AcpiOsAllocate ((ACPI_SIZE) (a))
493 #define ACPI_ALLOCATE_ZEROED(a)         AcpiOsAllocateZeroed ((ACPI_SIZE) (a))
494 #define ACPI_FREE(a)                    AcpiOsFree (a)
495 #define ACPI_MEM_TRACKING(a)
496 
497 #endif /* ACPI_DBG_TRACK_ALLOCATIONS */
498 
499 #endif /* ACPI_NO_MEM_ALLOCATIONS */
500 
501 
502 /******************************************************************************
503  *
504  * ACPI Specification constants (Do not change unless the specification
505  * changes)
506  *
507  *****************************************************************************/
508 
509 /* Number of distinct FADT-based GPE register blocks (GPE0 and GPE1) */
510 
511 #define ACPI_MAX_GPE_BLOCKS             2
512 
513 /* Default ACPI register widths */
514 
515 #define ACPI_GPE_REGISTER_WIDTH         8
516 #define ACPI_PM1_REGISTER_WIDTH         16
517 #define ACPI_PM2_REGISTER_WIDTH         8
518 #define ACPI_PM_TIMER_WIDTH             32
519 #define ACPI_RESET_REGISTER_WIDTH       8
520 
521 /* Names within the namespace are 4 bytes long */
522 
523 #define ACPI_NAMESEG_SIZE               4           /* Fixed by ACPI spec */
524 #define ACPI_PATH_SEGMENT_LENGTH        5           /* 4 chars for name + 1 char for separator */
525 #define ACPI_PATH_SEPARATOR             '.'
526 
527 /* Sizes for ACPI table headers */
528 
529 #define ACPI_OEM_ID_SIZE                6
530 #define ACPI_OEM_TABLE_ID_SIZE          8
531 
532 /* ACPI/PNP hardware IDs */
533 
534 #define PCI_ROOT_HID_STRING             "PNP0A03"
535 #define PCI_EXPRESS_ROOT_HID_STRING     "PNP0A08"
536 
537 /* PM Timer ticks per second (HZ) */
538 
539 #define ACPI_PM_TIMER_FREQUENCY         3579545
540 
541 
542 /*******************************************************************************
543  *
544  * Independent types
545  *
546  ******************************************************************************/
547 
548 /* Logical defines and NULL */
549 
550 #ifdef FALSE
551 #undef FALSE
552 #endif
553 #define FALSE                           (1 == 0)
554 
555 #ifdef TRUE
556 #undef TRUE
557 #endif
558 #define TRUE                            (1 == 1)
559 
560 #ifndef NULL
561 #define NULL                            (void *) 0
562 #endif
563 
564 
565 /*
566  * Miscellaneous types
567  */
568 typedef UINT32                          ACPI_STATUS;    /* All ACPI Exceptions */
569 typedef UINT32                          ACPI_NAME;      /* 4-byte ACPI name */
570 typedef char *                          ACPI_STRING;    /* Null terminated ASCII string */
571 typedef void *                          ACPI_HANDLE;    /* Actually a ptr to a NS Node */
572 
573 
574 /* Time constants for timer calculations */
575 
576 #define ACPI_MSEC_PER_SEC               1000L
577 
578 #define ACPI_USEC_PER_MSEC              1000L
579 #define ACPI_USEC_PER_SEC               1000000L
580 
581 #define ACPI_100NSEC_PER_USEC           10L
582 #define ACPI_100NSEC_PER_MSEC           10000L
583 #define ACPI_100NSEC_PER_SEC            10000000L
584 
585 #define ACPI_NSEC_PER_USEC              1000L
586 #define ACPI_NSEC_PER_MSEC              1000000L
587 #define ACPI_NSEC_PER_SEC               1000000000L
588 
589 #define ACPI_TIME_AFTER(a, b)           ((INT64)((b) - (a)) < 0)
590 
591 
592 /* Owner IDs are used to track namespace nodes for selective deletion */
593 
594 typedef UINT16                          ACPI_OWNER_ID;
595 #define ACPI_OWNER_ID_MAX               0xFFF   /* 4095 possible owner IDs */
596 
597 
598 #define ACPI_INTEGER_BIT_SIZE           64
599 #define ACPI_MAX_DECIMAL_DIGITS         20  /* 2^64 = 18,446,744,073,709,551,616 */
600 #define ACPI_MAX64_DECIMAL_DIGITS       20
601 #define ACPI_MAX32_DECIMAL_DIGITS       10
602 #define ACPI_MAX16_DECIMAL_DIGITS        5
603 #define ACPI_MAX8_DECIMAL_DIGITS         3
604 
605 /*
606  * Constants with special meanings
607  */
608 #define ACPI_ROOT_OBJECT                ((ACPI_HANDLE) ACPI_TO_POINTER (ACPI_MAX_PTR))
609 #define ACPI_WAIT_FOREVER               0xFFFF  /* UINT16, as per ACPI spec */
610 #define ACPI_DO_NOT_WAIT                0
611 
612 /*
613  * Obsolete: Acpi integer width. In ACPI version 1 (1996), integers are
614  * 32 bits. In ACPI version 2 (2000) and later, integers are max 64 bits.
615  * Note that this pertains to the ACPI integer type only, not to other
616  * integers used in the implementation of the ACPICA subsystem.
617  *
618  * 01/2010: This type is obsolete and has been removed from the entire ACPICA
619  * code base. It remains here for compatibility with device drivers that use
620  * the type. However, it will be removed in the future.
621  */
622 typedef UINT64                          ACPI_INTEGER;
623 #define ACPI_INTEGER_MAX                ACPI_UINT64_MAX
624 
625 
626 /*******************************************************************************
627  *
628  * Commonly used macros
629  *
630  ******************************************************************************/
631 
632 /* Data manipulation */
633 
634 #define ACPI_LOBYTE(Integer)            ((UINT8)   (UINT16)(Integer))
635 #define ACPI_HIBYTE(Integer)            ((UINT8) (((UINT16)(Integer)) >> 8))
636 #define ACPI_LOWORD(Integer)            ((UINT16)  (UINT32)(Integer))
637 #define ACPI_HIWORD(Integer)            ((UINT16)(((UINT32)(Integer)) >> 16))
638 #define ACPI_LODWORD(Integer64)         ((UINT32)  (UINT64)(Integer64))
639 #define ACPI_HIDWORD(Integer64)         ((UINT32)(((UINT64)(Integer64)) >> 32))
640 
641 #define ACPI_SET_BIT(target,bit)        ((target) |= (bit))
642 #define ACPI_CLEAR_BIT(target,bit)      ((target) &= ~(bit))
643 #define ACPI_MIN(a,b)                   (((a)<(b))?(a):(b))
644 #define ACPI_MAX(a,b)                   (((a)>(b))?(a):(b))
645 
646 /* Size calculation */
647 
648 #define ACPI_ARRAY_LENGTH(x)            (sizeof(x) / sizeof((x)[0]))
649 
650 /* Pointer manipulation */
651 
652 #define ACPI_CAST_PTR(t, p)             ((t *) (ACPI_UINTPTR_T) (p))
653 #define ACPI_CAST_INDIRECT_PTR(t, p)    ((t **) (ACPI_UINTPTR_T) (p))
654 #define ACPI_ADD_PTR(t, a, b)           ACPI_CAST_PTR (t, (ACPI_CAST_PTR (UINT8, (a)) + (ACPI_SIZE)(b)))
655 #define ACPI_SUB_PTR(t, a, b)           ACPI_CAST_PTR (t, (ACPI_CAST_PTR (UINT8, (a)) - (ACPI_SIZE)(b)))
656 #define ACPI_PTR_DIFF(a, b)             ((ACPI_SIZE) (ACPI_CAST_PTR (UINT8, (a)) - ACPI_CAST_PTR (UINT8, (b))))
657 
658 /* Pointer/Integer type conversions */
659 
660 #define ACPI_TO_POINTER(i)              ACPI_CAST_PTR (void, (ACPI_SIZE) (i))
661 #ifndef ACPI_TO_INTEGER
662 #define ACPI_TO_INTEGER(p)              ACPI_PTR_DIFF (p, (void *) 0)
663 #endif
664 #ifndef ACPI_OFFSET
665 #define ACPI_OFFSET(d, f)               ACPI_PTR_DIFF (&(((d *) 0)->f), (void *) 0)
666 #endif
667 #define ACPI_PTR_TO_PHYSADDR(i)         ACPI_TO_INTEGER(i)
668 
669 /* Optimizations for 4-character (32-bit) ACPI_NAME manipulation */
670 
671 #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
672 #define ACPI_COMPARE_NAMESEG(a,b)       (*ACPI_CAST_PTR (UINT32, (a)) == *ACPI_CAST_PTR (UINT32, (b)))
673 #define ACPI_COPY_NAMESEG(dest,src)     (*ACPI_CAST_PTR (UINT32, (dest)) = *ACPI_CAST_PTR (UINT32, (src)))
674 #else
675 #define ACPI_COMPARE_NAMESEG(a,b)       (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAMESEG_SIZE))
676 #define ACPI_COPY_NAMESEG(dest,src)     (memcpy (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAMESEG_SIZE))
677 #endif
678 
679 /* Support for the special RSDP signature (8 characters) */
680 
681 #define ACPI_VALIDATE_RSDP_SIG(a)       (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, (sizeof(a) < 8) ? ACPI_NAMESEG_SIZE : 8))
682 #define ACPI_MAKE_RSDP_SIG(dest)        (memcpy (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8))
683 
684 /* Support for OEMx signature (x can be any character) */
685 #define ACPI_IS_OEM_SIG(a)        (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_OEM_NAME, 3) &&\
686                                       strnlen (a, ACPI_NAMESEG_SIZE) == ACPI_NAMESEG_SIZE)
687 
688 /*
689  * Algorithm to obtain access bit or byte width.
690  * Can be used with AccessSize field of ACPI_GENERIC_ADDRESS and
691  * ACPI_RESOURCE_GENERIC_REGISTER.
692  */
693 #define ACPI_ACCESS_BIT_SHIFT           2
694 #define ACPI_ACCESS_BYTE_SHIFT          -1
695 #define ACPI_ACCESS_BIT_MAX             (31 - ACPI_ACCESS_BIT_SHIFT)
696 #define ACPI_ACCESS_BYTE_MAX            (31 - ACPI_ACCESS_BYTE_SHIFT)
697 #define ACPI_ACCESS_BIT_DEFAULT         (8 - ACPI_ACCESS_BIT_SHIFT)
698 #define ACPI_ACCESS_BYTE_DEFAULT        (8 - ACPI_ACCESS_BYTE_SHIFT)
699 #define ACPI_ACCESS_BIT_WIDTH(size)     (1 << ((size) + ACPI_ACCESS_BIT_SHIFT))
700 #define ACPI_ACCESS_BYTE_WIDTH(size)    (1 << ((size) + ACPI_ACCESS_BYTE_SHIFT))
701 
702 /*******************************************************************************
703  *
704  * Miscellaneous constants
705  *
706  ******************************************************************************/
707 
708 /*
709  * Initialization sequence options
710  */
711 #define ACPI_FULL_INITIALIZATION        0x0000
712 #define ACPI_NO_FACS_INIT               0x0001
713 #define ACPI_NO_ACPI_ENABLE             0x0002
714 #define ACPI_NO_HARDWARE_INIT           0x0004
715 #define ACPI_NO_EVENT_INIT              0x0008
716 #define ACPI_NO_HANDLER_INIT            0x0010
717 #define ACPI_NO_OBJECT_INIT             0x0020
718 #define ACPI_NO_DEVICE_INIT             0x0040
719 #define ACPI_NO_ADDRESS_SPACE_INIT      0x0080
720 
721 /*
722  * Initialization state
723  */
724 #define ACPI_SUBSYSTEM_INITIALIZE       0x01
725 #define ACPI_INITIALIZED_OK             0x02
726 
727 /*
728  * Power state values
729  */
730 #define ACPI_STATE_UNKNOWN              (UINT8) 0xFF
731 
732 #define ACPI_STATE_S0                   (UINT8) 0
733 #define ACPI_STATE_S1                   (UINT8) 1
734 #define ACPI_STATE_S2                   (UINT8) 2
735 #define ACPI_STATE_S3                   (UINT8) 3
736 #define ACPI_STATE_S4                   (UINT8) 4
737 #define ACPI_STATE_S5                   (UINT8) 5
738 #define ACPI_S_STATES_MAX               ACPI_STATE_S5
739 #define ACPI_S_STATE_COUNT              6
740 
741 #define ACPI_STATE_D0                   (UINT8) 0
742 #define ACPI_STATE_D1                   (UINT8) 1
743 #define ACPI_STATE_D2                   (UINT8) 2
744 #define ACPI_STATE_D3_HOT               (UINT8) 3
745 #define ACPI_STATE_D3_COLD              (UINT8) 4
746 #define ACPI_STATE_D3                   ACPI_STATE_D3_COLD
747 #define ACPI_D_STATES_MAX               ACPI_STATE_D3_COLD
748 #define ACPI_D_STATE_COUNT              5
749 
750 #define ACPI_STATE_C0                   (UINT8) 0
751 #define ACPI_STATE_C1                   (UINT8) 1
752 #define ACPI_STATE_C2                   (UINT8) 2
753 #define ACPI_STATE_C3                   (UINT8) 3
754 #define ACPI_C_STATES_MAX               ACPI_STATE_C3
755 #define ACPI_C_STATE_COUNT              4
756 
757 /*
758  * Sleep type invalid value
759  */
760 #define ACPI_SLEEP_TYPE_MAX             0x7
761 #define ACPI_SLEEP_TYPE_INVALID         0xFF
762 
763 /*
764  * Standard notify values
765  */
766 #define ACPI_NOTIFY_BUS_CHECK           (UINT8) 0x00
767 #define ACPI_NOTIFY_DEVICE_CHECK        (UINT8) 0x01
768 #define ACPI_NOTIFY_DEVICE_WAKE         (UINT8) 0x02
769 #define ACPI_NOTIFY_EJECT_REQUEST       (UINT8) 0x03
770 #define ACPI_NOTIFY_DEVICE_CHECK_LIGHT  (UINT8) 0x04
771 #define ACPI_NOTIFY_FREQUENCY_MISMATCH  (UINT8) 0x05
772 #define ACPI_NOTIFY_BUS_MODE_MISMATCH   (UINT8) 0x06
773 #define ACPI_NOTIFY_POWER_FAULT         (UINT8) 0x07
774 #define ACPI_NOTIFY_CAPABILITIES_CHECK  (UINT8) 0x08
775 #define ACPI_NOTIFY_DEVICE_PLD_CHECK    (UINT8) 0x09
776 #define ACPI_NOTIFY_RESERVED            (UINT8) 0x0A
777 #define ACPI_NOTIFY_LOCALITY_UPDATE     (UINT8) 0x0B
778 #define ACPI_NOTIFY_SHUTDOWN_REQUEST    (UINT8) 0x0C
779 #define ACPI_NOTIFY_AFFINITY_UPDATE     (UINT8) 0x0D
780 #define ACPI_NOTIFY_MEMORY_UPDATE       (UINT8) 0x0E
781 #define ACPI_NOTIFY_DISCONNECT_RECOVER  (UINT8) 0x0F
782 
783 #define ACPI_GENERIC_NOTIFY_MAX         0x0F
784 #define ACPI_SPECIFIC_NOTIFY_MAX        0x84
785 
786 /*
787  * Types associated with ACPI names and objects. The first group of
788  * values (up to ACPI_TYPE_EXTERNAL_MAX) correspond to the definition
789  * of the ACPI ObjectType() operator (See the ACPI Spec). Therefore,
790  * only add to the first group if the spec changes.
791  *
792  * NOTE: Types must be kept in sync with the global AcpiNsProperties
793  * and AcpiNsTypeNames arrays.
794  */
795 typedef UINT32                          ACPI_OBJECT_TYPE;
796 
797 #define ACPI_TYPE_ANY                   0x00
798 #define ACPI_TYPE_INTEGER               0x01  /* Byte/Word/Dword/Zero/One/Ones */
799 #define ACPI_TYPE_STRING                0x02
800 #define ACPI_TYPE_BUFFER                0x03
801 #define ACPI_TYPE_PACKAGE               0x04  /* ByteConst, multiple DataTerm/Constant/SuperName */
802 #define ACPI_TYPE_FIELD_UNIT            0x05
803 #define ACPI_TYPE_DEVICE                0x06  /* Name, multiple Node */
804 #define ACPI_TYPE_EVENT                 0x07
805 #define ACPI_TYPE_METHOD                0x08  /* Name, ByteConst, multiple Code */
806 #define ACPI_TYPE_MUTEX                 0x09
807 #define ACPI_TYPE_REGION                0x0A
808 #define ACPI_TYPE_POWER                 0x0B  /* Name,ByteConst,WordConst,multi Node */
809 #define ACPI_TYPE_PROCESSOR             0x0C  /* Name,ByteConst,DWordConst,ByteConst,multi NmO */
810 #define ACPI_TYPE_THERMAL               0x0D  /* Name, multiple Node */
811 #define ACPI_TYPE_BUFFER_FIELD          0x0E
812 #define ACPI_TYPE_DDB_HANDLE            0x0F
813 #define ACPI_TYPE_DEBUG_OBJECT          0x10
814 
815 #define ACPI_TYPE_EXTERNAL_MAX          0x10
816 #define ACPI_NUM_TYPES                  (ACPI_TYPE_EXTERNAL_MAX + 1)
817 
818 /*
819  * These are object types that do not map directly to the ACPI
820  * ObjectType() operator. They are used for various internal purposes
821  * only. If new predefined ACPI_TYPEs are added (via the ACPI
822  * specification), these internal types must move upwards. (There
823  * is code that depends on these values being contiguous with the
824  * external types above.)
825  */
826 #define ACPI_TYPE_LOCAL_REGION_FIELD    0x11
827 #define ACPI_TYPE_LOCAL_BANK_FIELD      0x12
828 #define ACPI_TYPE_LOCAL_INDEX_FIELD     0x13
829 #define ACPI_TYPE_LOCAL_REFERENCE       0x14  /* Arg#, Local#, Name, Debug, RefOf, Index */
830 #define ACPI_TYPE_LOCAL_ALIAS           0x15
831 #define ACPI_TYPE_LOCAL_METHOD_ALIAS    0x16
832 #define ACPI_TYPE_LOCAL_NOTIFY          0x17
833 #define ACPI_TYPE_LOCAL_ADDRESS_HANDLER 0x18
834 #define ACPI_TYPE_LOCAL_RESOURCE        0x19
835 #define ACPI_TYPE_LOCAL_RESOURCE_FIELD  0x1A
836 #define ACPI_TYPE_LOCAL_SCOPE           0x1B  /* 1 Name, multiple ObjectList Nodes */
837 
838 #define ACPI_TYPE_NS_NODE_MAX           0x1B  /* Last typecode used within a NS Node */
839 #define ACPI_TOTAL_TYPES                (ACPI_TYPE_NS_NODE_MAX + 1)
840 
841 /*
842  * These are special object types that never appear in
843  * a Namespace node, only in an object of ACPI_OPERAND_OBJECT
844  */
845 #define ACPI_TYPE_LOCAL_EXTRA           0x1C
846 #define ACPI_TYPE_LOCAL_DATA            0x1D
847 
848 #define ACPI_TYPE_LOCAL_MAX             0x1D
849 
850 /* All types above here are invalid */
851 
852 #define ACPI_TYPE_INVALID               0x1E
853 #define ACPI_TYPE_NOT_FOUND             0xFF
854 
855 #define ACPI_NUM_NS_TYPES               (ACPI_TYPE_INVALID + 1)
856 
857 
858 /*
859  * All I/O
860  */
861 #define ACPI_READ                       0
862 #define ACPI_WRITE                      1
863 #define ACPI_IO_MASK                    1
864 
865 /*
866  * Event Types: Fixed & General Purpose
867  */
868 typedef UINT32                          ACPI_EVENT_TYPE;
869 
870 /*
871  * Fixed events
872  */
873 #define ACPI_EVENT_PMTIMER              0
874 #define ACPI_EVENT_GLOBAL               1
875 #define ACPI_EVENT_POWER_BUTTON         2
876 #define ACPI_EVENT_SLEEP_BUTTON         3
877 #define ACPI_EVENT_RTC                  4
878 #define ACPI_EVENT_MAX                  4
879 #define ACPI_NUM_FIXED_EVENTS           ACPI_EVENT_MAX + 1
880 
881 /*
882  * Event Status - Per event
883  * -------------
884  * The encoding of ACPI_EVENT_STATUS is illustrated below.
885  * Note that a set bit (1) indicates the property is TRUE
886  * (e.g. if bit 0 is set then the event is enabled).
887  * +-------------+-+-+-+-+-+-+
888  * |   Bits 31:6 |5|4|3|2|1|0|
889  * +-------------+-+-+-+-+-+-+
890  *          |     | | | | | |
891  *          |     | | | | | +- Enabled?
892  *          |     | | | | +--- Enabled for wake?
893  *          |     | | | +----- Status bit set?
894  *          |     | | +------- Enable bit set?
895  *          |     | +--------- Has a handler?
896  *          |     +----------- Masked?
897  *          +----------------- <Reserved>
898  */
899 typedef UINT32                          ACPI_EVENT_STATUS;
900 
901 #define ACPI_EVENT_FLAG_DISABLED        (ACPI_EVENT_STATUS) 0x00
902 #define ACPI_EVENT_FLAG_ENABLED         (ACPI_EVENT_STATUS) 0x01
903 #define ACPI_EVENT_FLAG_WAKE_ENABLED    (ACPI_EVENT_STATUS) 0x02
904 #define ACPI_EVENT_FLAG_STATUS_SET      (ACPI_EVENT_STATUS) 0x04
905 #define ACPI_EVENT_FLAG_ENABLE_SET      (ACPI_EVENT_STATUS) 0x08
906 #define ACPI_EVENT_FLAG_HAS_HANDLER     (ACPI_EVENT_STATUS) 0x10
907 #define ACPI_EVENT_FLAG_MASKED          (ACPI_EVENT_STATUS) 0x20
908 #define ACPI_EVENT_FLAG_SET             ACPI_EVENT_FLAG_STATUS_SET
909 
910 /* Actions for AcpiSetGpe, AcpiGpeWakeup, AcpiHwLowSetGpe */
911 
912 #define ACPI_GPE_ENABLE                 0
913 #define ACPI_GPE_DISABLE                1
914 #define ACPI_GPE_CONDITIONAL_ENABLE     2
915 
916 /*
917  * GPE info flags - Per GPE
918  * +---+-+-+-+---+
919  * |7:6|5|4|3|2:0|
920  * +---+-+-+-+---+
921  *   |  | | |  |
922  *   |  | | |  +-- Type of dispatch:to method, handler, notify, or none
923  *   |  | | +----- Interrupt type: edge or level triggered
924  *   |  | +------- Is a Wake GPE
925  *   |  +--------- Has been enabled automatically at init time
926  *   +------------ <Reserved>
927  */
928 #define ACPI_GPE_DISPATCH_NONE          (UINT8) 0x00
929 #define ACPI_GPE_DISPATCH_METHOD        (UINT8) 0x01
930 #define ACPI_GPE_DISPATCH_HANDLER       (UINT8) 0x02
931 #define ACPI_GPE_DISPATCH_NOTIFY        (UINT8) 0x03
932 #define ACPI_GPE_DISPATCH_RAW_HANDLER   (UINT8) 0x04
933 #define ACPI_GPE_DISPATCH_MASK          (UINT8) 0x07
934 #define ACPI_GPE_DISPATCH_TYPE(flags)   ((UINT8) ((flags) & ACPI_GPE_DISPATCH_MASK))
935 
936 #define ACPI_GPE_LEVEL_TRIGGERED        (UINT8) 0x08
937 #define ACPI_GPE_EDGE_TRIGGERED         (UINT8) 0x00
938 #define ACPI_GPE_XRUPT_TYPE_MASK        (UINT8) 0x08
939 
940 #define ACPI_GPE_CAN_WAKE               (UINT8) 0x10
941 #define ACPI_GPE_AUTO_ENABLED           (UINT8) 0x20
942 #define ACPI_GPE_INITIALIZED            (UINT8) 0x40
943 
944 /*
945  * Flags for GPE and Lock interfaces
946  */
947 #define ACPI_NOT_ISR                    0x1
948 #define ACPI_ISR                        0x0
949 
950 
951 /* Notify types */
952 
953 #define ACPI_SYSTEM_NOTIFY              0x1
954 #define ACPI_DEVICE_NOTIFY              0x2
955 #define ACPI_ALL_NOTIFY                 (ACPI_SYSTEM_NOTIFY | ACPI_DEVICE_NOTIFY)
956 #define ACPI_MAX_NOTIFY_HANDLER_TYPE    0x3
957 #define ACPI_NUM_NOTIFY_TYPES           2
958 
959 #define ACPI_MAX_SYS_NOTIFY             0x7F
960 #define ACPI_MAX_DEVICE_SPECIFIC_NOTIFY 0xBF
961 
962 #define ACPI_SYSTEM_HANDLER_LIST        0 /* Used as index, must be SYSTEM_NOTIFY -1 */
963 #define ACPI_DEVICE_HANDLER_LIST        1 /* Used as index, must be DEVICE_NOTIFY -1 */
964 
965 
966 /* Address Space (Operation Region) Types */
967 
968 typedef UINT8                           ACPI_ADR_SPACE_TYPE;
969 
970 #define ACPI_ADR_SPACE_SYSTEM_MEMORY    (ACPI_ADR_SPACE_TYPE) 0
971 #define ACPI_ADR_SPACE_SYSTEM_IO        (ACPI_ADR_SPACE_TYPE) 1
972 #define ACPI_ADR_SPACE_PCI_CONFIG       (ACPI_ADR_SPACE_TYPE) 2
973 #define ACPI_ADR_SPACE_EC               (ACPI_ADR_SPACE_TYPE) 3
974 #define ACPI_ADR_SPACE_SMBUS            (ACPI_ADR_SPACE_TYPE) 4
975 #define ACPI_ADR_SPACE_CMOS             (ACPI_ADR_SPACE_TYPE) 5
976 #define ACPI_ADR_SPACE_PCI_BAR_TARGET   (ACPI_ADR_SPACE_TYPE) 6
977 #define ACPI_ADR_SPACE_IPMI             (ACPI_ADR_SPACE_TYPE) 7
978 #define ACPI_ADR_SPACE_GPIO             (ACPI_ADR_SPACE_TYPE) 8
979 #define ACPI_ADR_SPACE_GSBUS            (ACPI_ADR_SPACE_TYPE) 9
980 #define ACPI_ADR_SPACE_PLATFORM_COMM    (ACPI_ADR_SPACE_TYPE) 10
981 #define ACPI_ADR_SPACE_PLATFORM_RT      (ACPI_ADR_SPACE_TYPE) 11
982 
983 #define ACPI_NUM_PREDEFINED_REGIONS     12
984 
985 /*
986  * Special Address Spaces
987  *
988  * Note: A Data Table region is a special type of operation region
989  * that has its own AML opcode. However, internally, the AML
990  * interpreter simply creates an operation region with an address
991  * space type of ACPI_ADR_SPACE_DATA_TABLE.
992  */
993 #define ACPI_ADR_SPACE_DATA_TABLE       (ACPI_ADR_SPACE_TYPE) 0x7E /* Internal to ACPICA only */
994 #define ACPI_ADR_SPACE_FIXED_HARDWARE   (ACPI_ADR_SPACE_TYPE) 0x7F
995 
996 /* Values for _REG connection code */
997 
998 #define ACPI_REG_DISCONNECT             0
999 #define ACPI_REG_CONNECT                1
1000 
1001 /*
1002  * BitRegister IDs
1003  *
1004  * These values are intended to be used by the hardware interfaces
1005  * and are mapped to individual bitfields defined within the ACPI
1006  * registers. See the AcpiGbl_BitRegisterInfo global table in utglobal.c
1007  * for this mapping.
1008  */
1009 
1010 /* PM1 Status register */
1011 
1012 #define ACPI_BITREG_TIMER_STATUS                0x00
1013 #define ACPI_BITREG_BUS_MASTER_STATUS           0x01
1014 #define ACPI_BITREG_GLOBAL_LOCK_STATUS          0x02
1015 #define ACPI_BITREG_POWER_BUTTON_STATUS         0x03
1016 #define ACPI_BITREG_SLEEP_BUTTON_STATUS         0x04
1017 #define ACPI_BITREG_RT_CLOCK_STATUS             0x05
1018 #define ACPI_BITREG_WAKE_STATUS                 0x06
1019 #define ACPI_BITREG_PCIEXP_WAKE_STATUS          0x07
1020 
1021 /* PM1 Enable register */
1022 
1023 #define ACPI_BITREG_TIMER_ENABLE                0x08
1024 #define ACPI_BITREG_GLOBAL_LOCK_ENABLE          0x09
1025 #define ACPI_BITREG_POWER_BUTTON_ENABLE         0x0A
1026 #define ACPI_BITREG_SLEEP_BUTTON_ENABLE         0x0B
1027 #define ACPI_BITREG_RT_CLOCK_ENABLE             0x0C
1028 #define ACPI_BITREG_PCIEXP_WAKE_DISABLE         0x0D
1029 
1030 /* PM1 Control register */
1031 
1032 #define ACPI_BITREG_SCI_ENABLE                  0x0E
1033 #define ACPI_BITREG_BUS_MASTER_RLD              0x0F
1034 #define ACPI_BITREG_GLOBAL_LOCK_RELEASE         0x10
1035 #define ACPI_BITREG_SLEEP_TYPE                  0x11
1036 #define ACPI_BITREG_SLEEP_ENABLE                0x12
1037 
1038 /* PM2 Control register */
1039 
1040 #define ACPI_BITREG_ARB_DISABLE                 0x13
1041 
1042 #define ACPI_BITREG_MAX                         0x13
1043 #define ACPI_NUM_BITREG                         ACPI_BITREG_MAX + 1
1044 
1045 
1046 /* Status register values. A 1 clears a status bit. 0 = no effect */
1047 
1048 #define ACPI_CLEAR_STATUS                       1
1049 
1050 /* Enable and Control register values */
1051 
1052 #define ACPI_ENABLE_EVENT                       1
1053 #define ACPI_DISABLE_EVENT                      0
1054 
1055 
1056 /* Sleep function dispatch */
1057 
1058 typedef ACPI_STATUS (*ACPI_SLEEP_FUNCTION) (
1059     UINT8                   SleepState);
1060 
1061 typedef struct acpi_sleep_functions
1062 {
1063     ACPI_SLEEP_FUNCTION     LegacyFunction;
1064     ACPI_SLEEP_FUNCTION     ExtendedFunction;
1065 
1066 } ACPI_SLEEP_FUNCTIONS;
1067 
1068 
1069 /*
1070  * External ACPI object definition
1071  */
1072 
1073 /*
1074  * Note: Type == ACPI_TYPE_ANY (0) is used to indicate a NULL package
1075  * element or an unresolved named reference.
1076  */
1077 typedef union acpi_object
1078 {
1079     ACPI_OBJECT_TYPE                Type;   /* See definition of AcpiNsType for values */
1080     struct
1081     {
1082         ACPI_OBJECT_TYPE                Type;       /* ACPI_TYPE_INTEGER */
1083         UINT64                          Value;      /* The actual number */
1084     } Integer;
1085 
1086     struct
1087     {
1088         ACPI_OBJECT_TYPE                Type;       /* ACPI_TYPE_STRING */
1089         UINT32                          Length;     /* # of bytes in string, excluding trailing null */
1090         char                            *Pointer;   /* points to the string value */
1091     } String;
1092 
1093     struct
1094     {
1095         ACPI_OBJECT_TYPE                Type;       /* ACPI_TYPE_BUFFER */
1096         UINT32                          Length;     /* # of bytes in buffer */
1097         UINT8                           *Pointer;   /* points to the buffer */
1098     } Buffer;
1099 
1100     struct
1101     {
1102         ACPI_OBJECT_TYPE                Type;       /* ACPI_TYPE_PACKAGE */
1103         UINT32                          Count;      /* # of elements in package */
1104         union acpi_object               *Elements;  /* Pointer to an array of ACPI_OBJECTs */
1105     } Package;
1106 
1107     struct
1108     {
1109         ACPI_OBJECT_TYPE                Type;       /* ACPI_TYPE_LOCAL_REFERENCE */
1110         ACPI_OBJECT_TYPE                ActualType; /* Type associated with the Handle */
1111         ACPI_HANDLE                     Handle;     /* object reference */
1112     } Reference;
1113 
1114     struct
1115     {
1116         ACPI_OBJECT_TYPE                Type;       /* ACPI_TYPE_PROCESSOR */
1117         UINT32                          ProcId;
1118         ACPI_IO_ADDRESS                 PblkAddress;
1119         UINT32                          PblkLength;
1120     } Processor;
1121 
1122     struct
1123     {
1124         ACPI_OBJECT_TYPE                Type;       /* ACPI_TYPE_POWER */
1125         UINT32                          SystemLevel;
1126         UINT32                          ResourceOrder;
1127     } PowerResource;
1128 
1129 } ACPI_OBJECT;
1130 
1131 
1132 /*
1133  * List of objects, used as a parameter list for control method evaluation
1134  */
1135 typedef struct acpi_object_list
1136 {
1137     UINT32                          Count;
1138     ACPI_OBJECT                     *Pointer;
1139 
1140 } ACPI_OBJECT_LIST;
1141 
1142 
1143 /*
1144  * Miscellaneous common Data Structures used by the interfaces
1145  */
1146 #define ACPI_NO_BUFFER              0
1147 
1148 #ifdef ACPI_NO_MEM_ALLOCATIONS
1149 
1150 #define ACPI_ALLOCATE_BUFFER        (ACPI_SIZE) (0)
1151 #define ACPI_ALLOCATE_LOCAL_BUFFER  (ACPI_SIZE) (0)
1152 
1153 #else /* ACPI_NO_MEM_ALLOCATIONS */
1154 
1155 #define ACPI_ALLOCATE_BUFFER        (ACPI_SIZE) (-1)    /* Let ACPICA allocate buffer */
1156 #define ACPI_ALLOCATE_LOCAL_BUFFER  (ACPI_SIZE) (-2)    /* For internal use only (enables tracking) */
1157 
1158 #endif /* ACPI_NO_MEM_ALLOCATIONS */
1159 
1160 typedef struct acpi_buffer
1161 {
1162     ACPI_SIZE                       Length;         /* Length in bytes of the buffer */
1163     void                            *Pointer;       /* pointer to buffer */
1164 
1165 } ACPI_BUFFER;
1166 
1167 
1168 /*
1169  * NameType for AcpiGetName
1170  */
1171 #define ACPI_FULL_PATHNAME              0
1172 #define ACPI_SINGLE_NAME                1
1173 #define ACPI_FULL_PATHNAME_NO_TRAILING  2
1174 #define ACPI_NAME_TYPE_MAX              2
1175 
1176 
1177 /*
1178  * Predefined Namespace items
1179  */
1180 typedef struct acpi_predefined_names
1181 {
1182     const char                      *Name;
1183     UINT8                           Type;
1184     char                            *Val;
1185 
1186 } ACPI_PREDEFINED_NAMES;
1187 
1188 
1189 /*
1190  * Structure and flags for AcpiGetSystemInfo
1191  */
1192 #define ACPI_SYS_MODE_UNKNOWN           0x0000
1193 #define ACPI_SYS_MODE_ACPI              0x0001
1194 #define ACPI_SYS_MODE_LEGACY            0x0002
1195 #define ACPI_SYS_MODES_MASK             0x0003
1196 
1197 
1198 /*
1199  * System info returned by AcpiGetSystemInfo()
1200  */
1201 typedef struct acpi_system_info
1202 {
1203     UINT32                          AcpiCaVersion;
1204     UINT32                          Flags;
1205     UINT32                          TimerResolution;
1206     UINT32                          Reserved1;
1207     UINT32                          Reserved2;
1208     UINT32                          DebugLevel;
1209     UINT32                          DebugLayer;
1210 
1211 } ACPI_SYSTEM_INFO;
1212 
1213 
1214 /*
1215  * System statistics returned by AcpiGetStatistics()
1216  */
1217 typedef struct acpi_statistics
1218 {
1219     UINT32                          SciCount;
1220     UINT32                          GpeCount;
1221     UINT32                          FixedEventCount[ACPI_NUM_FIXED_EVENTS];
1222     UINT32                          MethodCount;
1223 
1224 } ACPI_STATISTICS;
1225 
1226 
1227 /*
1228  * Types specific to the OS service interfaces
1229  */
1230 typedef UINT32
1231 (ACPI_SYSTEM_XFACE *ACPI_OSD_HANDLER) (
1232     void                            *Context);
1233 
1234 typedef void
1235 (ACPI_SYSTEM_XFACE *ACPI_OSD_EXEC_CALLBACK) (
1236     void                            *Context);
1237 
1238 /*
1239  * Various handlers and callback procedures
1240  */
1241 typedef
1242 UINT32 (*ACPI_SCI_HANDLER) (
1243     void                            *Context);
1244 
1245 typedef
1246 void (*ACPI_GBL_EVENT_HANDLER) (
1247     UINT32                          EventType,
1248     ACPI_HANDLE                     Device,
1249     UINT32                          EventNumber,
1250     void                            *Context);
1251 
1252 #define ACPI_EVENT_TYPE_GPE         0
1253 #define ACPI_EVENT_TYPE_FIXED       1
1254 
1255 typedef
1256 UINT32 (*ACPI_EVENT_HANDLER) (
1257     void                            *Context);
1258 
1259 typedef
1260 UINT32 (*ACPI_GPE_HANDLER) (
1261     ACPI_HANDLE                     GpeDevice,
1262     UINT32                          GpeNumber,
1263     void                            *Context);
1264 
1265 typedef
1266 void (*ACPI_NOTIFY_HANDLER) (
1267     ACPI_HANDLE                     Device,
1268     UINT32                          Value,
1269     void                            *Context);
1270 
1271 typedef
1272 void (*ACPI_OBJECT_HANDLER) (
1273     ACPI_HANDLE                     Object,
1274     void                            *Data);
1275 
1276 typedef
1277 ACPI_STATUS (*ACPI_INIT_HANDLER) (
1278     ACPI_HANDLE                     Object,
1279     UINT32                          Function);
1280 
1281 #define ACPI_INIT_DEVICE_INI        1
1282 
1283 typedef
1284 ACPI_STATUS (*ACPI_EXCEPTION_HANDLER) (
1285     ACPI_STATUS                     AmlStatus,
1286     ACPI_NAME                       Name,
1287     UINT16                          Opcode,
1288     UINT32                          AmlOffset,
1289     void                            *Context);
1290 
1291 /* Table Event handler (Load, LoadTable, etc.) and types */
1292 
1293 typedef
1294 ACPI_STATUS (*ACPI_TABLE_HANDLER) (
1295     UINT32                          Event,
1296     void                            *Table,
1297     void                            *Context);
1298 
1299 
1300 /* Table Event Types */
1301 
1302 #define ACPI_TABLE_EVENT_LOAD           0x0
1303 #define ACPI_TABLE_EVENT_UNLOAD         0x1
1304 #define ACPI_TABLE_EVENT_INSTALL        0x2
1305 #define ACPI_TABLE_EVENT_UNINSTALL      0x3
1306 #define ACPI_NUM_TABLE_EVENTS           4
1307 
1308 
1309 /* Address Spaces (For Operation Regions) */
1310 
1311 typedef
1312 ACPI_STATUS (*ACPI_ADR_SPACE_HANDLER) (
1313     UINT32                          Function,
1314     ACPI_PHYSICAL_ADDRESS           Address,
1315     UINT32                          BitWidth,
1316     UINT64                          *Value,
1317     void                            *HandlerContext,
1318     void                            *RegionContext);
1319 
1320 #define ACPI_DEFAULT_HANDLER            NULL
1321 
1322 /* Special Context data for GenericSerialBus/GeneralPurposeIo (ACPI 5.0) */
1323 
1324 typedef struct acpi_connection_info
1325 {
1326     UINT8                           *Connection;
1327     UINT16                          Length;
1328     UINT8                           AccessLength;
1329 
1330 } ACPI_CONNECTION_INFO;
1331 
1332 /* Special Context data for PCC Opregion (ACPI 6.3) */
1333 
1334 typedef struct acpi_pcc_info {
1335     UINT8                           SubspaceId;
1336     UINT16                          Length;
1337     UINT8                           *InternalBuffer;
1338 } ACPI_PCC_INFO;
1339 
1340 /* Special Context data for FFH Opregion (ACPI 6.5) */
1341 
1342 typedef struct acpi_ffh_info {
1343     UINT64                          Offset;
1344     UINT64                          Length;
1345 } ACPI_FFH_INFO;
1346 
1347 typedef
1348 ACPI_STATUS (*ACPI_ADR_SPACE_SETUP) (
1349     ACPI_HANDLE                     RegionHandle,
1350     UINT32                          Function,
1351     void                            *HandlerContext,
1352     void                            **RegionContext);
1353 
1354 #define ACPI_REGION_ACTIVATE    0
1355 #define ACPI_REGION_DEACTIVATE  1
1356 
1357 typedef
1358 ACPI_STATUS (*ACPI_WALK_CALLBACK) (
1359     ACPI_HANDLE                     Object,
1360     UINT32                          NestingLevel,
1361     void                            *Context,
1362     void                            **ReturnValue);
1363 
1364 typedef
1365 UINT32 (*ACPI_INTERFACE_HANDLER) (
1366     ACPI_STRING                     InterfaceName,
1367     UINT32                          Supported);
1368 
1369 
1370 /* Interrupt handler return values */
1371 
1372 #define ACPI_INTERRUPT_NOT_HANDLED      0x00
1373 #define ACPI_INTERRUPT_HANDLED          0x01
1374 
1375 /* GPE handler return values */
1376 
1377 #define ACPI_REENABLE_GPE               0x80
1378 
1379 
1380 /* Length of 32-bit EISAID values when converted back to a string */
1381 
1382 #define ACPI_EISAID_STRING_SIZE         8   /* Includes null terminator */
1383 
1384 /* Length of UUID (string) values */
1385 
1386 #define ACPI_UUID_LENGTH                16
1387 
1388 /* Length of 3-byte PCI class code values when converted back to a string */
1389 
1390 #define ACPI_PCICLS_STRING_SIZE         7   /* Includes null terminator */
1391 
1392 
1393 /* Structures used for device/processor HID, UID, CID */
1394 
1395 typedef struct acpi_pnp_device_id
1396 {
1397     UINT32                          Length;             /* Length of string + null */
1398     char                            *String;
1399 
1400 } ACPI_PNP_DEVICE_ID;
1401 
1402 typedef struct acpi_pnp_device_id_list
1403 {
1404     UINT32                          Count;              /* Number of IDs in Ids array */
1405     UINT32                          ListSize;           /* Size of list, including ID strings */
1406     ACPI_PNP_DEVICE_ID              Ids[];              /* ID array */
1407 
1408 } ACPI_PNP_DEVICE_ID_LIST;
1409 
1410 /*
1411  * Structure returned from AcpiGetObjectInfo.
1412  * Optimized for both 32-bit and 64-bit builds.
1413  */
1414 typedef struct acpi_device_info
1415 {
1416     UINT32                          InfoSize;           /* Size of info, including ID strings */
1417     UINT32                          Name;               /* ACPI object Name */
1418     ACPI_OBJECT_TYPE                Type;               /* ACPI object Type */
1419     UINT8                           ParamCount;         /* If a method, required parameter count */
1420     UINT16                          Valid;              /* Indicates which optional fields are valid */
1421     UINT8                           Flags;              /* Miscellaneous info */
1422     UINT8                           HighestDstates[4];  /* _SxD values: 0xFF indicates not valid */
1423     UINT8                           LowestDstates[5];   /* _SxW values: 0xFF indicates not valid */
1424     UINT64                          Address;            /* _ADR value */
1425     ACPI_PNP_DEVICE_ID              HardwareId;         /* _HID value */
1426     ACPI_PNP_DEVICE_ID              UniqueId;           /* _UID value */
1427     ACPI_PNP_DEVICE_ID              ClassCode;          /* _CLS value */
1428     ACPI_PNP_DEVICE_ID_LIST         CompatibleIdList;   /* _CID list <must be last> */
1429 
1430 } ACPI_DEVICE_INFO;
1431 
1432 /* Values for Flags field above (AcpiGetObjectInfo) */
1433 
1434 #define ACPI_PCI_ROOT_BRIDGE            0x01
1435 
1436 /* Flags for Valid field above (AcpiGetObjectInfo) */
1437 
1438 #define ACPI_VALID_ADR                  0x0002
1439 #define ACPI_VALID_HID                  0x0004
1440 #define ACPI_VALID_UID                  0x0008
1441 #define ACPI_VALID_CID                  0x0020
1442 #define ACPI_VALID_CLS                  0x0040
1443 #define ACPI_VALID_SXDS                 0x0100
1444 #define ACPI_VALID_SXWS                 0x0200
1445 
1446 /* Flags for _STA method */
1447 
1448 #define ACPI_STA_DEVICE_PRESENT         0x01
1449 #define ACPI_STA_DEVICE_ENABLED         0x02
1450 #define ACPI_STA_DEVICE_UI              0x04
1451 #define ACPI_STA_DEVICE_FUNCTIONING     0x08
1452 #define ACPI_STA_DEVICE_OK              0x08 /* Synonym */
1453 #define ACPI_STA_BATTERY_PRESENT        0x10
1454 
1455 
1456 /* Context structs for address space handlers */
1457 
1458 typedef struct acpi_pci_id
1459 {
1460     UINT16                          Segment;
1461     UINT16                          Bus;
1462     UINT16                          Device;
1463     UINT16                          Function;
1464 
1465 } ACPI_PCI_ID;
1466 
1467 typedef struct acpi_mem_mapping
1468 {
1469     ACPI_PHYSICAL_ADDRESS           PhysicalAddress;
1470     UINT8                           *LogicalAddress;
1471     ACPI_SIZE                       Length;
1472     struct acpi_mem_mapping         *NextMm;
1473 
1474 } ACPI_MEM_MAPPING;
1475 
1476 typedef struct acpi_mem_space_context
1477 {
1478     UINT32                          Length;
1479     ACPI_PHYSICAL_ADDRESS           Address;
1480     ACPI_MEM_MAPPING                *CurMm;
1481     ACPI_MEM_MAPPING                *FirstMm;
1482 
1483 } ACPI_MEM_SPACE_CONTEXT;
1484 
1485 typedef struct acpi_data_table_mapping
1486 {
1487     void                            *Pointer;
1488 
1489 } ACPI_DATA_TABLE_MAPPING;
1490 
1491 
1492 /*
1493  * ACPI_MEMORY_LIST is used only if the ACPICA local cache is enabled
1494  */
1495 typedef struct acpi_memory_list
1496 {
1497     const char                      *ListName;
1498     void                            *ListHead;
1499     UINT16                          ObjectSize;
1500     UINT16                          MaxDepth;
1501     UINT16                          CurrentDepth;
1502 
1503 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
1504 
1505     /* Statistics for debug memory tracking only */
1506 
1507     UINT32                          TotalAllocated;
1508     UINT32                          TotalFreed;
1509     UINT32                          MaxOccupied;
1510     UINT32                          TotalSize;
1511     UINT32                          CurrentTotalSize;
1512     UINT32                          Requests;
1513     UINT32                          Hits;
1514 #endif
1515 
1516 } ACPI_MEMORY_LIST;
1517 
1518 
1519 /* Definitions of trace event types */
1520 
1521 typedef enum
1522 {
1523     ACPI_TRACE_AML_METHOD,
1524     ACPI_TRACE_AML_OPCODE,
1525     ACPI_TRACE_AML_REGION
1526 
1527 } ACPI_TRACE_EVENT_TYPE;
1528 
1529 
1530 /* Definitions of _OSI support */
1531 
1532 #define ACPI_VENDOR_STRINGS                 0x01
1533 #define ACPI_FEATURE_STRINGS                0x02
1534 #define ACPI_ENABLE_INTERFACES              0x00
1535 #define ACPI_DISABLE_INTERFACES             0x04
1536 
1537 #define ACPI_DISABLE_ALL_VENDOR_STRINGS     (ACPI_DISABLE_INTERFACES | ACPI_VENDOR_STRINGS)
1538 #define ACPI_DISABLE_ALL_FEATURE_STRINGS    (ACPI_DISABLE_INTERFACES | ACPI_FEATURE_STRINGS)
1539 #define ACPI_DISABLE_ALL_STRINGS            (ACPI_DISABLE_INTERFACES | ACPI_VENDOR_STRINGS | ACPI_FEATURE_STRINGS)
1540 #define ACPI_ENABLE_ALL_VENDOR_STRINGS      (ACPI_ENABLE_INTERFACES | ACPI_VENDOR_STRINGS)
1541 #define ACPI_ENABLE_ALL_FEATURE_STRINGS     (ACPI_ENABLE_INTERFACES | ACPI_FEATURE_STRINGS)
1542 #define ACPI_ENABLE_ALL_STRINGS             (ACPI_ENABLE_INTERFACES | ACPI_VENDOR_STRINGS | ACPI_FEATURE_STRINGS)
1543 
1544 #define ACPI_OSI_WIN_2000               0x01
1545 #define ACPI_OSI_WIN_XP                 0x02
1546 #define ACPI_OSI_WIN_XP_SP1             0x03
1547 #define ACPI_OSI_WINSRV_2003            0x04
1548 #define ACPI_OSI_WIN_XP_SP2             0x05
1549 #define ACPI_OSI_WINSRV_2003_SP1        0x06
1550 #define ACPI_OSI_WIN_VISTA              0x07
1551 #define ACPI_OSI_WINSRV_2008            0x08
1552 #define ACPI_OSI_WIN_VISTA_SP1          0x09
1553 #define ACPI_OSI_WIN_VISTA_SP2          0x0A
1554 #define ACPI_OSI_WIN_7                  0x0B
1555 #define ACPI_OSI_WIN_8                  0x0C
1556 #define ACPI_OSI_WIN_8_1                0x0D
1557 #define ACPI_OSI_WIN_10                 0x0E
1558 #define ACPI_OSI_WIN_10_RS1             0x0F
1559 #define ACPI_OSI_WIN_10_RS2             0x10
1560 #define ACPI_OSI_WIN_10_RS3             0x11
1561 #define ACPI_OSI_WIN_10_RS4             0x12
1562 #define ACPI_OSI_WIN_10_RS5             0x13
1563 #define ACPI_OSI_WIN_10_19H1            0x14
1564 #define ACPI_OSI_WIN_10_20H1            0x15
1565 #define ACPI_OSI_WIN_11                 0x16
1566 #define ACPI_OSI_WIN_11_22H2            0x17
1567 
1568 
1569 /* Definitions of getopt */
1570 
1571 #define ACPI_OPT_END                    -1
1572 
1573 /* Definitions for explicit fallthrough */
1574 
1575 #ifndef ACPI_FALLTHROUGH
1576 #define ACPI_FALLTHROUGH do {} while(0)
1577 #endif
1578 
1579 #ifndef ACPI_FLEX_ARRAY
1580 #define ACPI_FLEX_ARRAY(TYPE, NAME)     TYPE NAME[0]
1581 #endif
1582 
1583 #ifndef ACPI_NONSTRING
1584 #define ACPI_NONSTRING	/* No terminating NUL character */
1585 #endif
1586 
1587 #endif /* __ACTYPES_H__ */
1588