AcpiSdt.h revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
/** @file
ACPI Sdt Protocol Driver
Copyright (c) 2010, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef _ACPI_SDT_H_
#define _ACPI_SDT_H_
//
// Privacy data structure
//
//
// ACPI Notify Linked List Signature.
//
//
// ACPI Notify List Entry definition.
//
// Signature must be set to EFI_ACPI_NOTIFY_LIST_SIGNATURE
// Link is the linked list data.
// Notification is the callback function.
//
typedef struct {
//
// Containment record for ACPI Notify linked list.
//
#define EFI_ACPI_NOTIFY_LIST_FROM_LINK(_link) CR (_link, EFI_ACPI_NOTIFY_LIST, Link, EFI_ACPI_NOTIFY_LIST_SIGNATURE)
typedef struct _AML_BYTE_ENCODING AML_BYTE_ENCODING;
typedef struct _EFI_AML_NODE_LIST EFI_AML_NODE_LIST;
//
// AML Node Linked List Signature.
//
//
// AML Node Linked List Entry definition.
//
// Signature must be set to EFI_AML_NODE_LIST_SIGNATURE
// Link is the linked list data.
// Name is the ACPI node name.
// This is listed for PATH finding.
// This buffer should not be freed.
// Size is the total size of this ACPI node buffer.
// Children is the children linked list of this node.
//
#define AML_NAME_SEG_SIZE 4
struct _EFI_AML_NODE_LIST {
};
//
// Containment record for AML Node linked list.
//
#define EFI_AML_NODE_LIST_FROM_LINK(_link) CR (_link, EFI_AML_NODE_LIST, Link, EFI_AML_NODE_LIST_SIGNATURE)
//
// AML Handle Signature.
//
//
// AML Handle Entry definition.
//
// Signature must be set to EFI_AML_HANDLE_SIGNATURE or EFI_AML_ROOT_HANDLE_SIGNATURE
// This buffer should not be freed.
// Size is the total size of this ACPI node buffer.
//
typedef struct {
typedef UINT32 AML_OP_PARSE_INDEX;
#define AML_OP_PARSE_INDEX_GET_OPCODE 0
#define AML_OP_PARSE_INDEX_GET_TERM1 1
#define AML_OP_PARSE_INDEX_GET_TERM2 2
#define AML_OP_PARSE_INDEX_GET_TERM3 3
#define AML_OP_PARSE_INDEX_GET_TERM4 4
#define AML_OP_PARSE_INDEX_GET_TERM5 5
#define AML_OP_PARSE_INDEX_GET_TERM6 6
typedef UINT32 AML_OP_PARSE_FORMAT;
#define AML_NONE 0
#define AML_OPCODE 1
#define AML_UINT8 2
#define AML_UINT16 3
#define AML_UINT32 4
#define AML_UINT64 5
#define AML_NAME 6
#define AML_STRING 7
#define AML_OBJECT 8
typedef UINT32 AML_OP_ATTRIBUTE;
// NOTE; Not all OBJECT will be in NameSpace
// For example, BankField | CreateBitField | CreateByteField | CreateDWordField |
// CreateField | CreateQWordField | CreateWordField | Field | IndexField.
struct _AML_BYTE_ENCODING {
};
//
// AcpiSdt protocol declaration
//
/**
Returns a requested ACPI table.
The GetAcpiTable() function returns a pointer to a buffer containing the ACPI table associated
with the Index that was input. The following structures are not considered elements in the list of
ACPI tables:
- Root System Description Pointer (RSD_PTR)
- Root System Description Table (RSDT)
- Extended System Description Table (XSDT)
Version is updated with a bit map containing all the versions of ACPI of which the table is a
member.
@param[in] Index The zero-based index of the table to retrieve.
@param[out] Table Pointer for returning the table buffer.
@param[out] Version On return, updated with the ACPI versions to which this table belongs. Type
EFI_ACPI_TABLE_VERSION is defined in "Related Definitions" in the
EFI_ACPI_SDT_PROTOCOL.
@param[out] TableKey On return, points to the table key for the specified ACPI system definition table. This
is identical to the table key used in the EFI_ACPI_TABLE_PROTOCOL.
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_NOT_FOUND The requested index is too large and a table was not found.
**/
);
/**
Register or unregister a callback when an ACPI table is installed.
This function registers or unregisters a function which will be called whenever a new ACPI table is
installed.
@param[in] Register If TRUE, then the specified function will be registered. If FALSE, then the specified
function will be unregistered.
@param[in] Notification Points to the callback function to be registered or unregistered.
@retval EFI_SUCCESS Callback successfully registered or unregistered.
@retval EFI_INVALID_PARAMETER Notification is NULL
@retval EFI_INVALID_PARAMETER Register is FALSE and Notification does not match a known registration function.
**/
);
/**
Create a handle for the first ACPI opcode in an ACPI system description table.
@param[in] TableKey The table key for the ACPI table, as returned by GetTable().
@param[out] Handle On return, points to the newly created ACPI handle.
@retval EFI_SUCCESS Handle created successfully.
@retval EFI_NOT_FOUND TableKey does not refer to a valid ACPI table.
**/
OpenSdt (
);
/**
Create a handle from an ACPI opcode
@param[in] Buffer Points to the ACPI opcode.
@param[out] Handle Upon return, holds the handle.
@retval EFI_SUCCESS Success
@retval EFI_INVALID_PARAMETER Buffer is NULL or Handle is NULL or Buffer points to an
invalid opcode.
**/
Open (
);
/**
Close an ACPI handle.
@param[in] Handle Returns the handle.
@retval EFI_SUCCESS Success
@retval EFI_INVALID_PARAMETER Handle is NULL or does not refer to a valid ACPI object.
**/
Close (
);
/**
Retrieve information about an ACPI object.
@param[in] Handle ACPI object handle.
@param[in] Index Index of the data to retrieve from the object. In general, indexes read from left-to-right
in the ACPI encoding, with index 0 always being the ACPI opcode.
@param[out] DataType Points to the returned data type or EFI_ACPI_DATA_TYPE_NONE if no data exists
for the specified index.
@param[out] Data Upon return, points to the pointer to the data.
@param[out] DataSize Upon return, points to the size of Data.
@retval EFI_SUCCESS Success.
@retval EFI_INVALID_PARAMETER Handle is NULL or does not refer to a valid ACPI object.
**/
);
/**
Change information about an ACPI object.
@param[in] Handle ACPI object handle.
@param[in] Index Index of the data to retrieve from the object. In general, indexes read from left-to-right
in the ACPI encoding, with index 0 always being the ACPI opcode.
@param[in] Data Points to the data.
@param[in] DataSize The size of the Data.
@retval EFI_SUCCESS Success
@retval EFI_INVALID_PARAMETER Handle is NULL or does not refer to a valid ACPI object.
@retval EFI_BAD_BUFFER_SIZE Data cannot be accommodated in the space occupied by
the option.
**/
);
/**
Return the child ACPI objects.
@param[in] ParentHandle Parent handle.
@param[in, out] Handle On entry, points to the previously returned handle or NULL to start with the first
handle. On return, points to the next returned ACPI handle or NULL if there are no
child objects.
@retval EFI_SUCCESS Success
@retval EFI_INVALID_PARAMETER ParentHandle is NULL or does not refer to a valid ACPI object.
**/
GetChild (
);
/**
Returns the handle of the ACPI object representing the specified ACPI path
@param[in] HandleIn Points to the handle of the object representing the starting point for the path search.
@param[in] AcpiPath Points to the ACPI path, which conforms to the ACPI encoded path format.
@param[out] HandleOut On return, points to the ACPI object which represents AcpiPath, relative to
HandleIn.
@retval EFI_SUCCESS Success
@retval EFI_INVALID_PARAMETER HandleIn is NULL or does not refer to a valid ACPI object.
**/
FindPath (
);
//
// ACPI SDT function
//
/**
Create a handle from an ACPI opcode
@param[in] Buffer Points to the ACPI opcode.
@param[in] BufferSize Max buffer size.
@param[out] Handle Upon return, holds the handle.
@retval EFI_SUCCESS Success
@retval EFI_INVALID_PARAMETER Buffer is NULL or Handle is NULL or Buffer points to an
invalid opcode.
**/
);
//
// AML support function
//
/**
Get AML NameString size.
@param[in] Buffer AML NameString.
@param[out] BufferSize AML NameString size
@retval EFI_SUCCESS Success.
@retval EFI_INVALID_PARAMETER Buffer does not refer to a valid AML NameString.
**/
);
/**
This function retuns package length from the buffer.
@param[in] Buffer AML buffer
@param[out] PkgLength The total length of package.
@return The byte data count to present the package length.
**/
);
/**
This function returns AcpiDataType according to AmlType.
@param[in] AmlType AML Type.
@return AcpiDataType
**/
);
/**
This function returns AmlByteEncoding according to OpCode Byte.
@param[in] OpByteBuffer OpCode byte buffer.
@return AmlByteEncoding
**/
);
/**
Return object size.
@param[in] AmlByteEncoding AML Byte Encoding.
@param[in] Buffer AML object buffer.
@param[in] MaxBufferSize AML object buffer MAX size. The parser can not parse any data exceed this region.
@return Size of the object.
**/
);
/**
Return object name.
@param[in] AmlHandle AML handle.
@return Name of the object.
**/
CHAR8 *
);
/**
Retrieve information according to AmlHandle
@param[in] AmlHandle AML handle.
@param[in] Index Index of the data to retrieve from the object. In general, indexes read from left-to-right
in the ACPI encoding, with index 0 always being the ACPI opcode.
@param[out] DataType Points to the returned data type or EFI_ACPI_DATA_TYPE_NONE if no data exists
for the specified index.
@param[out] Data Upon return, points to the pointer to the data.
@param[out] DataSize Upon return, points to the size of Data.
@retval EFI_SUCCESS Success.
@retval EFI_INVALID_PARAMETER AmlHandle does not refer to a valid ACPI object.
**/
);
/**
Return offset of last option.
@param[in] AmlHandle AML Handle.
@param[out] Buffer Upon return, points to the offset after last option.
@retval EFI_SUCCESS Success.
@retval EFI_INVALID_PARAMETER AmlHandle does not refer to a valid ACPI object.
**/
);
/**
Return the child ACPI objects from Root Handle.
@param[in] AmlParentHandle Parent handle. It is Root Handle.
@param[in] AmlHandle The previously returned handle or NULL to start with the first handle.
@param[out] Buffer On return, points to the next returned ACPI handle or NULL if there are no
child objects.
@retval EFI_SUCCESS Success
@retval EFI_INVALID_PARAMETER ParentHandle is NULL or does not refer to a valid ACPI object.
**/
);
/**
Return the child ACPI objects from Non-Root Handle.
@param[in] AmlParentHandle Parent handle. It is Non-Root Handle.
@param[in] AmlHandle The previously returned handle or NULL to start with the first handle.
@param[out] Buffer On return, points to the next returned ACPI handle or NULL if there are no
child objects.
@retval EFI_SUCCESS Success
@retval EFI_INVALID_PARAMETER ParentHandle is NULL or does not refer to a valid ACPI object.
**/
);
/**
Return AML name according to ASL name.
The caller need free the AmlName returned.
@param[in] AslPath ASL name.
@return AmlName
**/
UINT8 *
);
/**
Returns the handle of the ACPI object representing the specified ACPI AML path
@param[in] AmlHandle Points to the handle of the object representing the starting point for the path search.
@param[in] AmlPath Points to the ACPI AML path.
@param[out] Buffer On return, points to the ACPI object which represents AcpiPath, relative to
HandleIn.
@param[in] FromRoot TRUE means to find AML path from \ (Root) Node.
FALSE means to find AML path from this Node (The HandleIn).
@retval EFI_SUCCESS Success
@retval EFI_INVALID_PARAMETER HandleIn does not refer to a valid ACPI object.
**/
);
/**
Print AML NameString.
@param[in] Buffer AML NameString.
**/
);
/**
Print AML NameSeg.
@param[in] Buffer AML NameSeg.
**/
);
/**
Check if it is AML Root name
@param[in] Buffer AML path.
@retval TRUE AML path is root.
@retval FALSE AML path is not root.
**/
);
#endif