📄 actypes.h
字号:
/****************************************************************************** * * Name: actypes.h - Common data types for the entire ACPI subsystem * $Revision: 1.321 $ * *****************************************************************************//****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2008, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * *****************************************************************************/#ifndef __ACTYPES_H__#define __ACTYPES_H__/* acpisrc:StructDefs -- for acpisrc conversion *//* * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent header * and must be either 32 or 64. 16-bit ACPICA is no longer supported, as of * 12/2006. */#ifndef ACPI_MACHINE_WIDTH#error ACPI_MACHINE_WIDTH not defined#endif/*! [Begin] no source code translation *//* * Data type ranges * Note: These macros are designed to be compiler independent as well as * working around problems that some 32-bit compilers have with 64-bit * constants. */#define ACPI_UINT8_MAX (UINT8) (~((UINT8) 0)) /* 0xFF */#define ACPI_UINT16_MAX (UINT16)(~((UINT16) 0)) /* 0xFFFF */#define ACPI_UINT32_MAX (UINT32)(~((UINT32) 0)) /* 0xFFFFFFFF */#define ACPI_UINT64_MAX (UINT64)(~((UINT64) 0)) /* 0xFFFFFFFFFFFFFFFF */#define ACPI_ASCII_MAX 0x7F/* * Architecture-specific ACPICA Subsystem Data Types * * The goal of these types is to provide source code portability across * 16-bit, 32-bit, and 64-bit targets. * * 1) The following types are of fixed size for all targets (16/32/64): * * BOOLEAN Logical boolean * * UINT8 8-bit (1 byte) unsigned value * UINT16 16-bit (2 byte) unsigned value * UINT32 32-bit (4 byte) unsigned value * UINT64 64-bit (8 byte) unsigned value * * INT16 16-bit (2 byte) signed value * INT32 32-bit (4 byte) signed value * INT64 64-bit (8 byte) signed value * * COMPILER_DEPENDENT_UINT64/INT64 - These types are defined in the * compiler-dependent header(s) and were introduced because there is no common * 64-bit integer type across the various compilation models, as shown in * the table below. * * Datatype LP64 ILP64 LLP64 ILP32 LP32 16bit * char 8 8 8 8 8 8 * short 16 16 16 16 16 16 * _int32 32 * int 32 64 32 32 16 16 * long 64 64 32 32 32 32 * long long 64 64 * pointer 64 64 64 32 32 32 * * Note: ILP64 and LP32 are currently not supported. * * * 2) These types represent the native word size of the target mode of the * processor, and may be 16-bit, 32-bit, or 64-bit as required. They are * usually used for memory allocation, efficient loop counters, and array * indexes. The types are similar to the size_t type in the C library and are * required because there is no C type that consistently represents the native * data width. * * ACPI_SIZE 16/32/64-bit unsigned value * ACPI_NATIVE_UINT 16/32/64-bit unsigned value * ACPI_NATIVE_INT 16/32/64-bit signed value * *//******************************************************************************* * * Common types for all compilers, all targets * ******************************************************************************/typedef unsigned char BOOLEAN;typedef unsigned char UINT8;typedef unsigned short UINT16;typedef COMPILER_DEPENDENT_UINT64 UINT64;typedef COMPILER_DEPENDENT_INT64 INT64;/*! [End] no source code translation !*//******************************************************************************* * * Types specific to 64-bit targets * ******************************************************************************/#if ACPI_MACHINE_WIDTH == 64/*! [Begin] no source code translation (keep the typedefs as-is) */typedef unsigned int UINT32;typedef int INT32;/*! [End] no source code translation !*/typedef UINT64 ACPI_NATIVE_UINT;typedef INT64 ACPI_NATIVE_INT;typedef UINT64 ACPI_IO_ADDRESS;typedef UINT64 ACPI_PHYSICAL_ADDRESS;#define ACPI_MAX_PTR ACPI_UINT64_MAX#define ACPI_SIZE_MAX ACPI_UINT64_MAX#define ACPI_USE_NATIVE_DIVIDE /* Has native 64-bit integer support *//* * In the case of the Itanium Processor Family (IPF), the hardware does not * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED flag * to indicate that special precautions must be taken to avoid alignment faults. * (IA64 or ia64 is currently used by existing compilers to indicate IPF.) * * Note: EM64T and other X86-64 processors support misaligned transfers, * so there is no need to define this flag. */#if defined (__IA64__) || defined (__ia64__)#define ACPI_MISALIGNMENT_NOT_SUPPORTED#endif/******************************************************************************* * * Types specific to 32-bit targets * ******************************************************************************/#elif ACPI_MACHINE_WIDTH == 32/*! [Begin] no source code translation (keep the typedefs as-is) */typedef unsigned int UINT32;typedef int INT32;/*! [End] no source code translation !*/typedef UINT32 ACPI_NATIVE_UINT;typedef INT32 ACPI_NATIVE_INT;typedef UINT32 ACPI_IO_ADDRESS;typedef UINT32 ACPI_PHYSICAL_ADDRESS;#define ACPI_MAX_PTR ACPI_UINT32_MAX#define ACPI_SIZE_MAX ACPI_UINT32_MAX#else/* ACPI_MACHINE_WIDTH must be either 64 or 32 */#error unknown ACPI_MACHINE_WIDTH#endif/* Variable-width type, used instead of clib size_t */typedef ACPI_NATIVE_UINT ACPI_SIZE;/******************************************************************************* * * OS-dependent and compiler-dependent types * * If the defaults below are not appropriate for the host system, they can * be defined in the compiler-specific or OS-specific header, and this will * take precedence. * ******************************************************************************//* Value returned by AcpiOsGetThreadId */#ifndef ACPI_THREAD_ID#define ACPI_THREAD_ID ACPI_NATIVE_UINT#endif/* Object returned from AcpiOsCreateLock */#ifndef ACPI_SPINLOCK#define ACPI_SPINLOCK void *#endif/* Flags for AcpiOsAcquireLock/AcpiOsReleaseLock */#ifndef ACPI_CPU_FLAGS#define ACPI_CPU_FLAGS ACPI_NATIVE_UINT#endif/* Object returned from AcpiOsCreateCache */#ifndef ACPI_CACHE_T#define ACPI_CACHE_T ACPI_MEMORY_LIST#endif/* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */#ifndef ACPI_UINTPTR_T#define ACPI_UINTPTR_T void *#endif/* * ACPI_PRINTF_LIKE is used to tag functions as "printf-like" because * some compilers can catch printf format string problems */#ifndef ACPI_PRINTF_LIKE#define ACPI_PRINTF_LIKE(c)#endif/* * Some compilers complain about unused variables. Sometimes we don't want to * use all the variables (for example, _AcpiModuleName). This allows us * to to tell the compiler in a per-variable manner that a variable * is unused */#ifndef ACPI_UNUSED_VAR#define ACPI_UNUSED_VAR#endif/* * All ACPICA functions that are available to the rest of the kernel are * tagged with this macro which can be defined as appropriate for the host. */#ifndef ACPI_EXPORT_SYMBOL#define ACPI_EXPORT_SYMBOL(Symbol)#endif/******************************************************************************* * * Independent types * ******************************************************************************//* Logical defines and NULL */#ifdef FALSE#undef FALSE#endif#define FALSE (1 == 0)#ifdef TRUE#undef TRUE#endif#define TRUE (1 == 1)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -