/******************************************************************************
*
* Name: actypes.h - Common data types for the entire ACPI subsystem
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2016, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#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
#endif
/*
* 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.
*/
/*
* 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 is needed because there is no guarantee that a
* kernel-level C library is present.
*
* ACPI_SIZE 16/32/64-bit unsigned value
* ACPI_NATIVE_INT 16/32/64-bit signed value
*/
/*******************************************************************************
*
* Common types for all compilers, all targets
*
******************************************************************************/
#ifndef ACPI_USE_SYSTEM_INTTYPES
typedef unsigned char BOOLEAN;
typedef unsigned char UINT8;
typedef unsigned short UINT16;
typedef short INT16;
#endif /* ACPI_USE_SYSTEM_INTTYPES */
/*
* Value returned by AcpiOsGetThreadId. There is no standard "thread_id"
* across operating systems or even the various UNIX systems. Since ACPICA
* only needs the thread ID as a unique thread identifier, we use a UINT64
* as the only common data type - it will accommodate any type of pointer or
* any type of integer. It is up to the host-dependent OSL to cast the
* native thread ID type to a UINT64 (in AcpiOsGetThreadId).
*/
/*******************************************************************************
*
* Types specific to 64-bit targets
*
******************************************************************************/
#if ACPI_MACHINE_WIDTH == 64
#ifndef ACPI_USE_SYSTEM_INTTYPES
typedef unsigned int UINT32;
typedef int INT32;
#endif /* ACPI_USE_SYSTEM_INTTYPES */
/*
* 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.
*/
#define ACPI_MISALIGNMENT_NOT_SUPPORTED
#endif
/*******************************************************************************
*
* Types specific to 32-bit targets
*
******************************************************************************/
#ifndef ACPI_USE_SYSTEM_INTTYPES
typedef unsigned int UINT32;
typedef int INT32;
#endif /* ACPI_USE_SYSTEM_INTTYPES */
#ifdef ACPI_32BIT_PHYSICAL_ADDRESS
/*
* OSPMs can define this to shrink the size of the structures for 32-bit
* none PAE environment. ASL compiler may always define this to generate
* 32-bit OSPM compliant tables.
*/
#else /* ACPI_32BIT_PHYSICAL_ADDRESS */
/*
* It is reported that, after some calculations, the physical addresses can
* wrap over the 32-bit boundary on 32-bit PAE environment.
*/
#endif /* ACPI_32BIT_PHYSICAL_ADDRESS */
#else
/* ACPI_MACHINE_WIDTH must be either 64 or 32 */
#endif
/*******************************************************************************
*
* OS-dependent types
*
* If the defaults below are not appropriate for the host system, they can
* be defined in the OS-specific header, and this will take precedence.
*
******************************************************************************/
/* Flags for AcpiOsAcquireLock/AcpiOsReleaseLock */
#ifndef ACPI_CPU_FLAGS
#endif
/* Object returned from AcpiOsCreateCache */
#ifndef ACPI_CACHE_T
#ifdef ACPI_USE_LOCAL_CACHE
#else
#define ACPI_CACHE_T void *
#endif
#endif
/*
* Synchronization objects - Mutexes, Semaphores, and SpinLocks
*/
#if (ACPI_MUTEX_TYPE == ACPI_BINARY_SEMAPHORE)
/*
* These macros are used if the host OS does not support a mutex object.
* Map the OSL Mutex interfaces to binary semaphores.
*/
#endif
/* Configurable types for synchronization objects */
#ifndef ACPI_SPINLOCK
#define ACPI_SPINLOCK void *
#endif
#ifndef ACPI_SEMAPHORE
#define ACPI_SEMAPHORE void *
#endif
#ifndef ACPI_MUTEX
#define ACPI_MUTEX void *
#endif
/*******************************************************************************
*
* Compiler-dependent types
*
* If the defaults below are not appropriate for the host compiler, they can
* be defined in the compiler-specific header, and this will take precedence.
*
******************************************************************************/
/* 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 tell the compiler in a per-variable manner that a variable
* is unused
*/
#ifndef ACPI_UNUSED_VAR
#define ACPI_UNUSED_VAR
#endif
/*
* All ACPICA external functions that are available to the rest of the kernel
* are tagged with thes macros which can be defined as appropriate for the host.
*
* Notes:
* ACPI_EXPORT_SYMBOL_INIT is used for initialization and termination
* interfaces that may need special processing.
* ACPI_EXPORT_SYMBOL is used for all other public external functions.
*/
#ifndef ACPI_EXPORT_SYMBOL_INIT
#endif
#ifndef ACPI_EXPORT_SYMBOL
#endif
/*
* Compiler/Clibrary-dependent debug initialization. Used for ACPICA
* utilities only.
*/
#ifndef ACPI_DEBUG_INITIALIZE
#define ACPI_DEBUG_INITIALIZE()
#endif
/*******************************************************************************
*
* Configuration
*
******************************************************************************/
#ifdef ACPI_NO_MEM_ALLOCATIONS
#define ACPI_FREE(a)
#define ACPI_MEM_TRACKING(a)
#else /* ACPI_NO_MEM_ALLOCATIONS */
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
/*
* Memory allocation tracking (used by AcpiExec to detect memory leaks)
*/
#define ACPI_MEM_TRACKING(a) a
#else
/*
* Normal memory allocation directly via the OS services layer
*/
#define ACPI_MEM_TRACKING(a)
#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
#endif /* ACPI_NO_MEM_ALLOCATIONS */
/******************************************************************************
*
* ACPI Specification constants (Do not change unless the specification changes)
*
*****************************************************************************/
/* Number of distinct FADT-based GPE register blocks (GPE0 and GPE1) */
/* Default ACPI register widths */
/* Names within the namespace are 4 bytes long */
/* Sizes for ACPI table headers */
/* PM Timer ticks per second (HZ) */
/*******************************************************************************
*
* Independent types
*
******************************************************************************/
/* Logical defines and NULL */
#ifdef FALSE
#endif
#ifdef TRUE
#endif
#ifndef NULL
#define NULL (void *) 0
#endif
/*
* Miscellaneous types
*/
/* Time constants for timer calculations */
/* Owner IDs are used to track namespace nodes for selective deletion */
/*
* Constants with special meanings
*/
#define ACPI_DO_NOT_WAIT 0
/*
* Obsolete: Acpi integer width. In ACPI version 1 (1996), integers are 32 bits.
* In ACPI version 2 (2000) and later, integers are 64 bits. Note that this
* pertains to the ACPI integer type only, not to other integers used in the
* implementation of the ACPICA subsystem.
*
* 01/2010: This type is obsolete and has been removed from the entire ACPICA
* code base. It remains here for compatibility with device drivers that use
* the type. However, it will be removed in the future.
*/
/*******************************************************************************
*
* Commonly used macros
*
******************************************************************************/
/* Data manipulation */
#define ACPI_MIN(a,b) (((a)<(b))?(a):(b))
#define ACPI_MAX(a,b) (((a)>(b))?(a):(b))
/* Size calculation */
#define ACPI_ARRAY_LENGTH(x) (sizeof(x) / sizeof((x)[0]))
/* Pointer manipulation */
/* Optimizations for 4-character (32-bit) ACPI_NAME manipulation */
#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
#else
#define ACPI_COMPARE_NAME(a,b) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE))
#define ACPI_MOVE_NAME(dest,src) (strncpy (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE))
#endif
/* Support for the special RSDP signature (8 characters) */
/*******************************************************************************
*
* Miscellaneous constants
*
******************************************************************************/
/*
* Initialization sequence
*/
/*
* Initialization state
*/
/*
* Power state values
*/
/*
* Sleep type invalid value
*/
/*
* Standard notify values
*/
/*
* Types associated with ACPI names and objects. The first group of
* values (up to ACPI_TYPE_EXTERNAL_MAX) correspond to the definition
* of the ACPI ObjectType() operator (See the ACPI Spec). Therefore,
* only add to the first group if the spec changes.
*
* NOTE: Types must be kept in sync with the global AcpiNsProperties
* and AcpiNsTypeNames arrays.
*/
/*
* These are object types that do not map directly to the ACPI
* ObjectType() operator. They are used for various internal purposes only.
* If new predefined ACPI_TYPEs are added (via the ACPI specification), these
* internal types must move upwards. (There is code that depends on these
* values being contiguous with the external types above.)
*/
/*
* These are special object types that never appear in
* a Namespace node, only in an object of ACPI_OPERAND_OBJECT
*/
/* All types above here are invalid */
/*
* All I/O
*/
#define ACPI_READ 0
/*
* Event Types: Fixed & General Purpose
*/
/*
* Fixed events
*/
#define ACPI_EVENT_PMTIMER 0
/*
* Event Status - Per event
* -------------
* The encoding of ACPI_EVENT_STATUS is illustrated below.
* Note that a set bit (1) indicates the property is TRUE
* (e.g. if bit 0 is set then the event is enabled).
* +-------------+-+-+-+-+-+
* | Bits 31:5 |4|3|2|1|0|
* +-------------+-+-+-+-+-+
* | | | | | |
* | | | | | +- Enabled?
* | | | | +--- Enabled for wake?
* | | | +----- Status bit set?
* | | +------- Enable bit set?
* | +--------- Has a handler?
* +--------------- <Reserved>
*/
/* Actions for AcpiSetGpe, AcpiGpeWakeup, AcpiHwLowSetGpe */
#define ACPI_GPE_ENABLE 0
/*
* GPE info flags - Per GPE
* +-------+-+-+---+
* | 7:5 |4|3|2:0|
* +-------+-+-+---+
* | | | |
* | | | +-- Type of dispatch:to method, handler, notify, or none
* | | +----- Interrupt type: edge or level triggered
* | +------- Is a Wake GPE
* +------------ <Reserved>
*/
/*
* Flags for GPE and Lock interfaces
*/
/* Notify types */
/* Address Space (Operation Region) Types */
/*
* Special Address Spaces
*
* Note: A Data Table region is a special type of operation region
* that has its own AML opcode. However, internally, the AML
* interpreter simply creates an operation region with an an address
* space type of ACPI_ADR_SPACE_DATA_TABLE.
*/
/* Values for _REG connection code */
#define ACPI_REG_DISCONNECT 0
/*
* BitRegister IDs
*
* These values are intended to be used by the hardware interfaces
* and are mapped to individual bitfields defined within the ACPI
* registers. See the AcpiGbl_BitRegisterInfo global table in utglobal.c
* for this mapping.
*/
/* PM1 Status register */
/* PM1 Enable register */
/* PM1 Control register */
/* PM2 Control register */
/* Status register values. A 1 clears a status bit. 0 = no effect */
/* Enable and Control register values */
#define ACPI_DISABLE_EVENT 0
/* Sleep function dispatch */
typedef struct acpi_sleep_functions
{
/*
* External ACPI object definition
*/
/*
* Note: Type == ACPI_TYPE_ANY (0) is used to indicate a NULL package element
* or an unresolved named reference.
*/
typedef union acpi_object
{
struct
{
} Integer;
struct
{
} String;
struct
{
} Buffer;
struct
{
} Package;
struct
{
} Reference;
struct
{
} Processor;
struct
{
} ACPI_OBJECT;
/*
* List of objects, used as a parameter list for control method evaluation
*/
typedef struct acpi_object_list
{
/*
* Miscellaneous common Data Structures used by the interfaces
*/
#define ACPI_NO_BUFFER 0
#ifdef ACPI_NO_MEM_ALLOCATIONS
#else /* ACPI_NO_MEM_ALLOCATIONS */
#endif /* ACPI_NO_MEM_ALLOCATIONS */
typedef struct acpi_buffer
{
} ACPI_BUFFER;
/*
* NameType for AcpiGetName
*/
#define ACPI_FULL_PATHNAME 0
/*
* Predefined Namespace items
*/
typedef struct acpi_predefined_names
{
const char *Name;
char *Val;
/*
* Structure and flags for AcpiGetSystemInfo
*/
/*
* System info returned by AcpiGetSystemInfo()
*/
typedef struct acpi_system_info
{
/*
* System statistics returned by AcpiGetStatistics()
*/
typedef struct acpi_statistics
{
/* Table Event Types */
/*
* Types specific to the OS service interfaces
*/
typedef UINT32
void *Context);
typedef void
void *Context);
/*
* Various handlers and callback procedures
*/
typedef
void *Context);
typedef
void (*ACPI_GBL_EVENT_HANDLER) (
void *Context);
#define ACPI_EVENT_TYPE_GPE 0
typedef
void *Context);
typedef
void *Context);
typedef
void (*ACPI_NOTIFY_HANDLER) (
void *Context);
typedef
void (*ACPI_OBJECT_HANDLER) (
void *Data);
typedef
typedef
void *Context);
/* Table Event handler (Load, LoadTable, etc.) and types */
typedef
void *Table,
void *Context);
/* Address Spaces (For Operation Regions) */
typedef
void *HandlerContext,
void *RegionContext);
/* Special Context data for GenericSerialBus/GeneralPurposeIo (ACPI 5.0) */
typedef struct acpi_connection_info
{
typedef
void *HandlerContext,
void **RegionContext);
#define ACPI_REGION_ACTIVATE 0
typedef
void *Context,
void **ReturnValue);
typedef
/* Interrupt handler return values */
/* GPE handler return values */
/* Length of 32-bit EISAID values when converted back to a string */
/* Length of UUID (string) values */
/* Length of 3-byte PCI class code values when converted back to a string */
typedef struct acpi_pnp_device_id
{
char *String;
typedef struct acpi_pnp_device_id_list
{
/*
* Structure returned from AcpiGetObjectInfo.
* Optimized for both 32- and 64-bit builds
*/
typedef struct acpi_device_info
{
/* Values for Flags field above (AcpiGetObjectInfo) */
/* Flags for Valid field above (AcpiGetObjectInfo) */
/* Flags for _STA method */
/* Context structs for address space handlers */
typedef struct acpi_pci_id
{
} ACPI_PCI_ID;
typedef struct acpi_mem_space_context
{
/*
* ACPI_MEMORY_LIST is used only if the ACPICA local cache is enabled
*/
typedef struct acpi_memory_list
{
const char *ListName;
void *ListHead;
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
/* Statistics for debug memory tracking only */
#endif
/* Definitions of trace event types */
typedef enum
{
/* Definitions of _OSI support */
#define ACPI_DISABLE_ALL_STRINGS (ACPI_DISABLE_INTERFACES | ACPI_VENDOR_STRINGS | ACPI_FEATURE_STRINGS)
#define ACPI_ENABLE_ALL_STRINGS (ACPI_ENABLE_INTERFACES | ACPI_VENDOR_STRINGS | ACPI_FEATURE_STRINGS)
/* Definitions of file IO */
/* Definitions of getopt */
#endif /* __ACTYPES_H__ */