amlresrc.h revision 199767f8919635c4928607450d9e0abb932109ce
/******************************************************************************
*
* Module Name: amlresrc.h - AML resource descriptors
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2015, 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.
*/
/* acpisrc:StructDefs -- for acpisrc conversion */
#ifndef __AMLRESRC_H
#define __AMLRESRC_H
/*
* Resource descriptor tags, as defined in the ACPI specification.
* Used to symbolically reference fields within a descriptor.
*/
#define ACPI_RESTAG_ADDRESS "_ADR"
#define ACPI_RESTAG_ALIGNMENT "_ALN"
#define ACPI_RESTAG_ADDRESSSPACE "_ASI"
#define ACPI_RESTAG_ACCESSSIZE "_ASZ"
#define ACPI_RESTAG_TYPESPECIFICATTRIBUTES "_ATT"
#define ACPI_RESTAG_BASEADDRESS "_BAS"
#define ACPI_RESTAG_DEBOUNCETIME "_DBT"
#define ACPI_RESTAG_DECODE "_DEC"
#define ACPI_RESTAG_DEVICEPOLARITY "_DPL"
#define ACPI_RESTAG_DMA "_DMA"
#define ACPI_RESTAG_DRIVESTRENGTH "_DRS"
#define ACPI_RESTAG_ENDIANNESS "_END"
#define ACPI_RESTAG_FLOWCONTROL "_FLC"
#define ACPI_RESTAG_GRANULARITY "_GRA"
#define ACPI_RESTAG_INTERRUPT "_INT"
#define ACPI_RESTAG_IORESTRICTION "_IOR"
#define ACPI_RESTAG_LENGTH "_LEN"
#define ACPI_RESTAG_LINE "_LIN"
#define ACPI_RESTAG_MEMTYPE "_MEM" /* NonCache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */
#define ACPI_RESTAG_MAXADDR "_MAX"
#define ACPI_RESTAG_MINADDR "_MIN"
#define ACPI_RESTAG_MAXTYPE "_MAF"
#define ACPI_RESTAG_MINTYPE "_MIF"
#define ACPI_RESTAG_MODE "_MOD"
#define ACPI_RESTAG_PARITY "_PAR"
#define ACPI_RESTAG_PHASE "_PHA"
#define ACPI_RESTAG_PIN "_PIN"
#define ACPI_RESTAG_PINCONFIG "_PPI"
#define ACPI_RESTAG_POLARITY "_POL"
#define ACPI_RESTAG_REGISTERBITOFFSET "_RBO"
#define ACPI_RESTAG_REGISTERBITWIDTH "_RBW"
#define ACPI_RESTAG_RANGETYPE "_RNG"
#define ACPI_RESTAG_LENGTH_RX "_RXL"
#define ACPI_RESTAG_LENGTH_TX "_TXL"
#define ACPI_RESTAG_SLAVEMODE "_SLV"
#define ACPI_RESTAG_SPEED "_SPE"
#define ACPI_RESTAG_STOPBITS "_STB"
#define ACPI_RESTAG_TRANSLATION "_TRA"
#define ACPI_RESTAG_VENDORDATA "_VEN"
/* Default sizes for "small" resource descriptors */
#define ASL_RDESC_IRQ_SIZE 0x02
#define ASL_RDESC_DMA_SIZE 0x02
#define ASL_RDESC_ST_DEPEND_SIZE 0x00
#define ASL_RDESC_END_DEPEND_SIZE 0x00
#define ASL_RDESC_IO_SIZE 0x07
#define ASL_RDESC_FIXED_IO_SIZE 0x03
#define ASL_RDESC_FIXED_DMA_SIZE 0x05
#define ASL_RDESC_END_TAG_SIZE 0x01
typedef struct asl_resource_node
{
void *Buffer;
struct asl_resource_node *Next;
typedef struct asl_resource_info
{
/* Macros used to generate AML resource length fields */
#define ACPI_AML_SIZE_LARGE(r) (sizeof (r) - sizeof (AML_RESOURCE_LARGE_HEADER))
#define ACPI_AML_SIZE_SMALL(r) (sizeof (r) - sizeof (AML_RESOURCE_SMALL_HEADER))
/*
* Resource descriptors defined in the ACPI specification.
*
* are used to overlay the raw AML byte stream.
*/
#pragma pack(1)
/*
* SMALL descriptors
*/
#define AML_RESOURCE_SMALL_HEADER_COMMON \
typedef struct aml_resource_small_header
{
typedef struct aml_resource_irq
{
typedef struct aml_resource_irq_noflags
{
typedef struct aml_resource_dma
{
typedef struct aml_resource_start_dependent
{
typedef struct aml_resource_start_dependent_noprio
{
typedef struct aml_resource_end_dependent
{
typedef struct aml_resource_io
{
typedef struct aml_resource_fixed_io
{
typedef struct aml_resource_vendor_small
{
typedef struct aml_resource_end_tag
{
typedef struct aml_resource_fixed_dma
{
/*
* LARGE descriptors
*/
#define AML_RESOURCE_LARGE_HEADER_COMMON \
typedef struct aml_resource_large_header
{
/* General Flags for address space resource descriptors */
#define ACPI_RESOURCE_FLAG_DEC 2
#define ACPI_RESOURCE_FLAG_MIF 4
#define ACPI_RESOURCE_FLAG_MAF 8
typedef struct aml_resource_memory24
{
typedef struct aml_resource_vendor_large
{
typedef struct aml_resource_memory32
{
typedef struct aml_resource_fixed_memory32
{
#define AML_RESOURCE_ADDRESS_COMMON \
typedef struct aml_resource_address
{
typedef struct aml_resource_extended_address64
{
typedef struct aml_resource_address64
{
typedef struct aml_resource_address32
{
typedef struct aml_resource_address16
{
typedef struct aml_resource_extended_irq
{
/* ResSourceIndex, ResSource optional fields follow */
typedef struct aml_resource_generic_register
{
/* Common descriptor for GpioInt and GpioIo (ACPI 5.0) */
typedef struct aml_resource_gpio
{
/*
* Optional fields follow immediately:
* 1) PIN list (Words)
* 2) Resource Source String
* 3) Vendor Data bytes
*/
/* Values for ConnectionType above */
#define AML_RESOURCE_GPIO_TYPE_INT 0
#define AML_RESOURCE_GPIO_TYPE_IO 1
#define AML_RESOURCE_MAX_GPIOTYPE 1
/* Common preamble for all serial descriptors (ACPI 5.0) */
#define AML_RESOURCE_SERIAL_COMMON \
UINT8 RevisionId; \
/* Values for the type field above */
#define AML_RESOURCE_I2C_SERIALBUSTYPE 1
#define AML_RESOURCE_SPI_SERIALBUSTYPE 2
#define AML_RESOURCE_UART_SERIALBUSTYPE 3
#define AML_RESOURCE_MAX_SERIALBUSTYPE 3
typedef struct aml_resource_common_serialbus
{
typedef struct aml_resource_i2c_serialbus
{
/*
* Optional fields follow immediately:
* 1) Vendor Data bytes
* 2) Resource Source String
*/
#define AML_RESOURCE_I2C_MIN_DATA_LEN 6
typedef struct aml_resource_spi_serialbus
{
/*
* Optional fields follow immediately:
* 1) Vendor Data bytes
* 2) Resource Source String
*/
#define AML_RESOURCE_SPI_MIN_DATA_LEN 9
typedef struct aml_resource_uart_serialbus
{
/*
* Optional fields follow immediately:
* 1) Vendor Data bytes
* 2) Resource Source String
*/
#define AML_RESOURCE_UART_MIN_DATA_LEN 10
/* restore default alignment */
#pragma pack()
/* Union of all resource descriptors, so we can allocate the worst case */
typedef union aml_resource
{
/* Descriptor headers */
/* Small resource descriptors */
/* Large resource descriptors */
/* Utility overlays */
} AML_RESOURCE;
/* Interfaces used by both the disassembler and compiler */
void
char *DeviceName);
void
char *DeviceName);
char *
char *
char *DeviceName);
char *
char **TargetName);
char *
char **ParentDeviceName);
char *
char *DeviceName);
char *
#endif