Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:42

0001 /******************************************************************************
0002  *
0003  * Name: actypes.h - Common data types for the entire ACPI subsystem
0004  *
0005  *****************************************************************************/
0006 
0007 /******************************************************************************
0008  *
0009  * 1. Copyright Notice
0010  *
0011  * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
0012  * All rights reserved.
0013  *
0014  * 2. License
0015  *
0016  * 2.1. This is your license from Intel Corp. under its intellectual property
0017  * rights. You may have additional license terms from the party that provided
0018  * you this software, covering your right to use that party's intellectual
0019  * property rights.
0020  *
0021  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
0022  * copy of the source code appearing in this file ("Covered Code") an
0023  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
0024  * base code distributed originally by Intel ("Original Intel Code") to copy,
0025  * make derivatives, distribute, use and display any portion of the Covered
0026  * Code in any form, with the right to sublicense such rights; and
0027  *
0028  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
0029  * license (with the right to sublicense), under only those claims of Intel
0030  * patents that are infringed by the Original Intel Code, to make, use, sell,
0031  * offer to sell, and import the Covered Code and derivative works thereof
0032  * solely to the minimum extent necessary to exercise the above copyright
0033  * license, and in no event shall the patent license extend to any additions
0034  * to or modifications of the Original Intel Code. No other license or right
0035  * is granted directly or by implication, estoppel or otherwise;
0036  *
0037  * The above copyright and patent license is granted only if the following
0038  * conditions are met:
0039  *
0040  * 3. Conditions
0041  *
0042  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
0043  * Redistribution of source code of any substantial portion of the Covered
0044  * Code or modification with rights to further distribute source must include
0045  * the above Copyright Notice, the above License, this list of Conditions,
0046  * and the following Disclaimer and Export Compliance provision. In addition,
0047  * Licensee must cause all Covered Code to which Licensee contributes to
0048  * contain a file documenting the changes Licensee made to create that Covered
0049  * Code and the date of any change. Licensee must include in that file the
0050  * documentation of any changes made by any predecessor Licensee. Licensee
0051  * must include a prominent statement that the modification is derived,
0052  * directly or indirectly, from Original Intel Code.
0053  *
0054  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
0055  * Redistribution of source code of any substantial portion of the Covered
0056  * Code or modification without rights to further distribute source must
0057  * include the following Disclaimer and Export Compliance provision in the
0058  * documentation and/or other materials provided with distribution. In
0059  * addition, Licensee may not authorize further sublicense of source of any
0060  * portion of the Covered Code, and must include terms to the effect that the
0061  * license from Licensee to its licensee is limited to the intellectual
0062  * property embodied in the software Licensee provides to its licensee, and
0063  * not to intellectual property embodied in modifications its licensee may
0064  * make.
0065  *
0066  * 3.3. Redistribution of Executable. Redistribution in executable form of any
0067  * substantial portion of the Covered Code or modification must reproduce the
0068  * above Copyright Notice, and the following Disclaimer and Export Compliance
0069  * provision in the documentation and/or other materials provided with the
0070  * distribution.
0071  *
0072  * 3.4. Intel retains all right, title, and interest in and to the Original
0073  * Intel Code.
0074  *
0075  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
0076  * Intel shall be used in advertising or otherwise to promote the sale, use or
0077  * other dealings in products derived from or relating to the Covered Code
0078  * without prior written authorization from Intel.
0079  *
0080  * 4. Disclaimer and Export Compliance
0081  *
0082  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
0083  * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
0084  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
0085  * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
0086  * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
0087  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
0088  * PARTICULAR PURPOSE.
0089  *
0090  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
0091  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
0092  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
0093  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
0094  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
0095  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
0096  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
0097  * LIMITED REMEDY.
0098  *
0099  * 4.3. Licensee shall not export, either directly or indirectly, any of this
0100  * software or system incorporating such software without first obtaining any
0101  * required license or other approval from the U. S. Department of Commerce or
0102  * any other agency or department of the United States Government. In the
0103  * event Licensee exports any such software from the United States or
0104  * re-exports any such software from a foreign destination, Licensee shall
0105  * ensure that the distribution and export/re-export of the software is in
0106  * compliance with all laws, regulations, orders, or other restrictions of the
0107  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
0108  * any of its subsidiaries will export/re-export any technical data, process,
0109  * software, or service, directly or indirectly, to any country for which the
0110  * United States government or any agency thereof requires an export license,
0111  * other governmental approval, or letter of assurance, without first obtaining
0112  * such license, approval or letter.
0113  *
0114  *****************************************************************************
0115  *
0116  * Alternatively, you may choose to be licensed under the terms of the
0117  * following license:
0118  *
0119  * Redistribution and use in source and binary forms, with or without
0120  * modification, are permitted provided that the following conditions
0121  * are met:
0122  * 1. Redistributions of source code must retain the above copyright
0123  *    notice, this list of conditions, and the following disclaimer,
0124  *    without modification.
0125  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
0126  *    substantially similar to the "NO WARRANTY" disclaimer below
0127  *    ("Disclaimer") and any redistribution must be conditioned upon
0128  *    including a substantially similar Disclaimer requirement for further
0129  *    binary redistribution.
0130  * 3. Neither the names of the above-listed copyright holders nor the names
0131  *    of any contributors may be used to endorse or promote products derived
0132  *    from this software without specific prior written permission.
0133  *
0134  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0135  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0136  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
0137  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
0138  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
0139  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
0140  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
0141  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
0142  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0143  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0144  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0145  *
0146  * Alternatively, you may choose to be licensed under the terms of the
0147  * GNU General Public License ("GPL") version 2 as published by the Free
0148  * Software Foundation.
0149  *
0150  *****************************************************************************/
0151 
0152 #ifndef __ACTYPES_H__
0153 #define __ACTYPES_H__
0154 
0155 /* acpisrc:StructDefs -- for acpisrc conversion */
0156 
0157 /*
0158  * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent
0159  * header and must be either 32 or 64. 16-bit ACPICA is no longer
0160  * supported, as of 12/2006.
0161  */
0162 #ifndef ACPI_MACHINE_WIDTH
0163 #error ACPI_MACHINE_WIDTH not defined
0164 #endif
0165 
0166 /*
0167  * Data type ranges
0168  * Note: These macros are designed to be compiler independent as well as
0169  * working around problems that some 32-bit compilers have with 64-bit
0170  * constants.
0171  */
0172 #define ACPI_UINT8_MAX                  (UINT8) (~((UINT8)  0)) /* 0xFF               */
0173 #define ACPI_UINT16_MAX                 (UINT16)(~((UINT16) 0)) /* 0xFFFF             */
0174 #define ACPI_UINT32_MAX                 (UINT32)(~((UINT32) 0)) /* 0xFFFFFFFF         */
0175 #define ACPI_UINT64_MAX                 (UINT64)(~((UINT64) 0)) /* 0xFFFFFFFFFFFFFFFF */
0176 #define ACPI_ASCII_MAX                  0x7F
0177 
0178 
0179 /*
0180  * Architecture-specific ACPICA Subsystem Data Types
0181  *
0182  * The goal of these types is to provide source code portability across
0183  * 16-bit, 32-bit, and 64-bit targets.
0184  *
0185  * 1) The following types are of fixed size for all targets (16/32/64):
0186  *
0187  * BOOLEAN      Logical boolean
0188  *
0189  * UINT8        8-bit  (1 byte) unsigned value
0190  * UINT16       16-bit (2 byte) unsigned value
0191  * UINT32       32-bit (4 byte) unsigned value
0192  * UINT64       64-bit (8 byte) unsigned value
0193  *
0194  * INT16        16-bit (2 byte) signed value
0195  * INT32        32-bit (4 byte) signed value
0196  * INT64        64-bit (8 byte) signed value
0197  *
0198  * COMPILER_DEPENDENT_UINT64/INT64 - These types are defined in the
0199  * compiler-dependent header(s) and were introduced because there is no
0200  * common 64-bit integer type across the various compilation models, as
0201  * shown in the table below.
0202  *
0203  * Datatype  LP64 ILP64 LLP64 ILP32 LP32 16bit
0204  * char      8    8     8     8     8    8
0205  * short     16   16    16    16    16   16
0206  * _int32         32
0207  * int       32   64    32    32    16   16
0208  * long      64   64    32    32    32   32
0209  * long long            64    64
0210  * pointer   64   64    64    32    32   32
0211  *
0212  * Note: ILP64 and LP32 are currently not supported.
0213  *
0214  *
0215  * 2) These types represent the native word size of the target mode of the
0216  * processor, and may be 16-bit, 32-bit, or 64-bit as required. They are
0217  * usually used for memory allocation, efficient loop counters, and array
0218  * indexes. The types are similar to the size_t type in the C library and
0219  * are required because there is no C type that consistently represents the
0220  * native data width. ACPI_SIZE is needed because there is no guarantee
0221  * that a kernel-level C library is present.
0222  *
0223  * ACPI_SIZE        16/32/64-bit unsigned value
0224  * ACPI_NATIVE_INT  16/32/64-bit signed value
0225  */
0226 
0227 /*******************************************************************************
0228  *
0229  * Common types for all compilers, all targets
0230  *
0231  ******************************************************************************/
0232 
0233 #ifndef ACPI_USE_SYSTEM_INTTYPES
0234 
0235 typedef unsigned char                   BOOLEAN;
0236 typedef unsigned char                   UINT8;
0237 typedef unsigned short                  UINT16;
0238 typedef short                           INT16;
0239 typedef COMPILER_DEPENDENT_UINT64       UINT64;
0240 typedef COMPILER_DEPENDENT_INT64        INT64;
0241 
0242 #endif /* ACPI_USE_SYSTEM_INTTYPES */
0243 
0244 /*
0245  * Value returned by AcpiOsGetThreadId. There is no standard "thread_id"
0246  * across operating systems or even the various UNIX systems. Since ACPICA
0247  * only needs the thread ID as a unique thread identifier, we use a UINT64
0248  * as the only common data type - it will accommodate any type of pointer or
0249  * any type of integer. It is up to the host-dependent OSL to cast the
0250  * native thread ID type to a UINT64 (in AcpiOsGetThreadId).
0251  */
0252 #define ACPI_THREAD_ID                  UINT64
0253 
0254 
0255 /*******************************************************************************
0256  *
0257  * Types specific to 64-bit targets
0258  *
0259  ******************************************************************************/
0260 
0261 #if ACPI_MACHINE_WIDTH == 64
0262 
0263 #ifndef ACPI_USE_SYSTEM_INTTYPES
0264 
0265 typedef unsigned int                    UINT32;
0266 typedef int                             INT32;
0267 
0268 #endif /* ACPI_USE_SYSTEM_INTTYPES */
0269 
0270 
0271 typedef INT64                           ACPI_NATIVE_INT;
0272 typedef UINT64                          ACPI_SIZE;
0273 typedef UINT64                          ACPI_IO_ADDRESS;
0274 typedef UINT64                          ACPI_PHYSICAL_ADDRESS;
0275 
0276 #define ACPI_MAX_PTR                    ACPI_UINT64_MAX
0277 #define ACPI_SIZE_MAX                   ACPI_UINT64_MAX
0278 #define ACPI_USE_NATIVE_DIVIDE          /* Has native 64-bit integer support */
0279 #define ACPI_USE_NATIVE_MATH64          /* Has native 64-bit integer support */
0280 
0281 /*
0282  * In the case of the Itanium Processor Family (IPF), the hardware does not
0283  * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED
0284  * flag to indicate that special precautions must be taken to avoid alignment
0285  * faults. (IA64 or ia64 is currently used by existing compilers to indicate
0286  * IPF.)
0287  *
0288  * Note: EM64T and other X86-64 processors support misaligned transfers,
0289  * so there is no need to define this flag.
0290  */
0291 #if defined (__IA64__) || defined (__ia64__)
0292 #define ACPI_MISALIGNMENT_NOT_SUPPORTED
0293 #endif
0294 
0295 
0296 /*******************************************************************************
0297  *
0298  * Types specific to 32-bit targets
0299  *
0300  ******************************************************************************/
0301 
0302 #elif ACPI_MACHINE_WIDTH == 32
0303 
0304 #ifndef ACPI_USE_SYSTEM_INTTYPES
0305 
0306 typedef unsigned int                    UINT32;
0307 typedef int                             INT32;
0308 
0309 #endif /* ACPI_USE_SYSTEM_INTTYPES */
0310 
0311 
0312 typedef INT32                           ACPI_NATIVE_INT;
0313 typedef UINT32                          ACPI_SIZE;
0314 
0315 #ifdef ACPI_32BIT_PHYSICAL_ADDRESS
0316 
0317 /*
0318  * OSPMs can define this to shrink the size of the structures for 32-bit
0319  * none PAE environment. ASL compiler may always define this to generate
0320  * 32-bit OSPM compliant tables.
0321  */
0322 typedef UINT32                          ACPI_IO_ADDRESS;
0323 typedef UINT32                          ACPI_PHYSICAL_ADDRESS;
0324 
0325 #else /* ACPI_32BIT_PHYSICAL_ADDRESS */
0326 
0327 /*
0328  * It is reported that, after some calculations, the physical addresses can
0329  * wrap over the 32-bit boundary on 32-bit PAE environment.
0330  * https://bugzilla.kernel.org/show_bug.cgi?id=87971
0331  */
0332 typedef UINT64                          ACPI_IO_ADDRESS;
0333 typedef UINT64                          ACPI_PHYSICAL_ADDRESS;
0334 
0335 #endif /* ACPI_32BIT_PHYSICAL_ADDRESS */
0336 
0337 #define ACPI_MAX_PTR                    ACPI_UINT32_MAX
0338 #define ACPI_SIZE_MAX                   ACPI_UINT32_MAX
0339 
0340 #else
0341 
0342 /* ACPI_MACHINE_WIDTH must be either 64 or 32 */
0343 
0344 #error unknown ACPI_MACHINE_WIDTH
0345 #endif
0346 
0347 
0348 /*******************************************************************************
0349  *
0350  * OS-dependent types
0351  *
0352  * If the defaults below are not appropriate for the host system, they can
0353  * be defined in the OS-specific header, and this will take precedence.
0354  *
0355  ******************************************************************************/
0356 
0357 /* Flags for AcpiOsAcquireLock/AcpiOsReleaseLock */
0358 
0359 #ifndef ACPI_CPU_FLAGS
0360 #define ACPI_CPU_FLAGS                  ACPI_SIZE
0361 #endif
0362 
0363 /* Object returned from AcpiOsCreateCache */
0364 
0365 #ifndef ACPI_CACHE_T
0366 #ifdef ACPI_USE_LOCAL_CACHE
0367 #define ACPI_CACHE_T                    ACPI_MEMORY_LIST
0368 #else
0369 #define ACPI_CACHE_T                    void *
0370 #endif
0371 #endif
0372 
0373 /*
0374  * Synchronization objects - Mutexes, Semaphores, and SpinLocks
0375  */
0376 #if (ACPI_MUTEX_TYPE == ACPI_BINARY_SEMAPHORE)
0377 /*
0378  * These macros are used if the host OS does not support a mutex object.
0379  * Map the OSL Mutex interfaces to binary semaphores.
0380  */
0381 #define ACPI_MUTEX                      ACPI_SEMAPHORE
0382 #define AcpiOsCreateMutex(OutHandle)    AcpiOsCreateSemaphore (1, 1, OutHandle)
0383 #define AcpiOsDeleteMutex(Handle)       (void) AcpiOsDeleteSemaphore (Handle)
0384 #define AcpiOsAcquireMutex(Handle,Time) AcpiOsWaitSemaphore (Handle, 1, Time)
0385 #define AcpiOsReleaseMutex(Handle)      (void) AcpiOsSignalSemaphore (Handle, 1)
0386 #endif
0387 
0388 /* Configurable types for synchronization objects */
0389 
0390 #ifndef ACPI_SPINLOCK
0391 #define ACPI_SPINLOCK                   void *
0392 #endif
0393 
0394 #ifndef ACPI_SEMAPHORE
0395 #define ACPI_SEMAPHORE                  void *
0396 #endif
0397 
0398 #ifndef ACPI_MUTEX
0399 #define ACPI_MUTEX                      void *
0400 #endif
0401 
0402 
0403 /*******************************************************************************
0404  *
0405  * Compiler-dependent types
0406  *
0407  * If the defaults below are not appropriate for the host compiler, they can
0408  * be defined in the compiler-specific header, and this will take precedence.
0409  *
0410  ******************************************************************************/
0411 
0412 /* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */
0413 
0414 #ifndef ACPI_UINTPTR_T
0415 #define ACPI_UINTPTR_T                  void *
0416 #endif
0417 
0418 /*
0419  * ACPI_PRINTF_LIKE is used to tag functions as "printf-like" because
0420  * some compilers can catch printf format string problems
0421  */
0422 #ifndef ACPI_PRINTF_LIKE
0423 #define ACPI_PRINTF_LIKE(c)
0424 #endif
0425 
0426 /*
0427  * Some compilers complain about unused variables. Sometimes we don't want
0428  * to use all the variables (for example, _AcpiModuleName). This allows us
0429  * to tell the compiler in a per-variable manner that a variable
0430  * is unused
0431  */
0432 #ifndef ACPI_UNUSED_VAR
0433 #define ACPI_UNUSED_VAR
0434 #endif
0435 
0436 /*
0437  * All ACPICA external functions that are available to the rest of the
0438  * kernel are tagged with these macros which can be defined as appropriate
0439  * for the host.
0440  *
0441  * Notes:
0442  * ACPI_EXPORT_SYMBOL_INIT is used for initialization and termination
0443  * interfaces that may need special processing.
0444  * ACPI_EXPORT_SYMBOL is used for all other public external functions.
0445  */
0446 #ifndef ACPI_EXPORT_SYMBOL_INIT
0447 #define ACPI_EXPORT_SYMBOL_INIT(Symbol)
0448 #endif
0449 
0450 #ifndef ACPI_EXPORT_SYMBOL
0451 #define ACPI_EXPORT_SYMBOL(Symbol)
0452 #endif
0453 
0454 /*
0455  * Compiler/Clibrary-dependent debug initialization. Used for ACPICA
0456  * utilities only.
0457  */
0458 #ifndef ACPI_DEBUG_INITIALIZE
0459 #define ACPI_DEBUG_INITIALIZE()
0460 #endif
0461 
0462 
0463 /*******************************************************************************
0464  *
0465  * Configuration
0466  *
0467  ******************************************************************************/
0468 
0469 #ifdef ACPI_NO_MEM_ALLOCATIONS
0470 
0471 #define ACPI_ALLOCATE(a)                NULL
0472 #define ACPI_ALLOCATE_ZEROED(a)         NULL
0473 #define ACPI_FREE(a)
0474 #define ACPI_MEM_TRACKING(a)
0475 
0476 #else /* ACPI_NO_MEM_ALLOCATIONS */
0477 
0478 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
0479 /*
0480  * Memory allocation tracking (used by AcpiExec to detect memory leaks)
0481  */
0482 #define ACPI_MEM_PARAMETERS             _COMPONENT, _AcpiModuleName, __LINE__
0483 #define ACPI_ALLOCATE(a)                AcpiUtAllocateAndTrack ((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS)
0484 #define ACPI_ALLOCATE_ZEROED(a)         AcpiUtAllocateZeroedAndTrack ((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS)
0485 #define ACPI_FREE(a)                    AcpiUtFreeAndTrack (a, ACPI_MEM_PARAMETERS)
0486 #define ACPI_MEM_TRACKING(a)            a
0487 
0488 #else
0489 /*
0490  * Normal memory allocation directly via the OS services layer
0491  */
0492 #define ACPI_ALLOCATE(a)                AcpiOsAllocate ((ACPI_SIZE) (a))
0493 #define ACPI_ALLOCATE_ZEROED(a)         AcpiOsAllocateZeroed ((ACPI_SIZE) (a))
0494 #define ACPI_FREE(a)                    AcpiOsFree (a)
0495 #define ACPI_MEM_TRACKING(a)
0496 
0497 #endif /* ACPI_DBG_TRACK_ALLOCATIONS */
0498 
0499 #endif /* ACPI_NO_MEM_ALLOCATIONS */
0500 
0501 
0502 /******************************************************************************
0503  *
0504  * ACPI Specification constants (Do not change unless the specification
0505  * changes)
0506  *
0507  *****************************************************************************/
0508 
0509 /* Number of distinct FADT-based GPE register blocks (GPE0 and GPE1) */
0510 
0511 #define ACPI_MAX_GPE_BLOCKS             2
0512 
0513 /* Default ACPI register widths */
0514 
0515 #define ACPI_GPE_REGISTER_WIDTH         8
0516 #define ACPI_PM1_REGISTER_WIDTH         16
0517 #define ACPI_PM2_REGISTER_WIDTH         8
0518 #define ACPI_PM_TIMER_WIDTH             32
0519 #define ACPI_RESET_REGISTER_WIDTH       8
0520 
0521 /* Names within the namespace are 4 bytes long */
0522 
0523 #define ACPI_NAMESEG_SIZE               4           /* Fixed by ACPI spec */
0524 #define ACPI_PATH_SEGMENT_LENGTH        5           /* 4 chars for name + 1 char for separator */
0525 #define ACPI_PATH_SEPARATOR             '.'
0526 
0527 /* Sizes for ACPI table headers */
0528 
0529 #define ACPI_OEM_ID_SIZE                6
0530 #define ACPI_OEM_TABLE_ID_SIZE          8
0531 
0532 /* ACPI/PNP hardware IDs */
0533 
0534 #define PCI_ROOT_HID_STRING             "PNP0A03"
0535 #define PCI_EXPRESS_ROOT_HID_STRING     "PNP0A08"
0536 
0537 /* PM Timer ticks per second (HZ) */
0538 
0539 #define ACPI_PM_TIMER_FREQUENCY         3579545
0540 
0541 
0542 /*******************************************************************************
0543  *
0544  * Independent types
0545  *
0546  ******************************************************************************/
0547 
0548 /* Logical defines and NULL */
0549 
0550 #ifdef FALSE
0551 #undef FALSE
0552 #endif
0553 #define FALSE                           (1 == 0)
0554 
0555 #ifdef TRUE
0556 #undef TRUE
0557 #endif
0558 #define TRUE                            (1 == 1)
0559 
0560 #ifndef NULL
0561 #define NULL                            (void *) 0
0562 #endif
0563 
0564 
0565 /*
0566  * Miscellaneous types
0567  */
0568 typedef UINT32                          ACPI_STATUS;    /* All ACPI Exceptions */
0569 typedef UINT32                          ACPI_NAME;      /* 4-byte ACPI name */
0570 typedef char *                          ACPI_STRING;    /* Null terminated ASCII string */
0571 typedef void *                          ACPI_HANDLE;    /* Actually a ptr to a NS Node */
0572 
0573 
0574 /* Time constants for timer calculations */
0575 
0576 #define ACPI_MSEC_PER_SEC               1000L
0577 
0578 #define ACPI_USEC_PER_MSEC              1000L
0579 #define ACPI_USEC_PER_SEC               1000000L
0580 
0581 #define ACPI_100NSEC_PER_USEC           10L
0582 #define ACPI_100NSEC_PER_MSEC           10000L
0583 #define ACPI_100NSEC_PER_SEC            10000000L
0584 
0585 #define ACPI_NSEC_PER_USEC              1000L
0586 #define ACPI_NSEC_PER_MSEC              1000000L
0587 #define ACPI_NSEC_PER_SEC               1000000000L
0588 
0589 #define ACPI_TIME_AFTER(a, b)           ((INT64)((b) - (a)) < 0)
0590 
0591 
0592 /* Owner IDs are used to track namespace nodes for selective deletion */
0593 
0594 typedef UINT16                          ACPI_OWNER_ID;
0595 #define ACPI_OWNER_ID_MAX               0xFFF   /* 4095 possible owner IDs */
0596 
0597 
0598 #define ACPI_INTEGER_BIT_SIZE           64
0599 #define ACPI_MAX_DECIMAL_DIGITS         20  /* 2^64 = 18,446,744,073,709,551,616 */
0600 #define ACPI_MAX64_DECIMAL_DIGITS       20
0601 #define ACPI_MAX32_DECIMAL_DIGITS       10
0602 #define ACPI_MAX16_DECIMAL_DIGITS        5
0603 #define ACPI_MAX8_DECIMAL_DIGITS         3
0604 
0605 /*
0606  * Constants with special meanings
0607  */
0608 #define ACPI_ROOT_OBJECT                ((ACPI_HANDLE) ACPI_TO_POINTER (ACPI_MAX_PTR))
0609 #define ACPI_WAIT_FOREVER               0xFFFF  /* UINT16, as per ACPI spec */
0610 #define ACPI_DO_NOT_WAIT                0
0611 
0612 /*
0613  * Obsolete: Acpi integer width. In ACPI version 1 (1996), integers are
0614  * 32 bits. In ACPI version 2 (2000) and later, integers are max 64 bits.
0615  * Note that this pertains to the ACPI integer type only, not to other
0616  * integers used in the implementation of the ACPICA subsystem.
0617  *
0618  * 01/2010: This type is obsolete and has been removed from the entire ACPICA
0619  * code base. It remains here for compatibility with device drivers that use
0620  * the type. However, it will be removed in the future.
0621  */
0622 typedef UINT64                          ACPI_INTEGER;
0623 #define ACPI_INTEGER_MAX                ACPI_UINT64_MAX
0624 
0625 
0626 /*******************************************************************************
0627  *
0628  * Commonly used macros
0629  *
0630  ******************************************************************************/
0631 
0632 /* Data manipulation */
0633 
0634 #define ACPI_LOBYTE(Integer)            ((UINT8)   (UINT16)(Integer))
0635 #define ACPI_HIBYTE(Integer)            ((UINT8) (((UINT16)(Integer)) >> 8))
0636 #define ACPI_LOWORD(Integer)            ((UINT16)  (UINT32)(Integer))
0637 #define ACPI_HIWORD(Integer)            ((UINT16)(((UINT32)(Integer)) >> 16))
0638 #define ACPI_LODWORD(Integer64)         ((UINT32)  (UINT64)(Integer64))
0639 #define ACPI_HIDWORD(Integer64)         ((UINT32)(((UINT64)(Integer64)) >> 32))
0640 
0641 #define ACPI_SET_BIT(target,bit)        ((target) |= (bit))
0642 #define ACPI_CLEAR_BIT(target,bit)      ((target) &= ~(bit))
0643 #define ACPI_MIN(a,b)                   (((a)<(b))?(a):(b))
0644 #define ACPI_MAX(a,b)                   (((a)>(b))?(a):(b))
0645 
0646 /* Size calculation */
0647 
0648 #define ACPI_ARRAY_LENGTH(x)            (sizeof(x) / sizeof((x)[0]))
0649 
0650 /* Pointer manipulation */
0651 
0652 #define ACPI_CAST_PTR(t, p)             ((t *) (ACPI_UINTPTR_T) (p))
0653 #define ACPI_CAST_INDIRECT_PTR(t, p)    ((t **) (ACPI_UINTPTR_T) (p))
0654 #define ACPI_ADD_PTR(t, a, b)           ACPI_CAST_PTR (t, (ACPI_CAST_PTR (UINT8, (a)) + (ACPI_SIZE)(b)))
0655 #define ACPI_SUB_PTR(t, a, b)           ACPI_CAST_PTR (t, (ACPI_CAST_PTR (UINT8, (a)) - (ACPI_SIZE)(b)))
0656 #define ACPI_PTR_DIFF(a, b)             ((ACPI_SIZE) (ACPI_CAST_PTR (UINT8, (a)) - ACPI_CAST_PTR (UINT8, (b))))
0657 
0658 /* Pointer/Integer type conversions */
0659 
0660 #define ACPI_TO_POINTER(i)              ACPI_CAST_PTR (void, (ACPI_SIZE) (i))
0661 #ifndef ACPI_TO_INTEGER
0662 #define ACPI_TO_INTEGER(p)              ACPI_PTR_DIFF (p, (void *) 0)
0663 #endif
0664 #ifndef ACPI_OFFSET
0665 #define ACPI_OFFSET(d, f)               ACPI_PTR_DIFF (&(((d *) 0)->f), (void *) 0)
0666 #endif
0667 #define ACPI_PTR_TO_PHYSADDR(i)         ACPI_TO_INTEGER(i)
0668 
0669 /* Optimizations for 4-character (32-bit) ACPI_NAME manipulation */
0670 
0671 #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
0672 #define ACPI_COMPARE_NAMESEG(a,b)       (*ACPI_CAST_PTR (UINT32, (a)) == *ACPI_CAST_PTR (UINT32, (b)))
0673 #define ACPI_COPY_NAMESEG(dest,src)     (*ACPI_CAST_PTR (UINT32, (dest)) = *ACPI_CAST_PTR (UINT32, (src)))
0674 #else
0675 #define ACPI_COMPARE_NAMESEG(a,b)       (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAMESEG_SIZE))
0676 #define ACPI_COPY_NAMESEG(dest,src)     (strncpy (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAMESEG_SIZE))
0677 #endif
0678 
0679 /* Support for the special RSDP signature (8 characters) */
0680 
0681 #define ACPI_VALIDATE_RSDP_SIG(a)       (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, 8))
0682 #define ACPI_MAKE_RSDP_SIG(dest)        (memcpy (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8))
0683 
0684 /* Support for OEMx signature (x can be any character) */
0685 #define ACPI_IS_OEM_SIG(a)        (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_OEM_NAME, 3) &&\
0686                                       strnlen (a, ACPI_NAMESEG_SIZE) == ACPI_NAMESEG_SIZE)
0687 
0688 /*
0689  * Algorithm to obtain access bit or byte width.
0690  * Can be used with AccessSize field of ACPI_GENERIC_ADDRESS and
0691  * ACPI_RESOURCE_GENERIC_REGISTER.
0692  */
0693 #define ACPI_ACCESS_BIT_SHIFT           2
0694 #define ACPI_ACCESS_BYTE_SHIFT          -1
0695 #define ACPI_ACCESS_BIT_MAX             (31 - ACPI_ACCESS_BIT_SHIFT)
0696 #define ACPI_ACCESS_BYTE_MAX            (31 - ACPI_ACCESS_BYTE_SHIFT)
0697 #define ACPI_ACCESS_BIT_DEFAULT         (8 - ACPI_ACCESS_BIT_SHIFT)
0698 #define ACPI_ACCESS_BYTE_DEFAULT        (8 - ACPI_ACCESS_BYTE_SHIFT)
0699 #define ACPI_ACCESS_BIT_WIDTH(size)     (1 << ((size) + ACPI_ACCESS_BIT_SHIFT))
0700 #define ACPI_ACCESS_BYTE_WIDTH(size)    (1 << ((size) + ACPI_ACCESS_BYTE_SHIFT))
0701 
0702 /*******************************************************************************
0703  *
0704  * Miscellaneous constants
0705  *
0706  ******************************************************************************/
0707 
0708 /*
0709  * Initialization sequence options
0710  */
0711 #define ACPI_FULL_INITIALIZATION        0x0000
0712 #define ACPI_NO_FACS_INIT               0x0001
0713 #define ACPI_NO_ACPI_ENABLE             0x0002
0714 #define ACPI_NO_HARDWARE_INIT           0x0004
0715 #define ACPI_NO_EVENT_INIT              0x0008
0716 #define ACPI_NO_HANDLER_INIT            0x0010
0717 #define ACPI_NO_OBJECT_INIT             0x0020
0718 #define ACPI_NO_DEVICE_INIT             0x0040
0719 #define ACPI_NO_ADDRESS_SPACE_INIT      0x0080
0720 
0721 /*
0722  * Initialization state
0723  */
0724 #define ACPI_SUBSYSTEM_INITIALIZE       0x01
0725 #define ACPI_INITIALIZED_OK             0x02
0726 
0727 /*
0728  * Power state values
0729  */
0730 #define ACPI_STATE_UNKNOWN              (UINT8) 0xFF
0731 
0732 #define ACPI_STATE_S0                   (UINT8) 0
0733 #define ACPI_STATE_S1                   (UINT8) 1
0734 #define ACPI_STATE_S2                   (UINT8) 2
0735 #define ACPI_STATE_S3                   (UINT8) 3
0736 #define ACPI_STATE_S4                   (UINT8) 4
0737 #define ACPI_STATE_S5                   (UINT8) 5
0738 #define ACPI_S_STATES_MAX               ACPI_STATE_S5
0739 #define ACPI_S_STATE_COUNT              6
0740 
0741 #define ACPI_STATE_D0                   (UINT8) 0
0742 #define ACPI_STATE_D1                   (UINT8) 1
0743 #define ACPI_STATE_D2                   (UINT8) 2
0744 #define ACPI_STATE_D3                   (UINT8) 3
0745 #define ACPI_D_STATES_MAX               ACPI_STATE_D3
0746 #define ACPI_D_STATE_COUNT              4
0747 
0748 #define ACPI_STATE_C0                   (UINT8) 0
0749 #define ACPI_STATE_C1                   (UINT8) 1
0750 #define ACPI_STATE_C2                   (UINT8) 2
0751 #define ACPI_STATE_C3                   (UINT8) 3
0752 #define ACPI_C_STATES_MAX               ACPI_STATE_C3
0753 #define ACPI_C_STATE_COUNT              4
0754 
0755 /*
0756  * Sleep type invalid value
0757  */
0758 #define ACPI_SLEEP_TYPE_MAX             0x7
0759 #define ACPI_SLEEP_TYPE_INVALID         0xFF
0760 
0761 /*
0762  * Standard notify values
0763  */
0764 #define ACPI_NOTIFY_BUS_CHECK           (UINT8) 0x00
0765 #define ACPI_NOTIFY_DEVICE_CHECK        (UINT8) 0x01
0766 #define ACPI_NOTIFY_DEVICE_WAKE         (UINT8) 0x02
0767 #define ACPI_NOTIFY_EJECT_REQUEST       (UINT8) 0x03
0768 #define ACPI_NOTIFY_DEVICE_CHECK_LIGHT  (UINT8) 0x04
0769 #define ACPI_NOTIFY_FREQUENCY_MISMATCH  (UINT8) 0x05
0770 #define ACPI_NOTIFY_BUS_MODE_MISMATCH   (UINT8) 0x06
0771 #define ACPI_NOTIFY_POWER_FAULT         (UINT8) 0x07
0772 #define ACPI_NOTIFY_CAPABILITIES_CHECK  (UINT8) 0x08
0773 #define ACPI_NOTIFY_DEVICE_PLD_CHECK    (UINT8) 0x09
0774 #define ACPI_NOTIFY_RESERVED            (UINT8) 0x0A
0775 #define ACPI_NOTIFY_LOCALITY_UPDATE     (UINT8) 0x0B
0776 #define ACPI_NOTIFY_SHUTDOWN_REQUEST    (UINT8) 0x0C
0777 #define ACPI_NOTIFY_AFFINITY_UPDATE     (UINT8) 0x0D
0778 #define ACPI_NOTIFY_MEMORY_UPDATE       (UINT8) 0x0E
0779 #define ACPI_NOTIFY_DISCONNECT_RECOVER  (UINT8) 0x0F
0780 
0781 #define ACPI_GENERIC_NOTIFY_MAX         0x0F
0782 #define ACPI_SPECIFIC_NOTIFY_MAX        0x84
0783 
0784 /*
0785  * Types associated with ACPI names and objects. The first group of
0786  * values (up to ACPI_TYPE_EXTERNAL_MAX) correspond to the definition
0787  * of the ACPI ObjectType() operator (See the ACPI Spec). Therefore,
0788  * only add to the first group if the spec changes.
0789  *
0790  * NOTE: Types must be kept in sync with the global AcpiNsProperties
0791  * and AcpiNsTypeNames arrays.
0792  */
0793 typedef UINT32                          ACPI_OBJECT_TYPE;
0794 
0795 #define ACPI_TYPE_ANY                   0x00
0796 #define ACPI_TYPE_INTEGER               0x01  /* Byte/Word/Dword/Zero/One/Ones */
0797 #define ACPI_TYPE_STRING                0x02
0798 #define ACPI_TYPE_BUFFER                0x03
0799 #define ACPI_TYPE_PACKAGE               0x04  /* ByteConst, multiple DataTerm/Constant/SuperName */
0800 #define ACPI_TYPE_FIELD_UNIT            0x05
0801 #define ACPI_TYPE_DEVICE                0x06  /* Name, multiple Node */
0802 #define ACPI_TYPE_EVENT                 0x07
0803 #define ACPI_TYPE_METHOD                0x08  /* Name, ByteConst, multiple Code */
0804 #define ACPI_TYPE_MUTEX                 0x09
0805 #define ACPI_TYPE_REGION                0x0A
0806 #define ACPI_TYPE_POWER                 0x0B  /* Name,ByteConst,WordConst,multi Node */
0807 #define ACPI_TYPE_PROCESSOR             0x0C  /* Name,ByteConst,DWordConst,ByteConst,multi NmO */
0808 #define ACPI_TYPE_THERMAL               0x0D  /* Name, multiple Node */
0809 #define ACPI_TYPE_BUFFER_FIELD          0x0E
0810 #define ACPI_TYPE_DDB_HANDLE            0x0F
0811 #define ACPI_TYPE_DEBUG_OBJECT          0x10
0812 
0813 #define ACPI_TYPE_EXTERNAL_MAX          0x10
0814 #define ACPI_NUM_TYPES                  (ACPI_TYPE_EXTERNAL_MAX + 1)
0815 
0816 /*
0817  * These are object types that do not map directly to the ACPI
0818  * ObjectType() operator. They are used for various internal purposes
0819  * only. If new predefined ACPI_TYPEs are added (via the ACPI
0820  * specification), these internal types must move upwards. (There
0821  * is code that depends on these values being contiguous with the
0822  * external types above.)
0823  */
0824 #define ACPI_TYPE_LOCAL_REGION_FIELD    0x11
0825 #define ACPI_TYPE_LOCAL_BANK_FIELD      0x12
0826 #define ACPI_TYPE_LOCAL_INDEX_FIELD     0x13
0827 #define ACPI_TYPE_LOCAL_REFERENCE       0x14  /* Arg#, Local#, Name, Debug, RefOf, Index */
0828 #define ACPI_TYPE_LOCAL_ALIAS           0x15
0829 #define ACPI_TYPE_LOCAL_METHOD_ALIAS    0x16
0830 #define ACPI_TYPE_LOCAL_NOTIFY          0x17
0831 #define ACPI_TYPE_LOCAL_ADDRESS_HANDLER 0x18
0832 #define ACPI_TYPE_LOCAL_RESOURCE        0x19
0833 #define ACPI_TYPE_LOCAL_RESOURCE_FIELD  0x1A
0834 #define ACPI_TYPE_LOCAL_SCOPE           0x1B  /* 1 Name, multiple ObjectList Nodes */
0835 
0836 #define ACPI_TYPE_NS_NODE_MAX           0x1B  /* Last typecode used within a NS Node */
0837 #define ACPI_TOTAL_TYPES                (ACPI_TYPE_NS_NODE_MAX + 1)
0838 
0839 /*
0840  * These are special object types that never appear in
0841  * a Namespace node, only in an object of ACPI_OPERAND_OBJECT
0842  */
0843 #define ACPI_TYPE_LOCAL_EXTRA           0x1C
0844 #define ACPI_TYPE_LOCAL_DATA            0x1D
0845 
0846 #define ACPI_TYPE_LOCAL_MAX             0x1D
0847 
0848 /* All types above here are invalid */
0849 
0850 #define ACPI_TYPE_INVALID               0x1E
0851 #define ACPI_TYPE_NOT_FOUND             0xFF
0852 
0853 #define ACPI_NUM_NS_TYPES               (ACPI_TYPE_INVALID + 1)
0854 
0855 
0856 /*
0857  * All I/O
0858  */
0859 #define ACPI_READ                       0
0860 #define ACPI_WRITE                      1
0861 #define ACPI_IO_MASK                    1
0862 
0863 /*
0864  * Event Types: Fixed & General Purpose
0865  */
0866 typedef UINT32                          ACPI_EVENT_TYPE;
0867 
0868 /*
0869  * Fixed events
0870  */
0871 #define ACPI_EVENT_PMTIMER              0
0872 #define ACPI_EVENT_GLOBAL               1
0873 #define ACPI_EVENT_POWER_BUTTON         2
0874 #define ACPI_EVENT_SLEEP_BUTTON         3
0875 #define ACPI_EVENT_RTC                  4
0876 #define ACPI_EVENT_MAX                  4
0877 #define ACPI_NUM_FIXED_EVENTS           ACPI_EVENT_MAX + 1
0878 
0879 /*
0880  * Event Status - Per event
0881  * -------------
0882  * The encoding of ACPI_EVENT_STATUS is illustrated below.
0883  * Note that a set bit (1) indicates the property is TRUE
0884  * (e.g. if bit 0 is set then the event is enabled).
0885  * +-------------+-+-+-+-+-+-+
0886  * |   Bits 31:6 |5|4|3|2|1|0|
0887  * +-------------+-+-+-+-+-+-+
0888  *          |     | | | | | |
0889  *          |     | | | | | +- Enabled?
0890  *          |     | | | | +--- Enabled for wake?
0891  *          |     | | | +----- Status bit set?
0892  *          |     | | +------- Enable bit set?
0893  *          |     | +--------- Has a handler?
0894  *          |     +----------- Masked?
0895  *          +----------------- <Reserved>
0896  */
0897 typedef UINT32                          ACPI_EVENT_STATUS;
0898 
0899 #define ACPI_EVENT_FLAG_DISABLED        (ACPI_EVENT_STATUS) 0x00
0900 #define ACPI_EVENT_FLAG_ENABLED         (ACPI_EVENT_STATUS) 0x01
0901 #define ACPI_EVENT_FLAG_WAKE_ENABLED    (ACPI_EVENT_STATUS) 0x02
0902 #define ACPI_EVENT_FLAG_STATUS_SET      (ACPI_EVENT_STATUS) 0x04
0903 #define ACPI_EVENT_FLAG_ENABLE_SET      (ACPI_EVENT_STATUS) 0x08
0904 #define ACPI_EVENT_FLAG_HAS_HANDLER     (ACPI_EVENT_STATUS) 0x10
0905 #define ACPI_EVENT_FLAG_MASKED          (ACPI_EVENT_STATUS) 0x20
0906 #define ACPI_EVENT_FLAG_SET             ACPI_EVENT_FLAG_STATUS_SET
0907 
0908 /* Actions for AcpiSetGpe, AcpiGpeWakeup, AcpiHwLowSetGpe */
0909 
0910 #define ACPI_GPE_ENABLE                 0
0911 #define ACPI_GPE_DISABLE                1
0912 #define ACPI_GPE_CONDITIONAL_ENABLE     2
0913 
0914 /*
0915  * GPE info flags - Per GPE
0916  * +---+-+-+-+---+
0917  * |7:6|5|4|3|2:0|
0918  * +---+-+-+-+---+
0919  *   |  | | |  |
0920  *   |  | | |  +-- Type of dispatch:to method, handler, notify, or none
0921  *   |  | | +----- Interrupt type: edge or level triggered
0922  *   |  | +------- Is a Wake GPE
0923  *   |  +--------- Has been enabled automatically at init time
0924  *   +------------ <Reserved>
0925  */
0926 #define ACPI_GPE_DISPATCH_NONE          (UINT8) 0x00
0927 #define ACPI_GPE_DISPATCH_METHOD        (UINT8) 0x01
0928 #define ACPI_GPE_DISPATCH_HANDLER       (UINT8) 0x02
0929 #define ACPI_GPE_DISPATCH_NOTIFY        (UINT8) 0x03
0930 #define ACPI_GPE_DISPATCH_RAW_HANDLER   (UINT8) 0x04
0931 #define ACPI_GPE_DISPATCH_MASK          (UINT8) 0x07
0932 #define ACPI_GPE_DISPATCH_TYPE(flags)   ((UINT8) ((flags) & ACPI_GPE_DISPATCH_MASK))
0933 
0934 #define ACPI_GPE_LEVEL_TRIGGERED        (UINT8) 0x08
0935 #define ACPI_GPE_EDGE_TRIGGERED         (UINT8) 0x00
0936 #define ACPI_GPE_XRUPT_TYPE_MASK        (UINT8) 0x08
0937 
0938 #define ACPI_GPE_CAN_WAKE               (UINT8) 0x10
0939 #define ACPI_GPE_AUTO_ENABLED           (UINT8) 0x20
0940 #define ACPI_GPE_INITIALIZED            (UINT8) 0x40
0941 
0942 /*
0943  * Flags for GPE and Lock interfaces
0944  */
0945 #define ACPI_NOT_ISR                    0x1
0946 #define ACPI_ISR                        0x0
0947 
0948 
0949 /* Notify types */
0950 
0951 #define ACPI_SYSTEM_NOTIFY              0x1
0952 #define ACPI_DEVICE_NOTIFY              0x2
0953 #define ACPI_ALL_NOTIFY                 (ACPI_SYSTEM_NOTIFY | ACPI_DEVICE_NOTIFY)
0954 #define ACPI_MAX_NOTIFY_HANDLER_TYPE    0x3
0955 #define ACPI_NUM_NOTIFY_TYPES           2
0956 
0957 #define ACPI_MAX_SYS_NOTIFY             0x7F
0958 #define ACPI_MAX_DEVICE_SPECIFIC_NOTIFY 0xBF
0959 
0960 #define ACPI_SYSTEM_HANDLER_LIST        0 /* Used as index, must be SYSTEM_NOTIFY -1 */
0961 #define ACPI_DEVICE_HANDLER_LIST        1 /* Used as index, must be DEVICE_NOTIFY -1 */
0962 
0963 
0964 /* Address Space (Operation Region) Types */
0965 
0966 typedef UINT8                           ACPI_ADR_SPACE_TYPE;
0967 
0968 #define ACPI_ADR_SPACE_SYSTEM_MEMORY    (ACPI_ADR_SPACE_TYPE) 0
0969 #define ACPI_ADR_SPACE_SYSTEM_IO        (ACPI_ADR_SPACE_TYPE) 1
0970 #define ACPI_ADR_SPACE_PCI_CONFIG       (ACPI_ADR_SPACE_TYPE) 2
0971 #define ACPI_ADR_SPACE_EC               (ACPI_ADR_SPACE_TYPE) 3
0972 #define ACPI_ADR_SPACE_SMBUS            (ACPI_ADR_SPACE_TYPE) 4
0973 #define ACPI_ADR_SPACE_CMOS             (ACPI_ADR_SPACE_TYPE) 5
0974 #define ACPI_ADR_SPACE_PCI_BAR_TARGET   (ACPI_ADR_SPACE_TYPE) 6
0975 #define ACPI_ADR_SPACE_IPMI             (ACPI_ADR_SPACE_TYPE) 7
0976 #define ACPI_ADR_SPACE_GPIO             (ACPI_ADR_SPACE_TYPE) 8
0977 #define ACPI_ADR_SPACE_GSBUS            (ACPI_ADR_SPACE_TYPE) 9
0978 #define ACPI_ADR_SPACE_PLATFORM_COMM    (ACPI_ADR_SPACE_TYPE) 10
0979 #define ACPI_ADR_SPACE_PLATFORM_RT      (ACPI_ADR_SPACE_TYPE) 11
0980 
0981 #define ACPI_NUM_PREDEFINED_REGIONS     12
0982 
0983 /*
0984  * Special Address Spaces
0985  *
0986  * Note: A Data Table region is a special type of operation region
0987  * that has its own AML opcode. However, internally, the AML
0988  * interpreter simply creates an operation region with an address
0989  * space type of ACPI_ADR_SPACE_DATA_TABLE.
0990  */
0991 #define ACPI_ADR_SPACE_DATA_TABLE       (ACPI_ADR_SPACE_TYPE) 0x7E /* Internal to ACPICA only */
0992 #define ACPI_ADR_SPACE_FIXED_HARDWARE   (ACPI_ADR_SPACE_TYPE) 0x7F
0993 
0994 /* Values for _REG connection code */
0995 
0996 #define ACPI_REG_DISCONNECT             0
0997 #define ACPI_REG_CONNECT                1
0998 
0999 /*
1000  * BitRegister IDs
1001  *
1002  * These values are intended to be used by the hardware interfaces
1003  * and are mapped to individual bitfields defined within the ACPI
1004  * registers. See the AcpiGbl_BitRegisterInfo global table in utglobal.c
1005  * for this mapping.
1006  */
1007 
1008 /* PM1 Status register */
1009 
1010 #define ACPI_BITREG_TIMER_STATUS                0x00
1011 #define ACPI_BITREG_BUS_MASTER_STATUS           0x01
1012 #define ACPI_BITREG_GLOBAL_LOCK_STATUS          0x02
1013 #define ACPI_BITREG_POWER_BUTTON_STATUS         0x03
1014 #define ACPI_BITREG_SLEEP_BUTTON_STATUS         0x04
1015 #define ACPI_BITREG_RT_CLOCK_STATUS             0x05
1016 #define ACPI_BITREG_WAKE_STATUS                 0x06
1017 #define ACPI_BITREG_PCIEXP_WAKE_STATUS          0x07
1018 
1019 /* PM1 Enable register */
1020 
1021 #define ACPI_BITREG_TIMER_ENABLE                0x08
1022 #define ACPI_BITREG_GLOBAL_LOCK_ENABLE          0x09
1023 #define ACPI_BITREG_POWER_BUTTON_ENABLE         0x0A
1024 #define ACPI_BITREG_SLEEP_BUTTON_ENABLE         0x0B
1025 #define ACPI_BITREG_RT_CLOCK_ENABLE             0x0C
1026 #define ACPI_BITREG_PCIEXP_WAKE_DISABLE         0x0D
1027 
1028 /* PM1 Control register */
1029 
1030 #define ACPI_BITREG_SCI_ENABLE                  0x0E
1031 #define ACPI_BITREG_BUS_MASTER_RLD              0x0F
1032 #define ACPI_BITREG_GLOBAL_LOCK_RELEASE         0x10
1033 #define ACPI_BITREG_SLEEP_TYPE                  0x11
1034 #define ACPI_BITREG_SLEEP_ENABLE                0x12
1035 
1036 /* PM2 Control register */
1037 
1038 #define ACPI_BITREG_ARB_DISABLE                 0x13
1039 
1040 #define ACPI_BITREG_MAX                         0x13
1041 #define ACPI_NUM_BITREG                         ACPI_BITREG_MAX + 1
1042 
1043 
1044 /* Status register values. A 1 clears a status bit. 0 = no effect */
1045 
1046 #define ACPI_CLEAR_STATUS                       1
1047 
1048 /* Enable and Control register values */
1049 
1050 #define ACPI_ENABLE_EVENT                       1
1051 #define ACPI_DISABLE_EVENT                      0
1052 
1053 
1054 /* Sleep function dispatch */
1055 
1056 typedef ACPI_STATUS (*ACPI_SLEEP_FUNCTION) (
1057     UINT8                   SleepState);
1058 
1059 typedef struct acpi_sleep_functions
1060 {
1061     ACPI_SLEEP_FUNCTION     LegacyFunction;
1062     ACPI_SLEEP_FUNCTION     ExtendedFunction;
1063 
1064 } ACPI_SLEEP_FUNCTIONS;
1065 
1066 
1067 /*
1068  * External ACPI object definition
1069  */
1070 
1071 /*
1072  * Note: Type == ACPI_TYPE_ANY (0) is used to indicate a NULL package
1073  * element or an unresolved named reference.
1074  */
1075 typedef union acpi_object
1076 {
1077     ACPI_OBJECT_TYPE                Type;   /* See definition of AcpiNsType for values */
1078     struct
1079     {
1080         ACPI_OBJECT_TYPE                Type;       /* ACPI_TYPE_INTEGER */
1081         UINT64                          Value;      /* The actual number */
1082     } Integer;
1083 
1084     struct
1085     {
1086         ACPI_OBJECT_TYPE                Type;       /* ACPI_TYPE_STRING */
1087         UINT32                          Length;     /* # of bytes in string, excluding trailing null */
1088         char                            *Pointer;   /* points to the string value */
1089     } String;
1090 
1091     struct
1092     {
1093         ACPI_OBJECT_TYPE                Type;       /* ACPI_TYPE_BUFFER */
1094         UINT32                          Length;     /* # of bytes in buffer */
1095         UINT8                           *Pointer;   /* points to the buffer */
1096     } Buffer;
1097 
1098     struct
1099     {
1100         ACPI_OBJECT_TYPE                Type;       /* ACPI_TYPE_PACKAGE */
1101         UINT32                          Count;      /* # of elements in package */
1102         union acpi_object               *Elements;  /* Pointer to an array of ACPI_OBJECTs */
1103     } Package;
1104 
1105     struct
1106     {
1107         ACPI_OBJECT_TYPE                Type;       /* ACPI_TYPE_LOCAL_REFERENCE */
1108         ACPI_OBJECT_TYPE                ActualType; /* Type associated with the Handle */
1109         ACPI_HANDLE                     Handle;     /* object reference */
1110     } Reference;
1111 
1112     struct
1113     {
1114         ACPI_OBJECT_TYPE                Type;       /* ACPI_TYPE_PROCESSOR */
1115         UINT32                          ProcId;
1116         ACPI_IO_ADDRESS                 PblkAddress;
1117         UINT32                          PblkLength;
1118     } Processor;
1119 
1120     struct
1121     {
1122         ACPI_OBJECT_TYPE                Type;       /* ACPI_TYPE_POWER */
1123         UINT32                          SystemLevel;
1124         UINT32                          ResourceOrder;
1125     } PowerResource;
1126 
1127 } ACPI_OBJECT;
1128 
1129 
1130 /*
1131  * List of objects, used as a parameter list for control method evaluation
1132  */
1133 typedef struct acpi_object_list
1134 {
1135     UINT32                          Count;
1136     ACPI_OBJECT                     *Pointer;
1137 
1138 } ACPI_OBJECT_LIST;
1139 
1140 
1141 /*
1142  * Miscellaneous common Data Structures used by the interfaces
1143  */
1144 #define ACPI_NO_BUFFER              0
1145 
1146 #ifdef ACPI_NO_MEM_ALLOCATIONS
1147 
1148 #define ACPI_ALLOCATE_BUFFER        (ACPI_SIZE) (0)
1149 #define ACPI_ALLOCATE_LOCAL_BUFFER  (ACPI_SIZE) (0)
1150 
1151 #else /* ACPI_NO_MEM_ALLOCATIONS */
1152 
1153 #define ACPI_ALLOCATE_BUFFER        (ACPI_SIZE) (-1)    /* Let ACPICA allocate buffer */
1154 #define ACPI_ALLOCATE_LOCAL_BUFFER  (ACPI_SIZE) (-2)    /* For internal use only (enables tracking) */
1155 
1156 #endif /* ACPI_NO_MEM_ALLOCATIONS */
1157 
1158 typedef struct acpi_buffer
1159 {
1160     ACPI_SIZE                       Length;         /* Length in bytes of the buffer */
1161     void                            *Pointer;       /* pointer to buffer */
1162 
1163 } ACPI_BUFFER;
1164 
1165 
1166 /*
1167  * NameType for AcpiGetName
1168  */
1169 #define ACPI_FULL_PATHNAME              0
1170 #define ACPI_SINGLE_NAME                1
1171 #define ACPI_FULL_PATHNAME_NO_TRAILING  2
1172 #define ACPI_NAME_TYPE_MAX              2
1173 
1174 
1175 /*
1176  * Predefined Namespace items
1177  */
1178 typedef struct acpi_predefined_names
1179 {
1180     const char                      *Name;
1181     UINT8                           Type;
1182     char                            *Val;
1183 
1184 } ACPI_PREDEFINED_NAMES;
1185 
1186 
1187 /*
1188  * Structure and flags for AcpiGetSystemInfo
1189  */
1190 #define ACPI_SYS_MODE_UNKNOWN           0x0000
1191 #define ACPI_SYS_MODE_ACPI              0x0001
1192 #define ACPI_SYS_MODE_LEGACY            0x0002
1193 #define ACPI_SYS_MODES_MASK             0x0003
1194 
1195 
1196 /*
1197  * System info returned by AcpiGetSystemInfo()
1198  */
1199 typedef struct acpi_system_info
1200 {
1201     UINT32                          AcpiCaVersion;
1202     UINT32                          Flags;
1203     UINT32                          TimerResolution;
1204     UINT32                          Reserved1;
1205     UINT32                          Reserved2;
1206     UINT32                          DebugLevel;
1207     UINT32                          DebugLayer;
1208 
1209 } ACPI_SYSTEM_INFO;
1210 
1211 
1212 /*
1213  * System statistics returned by AcpiGetStatistics()
1214  */
1215 typedef struct acpi_statistics
1216 {
1217     UINT32                          SciCount;
1218     UINT32                          GpeCount;
1219     UINT32                          FixedEventCount[ACPI_NUM_FIXED_EVENTS];
1220     UINT32                          MethodCount;
1221 
1222 } ACPI_STATISTICS;
1223 
1224 
1225 /*
1226  * Types specific to the OS service interfaces
1227  */
1228 typedef UINT32
1229 (ACPI_SYSTEM_XFACE *ACPI_OSD_HANDLER) (
1230     void                            *Context);
1231 
1232 typedef void
1233 (ACPI_SYSTEM_XFACE *ACPI_OSD_EXEC_CALLBACK) (
1234     void                            *Context);
1235 
1236 /*
1237  * Various handlers and callback procedures
1238  */
1239 typedef
1240 UINT32 (*ACPI_SCI_HANDLER) (
1241     void                            *Context);
1242 
1243 typedef
1244 void (*ACPI_GBL_EVENT_HANDLER) (
1245     UINT32                          EventType,
1246     ACPI_HANDLE                     Device,
1247     UINT32                          EventNumber,
1248     void                            *Context);
1249 
1250 #define ACPI_EVENT_TYPE_GPE         0
1251 #define ACPI_EVENT_TYPE_FIXED       1
1252 
1253 typedef
1254 UINT32 (*ACPI_EVENT_HANDLER) (
1255     void                            *Context);
1256 
1257 typedef
1258 UINT32 (*ACPI_GPE_HANDLER) (
1259     ACPI_HANDLE                     GpeDevice,
1260     UINT32                          GpeNumber,
1261     void                            *Context);
1262 
1263 typedef
1264 void (*ACPI_NOTIFY_HANDLER) (
1265     ACPI_HANDLE                     Device,
1266     UINT32                          Value,
1267     void                            *Context);
1268 
1269 typedef
1270 void (*ACPI_OBJECT_HANDLER) (
1271     ACPI_HANDLE                     Object,
1272     void                            *Data);
1273 
1274 typedef
1275 ACPI_STATUS (*ACPI_INIT_HANDLER) (
1276     ACPI_HANDLE                     Object,
1277     UINT32                          Function);
1278 
1279 #define ACPI_INIT_DEVICE_INI        1
1280 
1281 typedef
1282 ACPI_STATUS (*ACPI_EXCEPTION_HANDLER) (
1283     ACPI_STATUS                     AmlStatus,
1284     ACPI_NAME                       Name,
1285     UINT16                          Opcode,
1286     UINT32                          AmlOffset,
1287     void                            *Context);
1288 
1289 /* Table Event handler (Load, LoadTable, etc.) and types */
1290 
1291 typedef
1292 ACPI_STATUS (*ACPI_TABLE_HANDLER) (
1293     UINT32                          Event,
1294     void                            *Table,
1295     void                            *Context);
1296 
1297 
1298 /* Table Event Types */
1299 
1300 #define ACPI_TABLE_EVENT_LOAD           0x0
1301 #define ACPI_TABLE_EVENT_UNLOAD         0x1
1302 #define ACPI_TABLE_EVENT_INSTALL        0x2
1303 #define ACPI_TABLE_EVENT_UNINSTALL      0x3
1304 #define ACPI_NUM_TABLE_EVENTS           4
1305 
1306 
1307 /* Address Spaces (For Operation Regions) */
1308 
1309 typedef
1310 ACPI_STATUS (*ACPI_ADR_SPACE_HANDLER) (
1311     UINT32                          Function,
1312     ACPI_PHYSICAL_ADDRESS           Address,
1313     UINT32                          BitWidth,
1314     UINT64                          *Value,
1315     void                            *HandlerContext,
1316     void                            *RegionContext);
1317 
1318 #define ACPI_DEFAULT_HANDLER            NULL
1319 
1320 /* Special Context data for GenericSerialBus/GeneralPurposeIo (ACPI 5.0) */
1321 
1322 typedef struct acpi_connection_info
1323 {
1324     UINT8                           *Connection;
1325     UINT16                          Length;
1326     UINT8                           AccessLength;
1327 
1328 } ACPI_CONNECTION_INFO;
1329 
1330 /* Special Context data for PCC Opregion (ACPI 6.3) */
1331 
1332 typedef struct acpi_pcc_info {
1333     UINT8                           SubspaceId;
1334     UINT16                          Length;
1335     UINT8                           *InternalBuffer;
1336 } ACPI_PCC_INFO;
1337 
1338 /* Special Context data for FFH Opregion (ACPI 6.5) */
1339 
1340 typedef struct acpi_ffh_info {
1341     UINT64                          Offset;
1342     UINT64                          Length;
1343 } ACPI_FFH_INFO;
1344 
1345 typedef
1346 ACPI_STATUS (*ACPI_ADR_SPACE_SETUP) (
1347     ACPI_HANDLE                     RegionHandle,
1348     UINT32                          Function,
1349     void                            *HandlerContext,
1350     void                            **RegionContext);
1351 
1352 #define ACPI_REGION_ACTIVATE    0
1353 #define ACPI_REGION_DEACTIVATE  1
1354 
1355 typedef
1356 ACPI_STATUS (*ACPI_WALK_CALLBACK) (
1357     ACPI_HANDLE                     Object,
1358     UINT32                          NestingLevel,
1359     void                            *Context,
1360     void                            **ReturnValue);
1361 
1362 typedef
1363 UINT32 (*ACPI_INTERFACE_HANDLER) (
1364     ACPI_STRING                     InterfaceName,
1365     UINT32                          Supported);
1366 
1367 
1368 /* Interrupt handler return values */
1369 
1370 #define ACPI_INTERRUPT_NOT_HANDLED      0x00
1371 #define ACPI_INTERRUPT_HANDLED          0x01
1372 
1373 /* GPE handler return values */
1374 
1375 #define ACPI_REENABLE_GPE               0x80
1376 
1377 
1378 /* Length of 32-bit EISAID values when converted back to a string */
1379 
1380 #define ACPI_EISAID_STRING_SIZE         8   /* Includes null terminator */
1381 
1382 /* Length of UUID (string) values */
1383 
1384 #define ACPI_UUID_LENGTH                16
1385 
1386 /* Length of 3-byte PCI class code values when converted back to a string */
1387 
1388 #define ACPI_PCICLS_STRING_SIZE         7   /* Includes null terminator */
1389 
1390 
1391 /* Structures used for device/processor HID, UID, CID */
1392 
1393 typedef struct acpi_pnp_device_id
1394 {
1395     UINT32                          Length;             /* Length of string + null */
1396     char                            *String;
1397 
1398 } ACPI_PNP_DEVICE_ID;
1399 
1400 typedef struct acpi_pnp_device_id_list
1401 {
1402     UINT32                          Count;              /* Number of IDs in Ids array */
1403     UINT32                          ListSize;           /* Size of list, including ID strings */
1404     ACPI_PNP_DEVICE_ID              Ids[];              /* ID array */
1405 
1406 } ACPI_PNP_DEVICE_ID_LIST;
1407 
1408 /*
1409  * Structure returned from AcpiGetObjectInfo.
1410  * Optimized for both 32-bit and 64-bit builds.
1411  */
1412 typedef struct acpi_device_info
1413 {
1414     UINT32                          InfoSize;           /* Size of info, including ID strings */
1415     UINT32                          Name;               /* ACPI object Name */
1416     ACPI_OBJECT_TYPE                Type;               /* ACPI object Type */
1417     UINT8                           ParamCount;         /* If a method, required parameter count */
1418     UINT16                          Valid;              /* Indicates which optional fields are valid */
1419     UINT8                           Flags;              /* Miscellaneous info */
1420     UINT8                           HighestDstates[4];  /* _SxD values: 0xFF indicates not valid */
1421     UINT8                           LowestDstates[5];   /* _SxW values: 0xFF indicates not valid */
1422     UINT64                          Address;            /* _ADR value */
1423     ACPI_PNP_DEVICE_ID              HardwareId;         /* _HID value */
1424     ACPI_PNP_DEVICE_ID              UniqueId;           /* _UID value */
1425     ACPI_PNP_DEVICE_ID              ClassCode;          /* _CLS value */
1426     ACPI_PNP_DEVICE_ID_LIST         CompatibleIdList;   /* _CID list <must be last> */
1427 
1428 } ACPI_DEVICE_INFO;
1429 
1430 /* Values for Flags field above (AcpiGetObjectInfo) */
1431 
1432 #define ACPI_PCI_ROOT_BRIDGE            0x01
1433 
1434 /* Flags for Valid field above (AcpiGetObjectInfo) */
1435 
1436 #define ACPI_VALID_ADR                  0x0002
1437 #define ACPI_VALID_HID                  0x0004
1438 #define ACPI_VALID_UID                  0x0008
1439 #define ACPI_VALID_CID                  0x0020
1440 #define ACPI_VALID_CLS                  0x0040
1441 #define ACPI_VALID_SXDS                 0x0100
1442 #define ACPI_VALID_SXWS                 0x0200
1443 
1444 /* Flags for _STA method */
1445 
1446 #define ACPI_STA_DEVICE_PRESENT         0x01
1447 #define ACPI_STA_DEVICE_ENABLED         0x02
1448 #define ACPI_STA_DEVICE_UI              0x04
1449 #define ACPI_STA_DEVICE_FUNCTIONING     0x08
1450 #define ACPI_STA_DEVICE_OK              0x08 /* Synonym */
1451 #define ACPI_STA_BATTERY_PRESENT        0x10
1452 
1453 
1454 /* Context structs for address space handlers */
1455 
1456 typedef struct acpi_pci_id
1457 {
1458     UINT16                          Segment;
1459     UINT16                          Bus;
1460     UINT16                          Device;
1461     UINT16                          Function;
1462 
1463 } ACPI_PCI_ID;
1464 
1465 typedef struct acpi_mem_mapping
1466 {
1467     ACPI_PHYSICAL_ADDRESS           PhysicalAddress;
1468     UINT8                           *LogicalAddress;
1469     ACPI_SIZE                       Length;
1470     struct acpi_mem_mapping         *NextMm;
1471 
1472 } ACPI_MEM_MAPPING;
1473 
1474 typedef struct acpi_mem_space_context
1475 {
1476     UINT32                          Length;
1477     ACPI_PHYSICAL_ADDRESS           Address;
1478     ACPI_MEM_MAPPING                *CurMm;
1479     ACPI_MEM_MAPPING                *FirstMm;
1480 
1481 } ACPI_MEM_SPACE_CONTEXT;
1482 
1483 typedef struct acpi_data_table_mapping
1484 {
1485     void                            *Pointer;
1486 
1487 } ACPI_DATA_TABLE_MAPPING;
1488 
1489 
1490 /*
1491  * ACPI_MEMORY_LIST is used only if the ACPICA local cache is enabled
1492  */
1493 typedef struct acpi_memory_list
1494 {
1495     const char                      *ListName;
1496     void                            *ListHead;
1497     UINT16                          ObjectSize;
1498     UINT16                          MaxDepth;
1499     UINT16                          CurrentDepth;
1500 
1501 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
1502 
1503     /* Statistics for debug memory tracking only */
1504 
1505     UINT32                          TotalAllocated;
1506     UINT32                          TotalFreed;
1507     UINT32                          MaxOccupied;
1508     UINT32                          TotalSize;
1509     UINT32                          CurrentTotalSize;
1510     UINT32                          Requests;
1511     UINT32                          Hits;
1512 #endif
1513 
1514 } ACPI_MEMORY_LIST;
1515 
1516 
1517 /* Definitions of trace event types */
1518 
1519 typedef enum
1520 {
1521     ACPI_TRACE_AML_METHOD,
1522     ACPI_TRACE_AML_OPCODE,
1523     ACPI_TRACE_AML_REGION
1524 
1525 } ACPI_TRACE_EVENT_TYPE;
1526 
1527 
1528 /* Definitions of _OSI support */
1529 
1530 #define ACPI_VENDOR_STRINGS                 0x01
1531 #define ACPI_FEATURE_STRINGS                0x02
1532 #define ACPI_ENABLE_INTERFACES              0x00
1533 #define ACPI_DISABLE_INTERFACES             0x04
1534 
1535 #define ACPI_DISABLE_ALL_VENDOR_STRINGS     (ACPI_DISABLE_INTERFACES | ACPI_VENDOR_STRINGS)
1536 #define ACPI_DISABLE_ALL_FEATURE_STRINGS    (ACPI_DISABLE_INTERFACES | ACPI_FEATURE_STRINGS)
1537 #define ACPI_DISABLE_ALL_STRINGS            (ACPI_DISABLE_INTERFACES | ACPI_VENDOR_STRINGS | ACPI_FEATURE_STRINGS)
1538 #define ACPI_ENABLE_ALL_VENDOR_STRINGS      (ACPI_ENABLE_INTERFACES | ACPI_VENDOR_STRINGS)
1539 #define ACPI_ENABLE_ALL_FEATURE_STRINGS     (ACPI_ENABLE_INTERFACES | ACPI_FEATURE_STRINGS)
1540 #define ACPI_ENABLE_ALL_STRINGS             (ACPI_ENABLE_INTERFACES | ACPI_VENDOR_STRINGS | ACPI_FEATURE_STRINGS)
1541 
1542 #define ACPI_OSI_WIN_2000               0x01
1543 #define ACPI_OSI_WIN_XP                 0x02
1544 #define ACPI_OSI_WIN_XP_SP1             0x03
1545 #define ACPI_OSI_WINSRV_2003            0x04
1546 #define ACPI_OSI_WIN_XP_SP2             0x05
1547 #define ACPI_OSI_WINSRV_2003_SP1        0x06
1548 #define ACPI_OSI_WIN_VISTA              0x07
1549 #define ACPI_OSI_WINSRV_2008            0x08
1550 #define ACPI_OSI_WIN_VISTA_SP1          0x09
1551 #define ACPI_OSI_WIN_VISTA_SP2          0x0A
1552 #define ACPI_OSI_WIN_7                  0x0B
1553 #define ACPI_OSI_WIN_8                  0x0C
1554 #define ACPI_OSI_WIN_8_1                0x0D
1555 #define ACPI_OSI_WIN_10                 0x0E
1556 #define ACPI_OSI_WIN_10_RS1             0x0F
1557 #define ACPI_OSI_WIN_10_RS2             0x10
1558 #define ACPI_OSI_WIN_10_RS3             0x11
1559 #define ACPI_OSI_WIN_10_RS4             0x12
1560 #define ACPI_OSI_WIN_10_RS5             0x13
1561 #define ACPI_OSI_WIN_10_19H1            0x14
1562 #define ACPI_OSI_WIN_10_20H1            0x15
1563 #define ACPI_OSI_WIN_11                 0x16
1564 #define ACPI_OSI_WIN_11_22H2            0x17
1565 
1566 
1567 /* Definitions of getopt */
1568 
1569 #define ACPI_OPT_END                    -1
1570 
1571 /* Definitions for explicit fallthrough */
1572 
1573 #ifndef ACPI_FALLTHROUGH
1574 #define ACPI_FALLTHROUGH do {} while(0)
1575 #endif
1576 
1577 #ifndef ACPI_FLEX_ARRAY
1578 #define ACPI_FLEX_ARRAY(TYPE, NAME)     TYPE NAME[0]
1579 #endif
1580 
1581 #endif /* __ACTYPES_H__ */