actbl.h revision 26f3cdf03f1adcc98f6d3d99843ee71e9229a8c0
/******************************************************************************
*
* Name: actbl.h - Basic ACPI Table Definitions
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2011, 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 __ACTBL_H__
#define __ACTBL_H__
/*******************************************************************************
*
* Fundamental ACPI tables
*
* This file contains definitions for the ACPI tables that are directly consumed
* by ACPICA. All other tables are consumed by the OS-dependent ACPI-related
* device drivers and other OS support code.
*
* The RSDP and FACS do not use the common ACPI table header. All other ACPI
* tables use the header.
*
******************************************************************************/
/*
* Values for description table header signatures for tables defined in this
* file. Useful because they make it more difficult to inadvertently type in
* the wrong signature.
*/
/*
* All tables and structures must be byte-packed to match the ACPI
* specification, since the tables are provided by the system BIOS
*/
#pragma pack(1)
/*
* Note about bitfields: The UINT8 type is used for bitfields in ACPI tables.
* This is the only type that is even remotely portable. Anything else is not
* portable, so do not use any other bitfield types.
*/
/*******************************************************************************
*
* Master ACPI Table Header. This common header is used by all ACPI tables
* except the RSDP and FACS.
*
******************************************************************************/
typedef struct acpi_table_header
{
/*******************************************************************************
*
* GAS - Generic Address Structure (ACPI 2.0+)
*
* Note: Since this structure is used in the ACPI tables, it is byte aligned.
* If misaliged access is not supported by the hardware, accesses to the
* 64-bit Address field must be performed with care.
*
******************************************************************************/
typedef struct acpi_generic_address
{
/*******************************************************************************
*
* RSDP - Root System Description Pointer (Signature is "RSD PTR ")
* Version 2
*
******************************************************************************/
typedef struct acpi_table_rsdp
{
/* Standalone struct for the ACPI 1.0 RSDP */
typedef struct acpi_rsdp_common
{
char Signature[8];
char OemId[ACPI_OEM_ID_SIZE];
/* Standalone struct for the extended part of the RSDP (ACPI 2.0+) */
typedef struct acpi_rsdp_extension
{
/*******************************************************************************
*
* Version 1 (both)
*
******************************************************************************/
typedef struct acpi_table_rsdt
{
typedef struct acpi_table_xsdt
{
/*******************************************************************************
*
* FACS - Firmware ACPI Control Structure (FACS)
*
******************************************************************************/
typedef struct acpi_table_facs
{
/* Masks for GlobalLock flag field above */
/* Masks for Flags field above */
/* Masks for OspmFlags field above */
/*******************************************************************************
*
* FADT - Fixed ACPI Description Table (Signature "FACP")
* Version 4
*
******************************************************************************/
/* Fields common to all versions of the FADT */
typedef struct acpi_table_fadt
{
/* Masks for FADT Boot Architecture Flags (BootFlags) */
#define ACPI_FADT_NO_MSI (1<<3) /* 03: [V4] Message Signaled Interrupts (MSI) must not be enabled */
/* Masks for FADT flags */
#define ACPI_FADT_POWER_BUTTON (1<<4) /* 04: [V1] Power button is handled as a control method device */
#define ACPI_FADT_SLEEP_BUTTON (1<<5) /* 05: [V1] Sleep button is handled as a control method device */
#define ACPI_FADT_RESET_REGISTER (1<<10) /* 10: [V2] System reset via the FADT RESET_REG supported */
#define ACPI_FADT_SEALED_CASE (1<<11) /* 11: [V3] No internal expansion capabilities and case is sealed */
#define ACPI_FADT_HEADLESS (1<<12) /* 12: [V3] No local video capabilities or local input devices */
#define ACPI_FADT_SLEEP_TYPE (1<<13) /* 13: [V3] Must execute native instruction after writing SLP_TYPx register */
#define ACPI_FADT_PCI_EXPRESS_WAKE (1<<14) /* 14: [V4] System supports PCIEXP_WAKE (STS/EN) bits (ACPI 3.0) */
#define ACPI_FADT_PLATFORM_CLOCK (1<<15) /* 15: [V4] OSPM should use platform-provided timer (ACPI 3.0) */
#define ACPI_FADT_S4_RTC_VALID (1<<16) /* 16: [V4] Contents of RTC_STS valid after S4 wake (ACPI 3.0) */
#define ACPI_FADT_REMOTE_POWER_ON (1<<17) /* 17: [V4] System is compatible with remote power on (ACPI 3.0) */
#define ACPI_FADT_APIC_CLUSTER (1<<18) /* 18: [V4] All local APICs must use cluster model (ACPI 3.0) */
#define ACPI_FADT_APIC_PHYSICAL (1<<19) /* 19: [V4] All local xAPICs must use physical dest mode (ACPI 3.0) */
/* Values for PreferredProfile (Prefered Power Management Profiles) */
{
PM_UNSPECIFIED = 0,
PM_DESKTOP = 1,
PM_MOBILE = 2,
PM_WORKSTATION = 3,
PM_ENTERPRISE_SERVER = 4,
PM_SOHO_SERVER = 5,
PM_APPLIANCE_PC = 6
};
/* Reset to default packing */
#pragma pack()
/*
* Internal table-related structures
*/
typedef union acpi_name_union
{
char Ascii[4];
/* Internal ACPI Table Descriptor. One per ACPI table. */
typedef struct acpi_table_desc
{
/* Masks for Flags field above */
#define ACPI_TABLE_ORIGIN_UNKNOWN (0)
#define ACPI_TABLE_ORIGIN_MAPPED (1)
#define ACPI_TABLE_ORIGIN_ALLOCATED (2)
#define ACPI_TABLE_ORIGIN_OVERRIDE (4)
#define ACPI_TABLE_ORIGIN_MASK (7)
#define ACPI_TABLE_IS_LOADED (8)
/*
* Get the remaining ACPI tables
*/
#include "actbl1.h"
#include "actbl2.h"
/* Macros used to generate offsets to specific table fields */
/*
* Sizes of the various flavors of FADT. We need to look closely
* at the FADT length because the version number essentially tells
* us nothing because of many BIOS bugs where the version does not
* match the expected length. In other words, the length of the
* FADT is the bottom line as to what the version really is.
*
* For reference, the values below are as follows:
* FADT V1 size: 0x74
* FADT V2 size: 0x84
* FADT V3+ size: 0xF4
*/
#endif /* __ACTBL_H__ */