iPXE
|
ACPI data structures. More...
#include <stdint.h>
#include <byteswap.h>
#include <ipxe/refcnt.h>
#include <ipxe/list.h>
#include <ipxe/interface.h>
#include <ipxe/uaccess.h>
#include <ipxe/tables.h>
#include <ipxe/api.h>
#include <config/general.h>
#include <ipxe/null_acpi.h>
#include <ipxe/efi/efi_acpi.h>
#include <ipxe/linux/linux_acpi.h>
#include <bits/acpi.h>
Go to the source code of this file.
Data Structures | |
struct | acpi_small_resource |
An ACPI small resource descriptor header. More... | |
struct | acpi_end_resource |
An ACPI end resource descriptor. More... | |
struct | acpi_large_resource |
An ACPI large resource descriptor header. More... | |
struct | acpi_qword_address_space_resource |
An ACPI QWORD address space resource descriptor. More... | |
union | acpi_resource |
An ACPI resource descriptor. More... | |
struct | acpi_header |
An ACPI description header. More... | |
struct | acpi_rsdp |
Root System Description Pointer. More... | |
struct | acpi_rsdt |
ACPI Root System Description Table (RSDT) More... | |
struct | acpi_fadt |
Fixed ACPI Description Table (FADT) More... | |
struct | acpi_descriptor |
An ACPI descriptor (used to construct ACPI tables) More... | |
struct | acpi_model |
An ACPI table model. More... | |
Macros | |
#define | ACPI_SMALL_LEN_MASK 0x03 |
ACPI small resource length mask. More... | |
#define | ACPI_END_RESOURCE 0x78 |
An ACPI end resource descriptor. More... | |
#define | ACPI_LARGE 0x80 |
ACPI large resource flag. More... | |
#define | ACPI_QWORD_ADDRESS_SPACE_RESOURCE 0x8a |
An ACPI QWORD address space resource descriptor. More... | |
#define | ACPI_ADDRESS_TYPE_MEM 0x00 |
A memory address space type. More... | |
#define | ACPI_ADDRESS_TYPE_BUS 0x02 |
A bus number address space type. More... | |
#define | ACPI_SIGNATURE(a, b, c, d) ( ( (a) << 0 ) | ( (b) << 8 ) | ( (c) << 16 ) | ( (d) << 24 ) ) |
Build ACPI signature. More... | |
#define | RSDP_SIGNATURE { 'R', 'S', 'D', ' ', 'P', 'T', 'R', ' ' } |
Root System Description Pointer signature. More... | |
#define | RSDT_SIGNATURE ACPI_SIGNATURE ( 'R', 'S', 'D', 'T' ) |
Root System Description Table (RSDT) signature. More... | |
#define | FADT_SIGNATURE ACPI_SIGNATURE ( 'F', 'A', 'C', 'P' ) |
Fixed ACPI Description Table (FADT) signature. More... | |
#define | ACPI_PM1_CNT 0 |
ACPI PM1 Control Register (within PM1a_CNT_BLK or PM1A_CNT_BLK) More... | |
#define | ACPI_PM1_CNT_SLP_TYP(x) ( (x) << 10 ) |
Sleep type. More... | |
#define | ACPI_PM1_CNT_SLP_EN ( 1 << 13 ) |
Sleep enable. More... | |
#define | ACPI_PM_TMR 0 |
ACPI PM Timer Register (within PM_TMR_BLK) More... | |
#define | DSDT_SIGNATURE ACPI_SIGNATURE ( 'D', 'S', 'D', 'T' ) |
Differentiated System Description Table (DSDT) signature. More... | |
#define | SSDT_SIGNATURE ACPI_SIGNATURE ( 'S', 'S', 'D', 'T' ) |
Secondary System Description Table (SSDT) signature. More... | |
#define | ACPI_MODELS __table ( struct acpi_model, "acpi_models" ) |
ACPI models. More... | |
#define | __acpi_model __table_entry ( ACPI_MODELS, 01 ) |
Declare an ACPI model. More... | |
#define | ACPI_INLINE(_subsys, _api_func) SINGLE_API_INLINE ( ACPI_PREFIX_ ## _subsys, _api_func ) |
Calculate static inline ACPI API function name. More... | |
#define | PROVIDE_ACPI(_subsys, _api_func, _func) PROVIDE_SINGLE_API ( ACPI_PREFIX_ ## _subsys, _api_func, _func ) |
Provide an ACPI API implementation. More... | |
#define | PROVIDE_ACPI_INLINE(_subsys, _api_func) PROVIDE_SINGLE_API_INLINE ( ACPI_PREFIX_ ## _subsys, _api_func ) |
Provide a static inline ACPI API implementation. More... | |
#define | acpi_describe_TYPE(object_type) typeof ( struct acpi_descriptor * ( object_type ) ) |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static unsigned int | acpi_resource_tag (union acpi_resource *res) |
Get ACPI resource tag. More... | |
static size_t | acpi_small_len (struct acpi_small_resource *res) |
Get length of ACPI small resource descriptor. More... | |
static size_t | acpi_large_len (struct acpi_large_resource *res) |
Get length of ACPI large resource descriptor. More... | |
static size_t | acpi_resource_len (union acpi_resource *res) |
Get length of ACPI resource descriptor. More... | |
static union acpi_resource * | acpi_resource_next (union acpi_resource *res) |
Get next ACPI resource descriptor. More... | |
static const char * | acpi_name (uint32_t signature) |
Transcribe ACPI table signature (for debugging) More... | |
static void | acpi_init (struct acpi_descriptor *desc, struct acpi_model *model, struct refcnt *refcnt) |
Initialise ACPI descriptor. More... | |
userptr_t | acpi_find_via_rsdt (uint32_t signature, unsigned int index) |
Locate ACPI table via RSDT. More... | |
userptr_t | acpi_find_rsdt (void) |
Locate ACPI root system description table. More... | |
userptr_t | acpi_find (uint32_t signature, unsigned int index) |
Locate ACPI table. More... | |
struct acpi_descriptor * | acpi_describe (struct interface *interface) |
Get object's ACPI descriptor. More... | |
void | acpi_fix_checksum (struct acpi_header *acpi) |
Fix up ACPI table checksum. More... | |
userptr_t | acpi_table (uint32_t signature, unsigned int index) |
Locate ACPI table. More... | |
int | acpi_extract (uint32_t signature, void *data, int(*extract)(userptr_t zsdt, size_t len, size_t offset, void *data)) |
Extract value from DSDT/SSDT. More... | |
void | acpi_add (struct acpi_descriptor *desc) |
Add ACPI descriptor. More... | |
void | acpi_del (struct acpi_descriptor *desc) |
Remove ACPI descriptor. More... | |
int | acpi_install (int(*install)(struct acpi_header *acpi)) |
Install ACPI tables. More... | |
Variables | |
userptr_t(* | acpi_finder )(uint32_t signature, unsigned int index) |
ACPI data structures.
Definition in file acpi.h.
#define ACPI_SMALL_LEN_MASK 0x03 |
#define ACPI_END_RESOURCE 0x78 |
#define ACPI_QWORD_ADDRESS_SPACE_RESOURCE 0x8a |
#define ACPI_ADDRESS_TYPE_MEM 0x00 |
#define ACPI_ADDRESS_TYPE_BUS 0x02 |
#define RSDP_SIGNATURE { 'R', 'S', 'D', ' ', 'P', 'T', 'R', ' ' } |
#define RSDT_SIGNATURE ACPI_SIGNATURE ( 'R', 'S', 'D', 'T' ) |
#define FADT_SIGNATURE ACPI_SIGNATURE ( 'F', 'A', 'C', 'P' ) |
#define ACPI_PM1_CNT 0 |
#define ACPI_PM_TMR 0 |
#define DSDT_SIGNATURE ACPI_SIGNATURE ( 'D', 'S', 'D', 'T' ) |
#define SSDT_SIGNATURE ACPI_SIGNATURE ( 'S', 'S', 'D', 'T' ) |
#define ACPI_MODELS __table ( struct acpi_model, "acpi_models" ) |
struct acpi_model ib_sbft_model __acpi_model __table_entry ( ACPI_MODELS, 01 ) |
#define ACPI_INLINE | ( | _subsys, | |
_api_func | |||
) | SINGLE_API_INLINE ( ACPI_PREFIX_ ## _subsys, _api_func ) |
#define PROVIDE_ACPI | ( | _subsys, | |
_api_func, | |||
_func | |||
) | PROVIDE_SINGLE_API ( ACPI_PREFIX_ ## _subsys, _api_func, _func ) |
#define PROVIDE_ACPI_INLINE | ( | _subsys, | |
_api_func | |||
) | PROVIDE_SINGLE_API_INLINE ( ACPI_PREFIX_ ## _subsys, _api_func ) |
#define acpi_describe_TYPE | ( | object_type | ) | typeof ( struct acpi_descriptor * ( object_type ) ) |
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
inlinestatic |
Get ACPI resource tag.
res | ACPI resource descriptor |
tag | Resource tag |
Definition at line 104 of file acpi.h.
References ACPI_LARGE, ACPI_SMALL_LEN_MASK, and acpi_resource::tag.
Referenced by efipci_discover_one(), and efipci_ioremap().
|
inlinestatic |
Get length of ACPI small resource descriptor.
res | Small resource descriptor |
len | Length of descriptor |
Definition at line 116 of file acpi.h.
References ACPI_SMALL_LEN_MASK, and acpi_small_resource::tag.
Referenced by acpi_resource_len().
|
inlinestatic |
Get length of ACPI large resource descriptor.
res | Large resource descriptor |
len | Length of descriptor |
Definition at line 127 of file acpi.h.
References le16_to_cpu, and acpi_large_resource::len.
Referenced by acpi_resource_len().
|
inlinestatic |
Get length of ACPI resource descriptor.
res | ACPI resource descriptor |
len | Length of descriptor |
Definition at line 138 of file acpi.h.
References ACPI_LARGE, acpi_large_len(), acpi_small_len(), acpi_resource::large, acpi_resource::small, and acpi_resource::tag.
Referenced by acpi_resource_next().
|
static |
Get next ACPI resource descriptor.
res | ACPI resource descriptor |
next | Next ACPI resource descriptor |
Definition at line 152 of file acpi.h.
References acpi_resource_len().
Referenced by efipci_discover_one(), and efipci_ioremap().
|
inlinestatic |
Transcribe ACPI table signature (for debugging)
signature | ACPI table signature |
name | ACPI table signature name |
Definition at line 190 of file acpi.h.
References cpu_to_le32, name, signature, and u.
Referenced by acpi_extract(), acpi_find_via_rsdt(), acpi_settings_fetch(), acpi_zsdt(), dummy_install(), efi_block_install(), and int13_install().
|
inlinestatic |
Initialise ACPI descriptor.
desc | ACPI descriptor |
model | Table model |
refcnt | Reference count |
Definition at line 295 of file acpi.h.
References desc, INIT_LIST_HEAD, and refcnt.
Referenced by aoedev_open(), ib_srp_open(), and iscsi_open().
Locate ACPI table via RSDT.
signature | Requested table signature |
index | Requested index of table with this signature |
table | Table, or UNULL if not found |
Definition at line 110 of file acpi.c.
References acpi, acpi_rsdt::acpi, acpi_find_rsdt(), acpi_name(), colour, copy_from_user(), count, cpu_to_le32, DBG, DBGC, DBGC_HDA, acpi_rsdt::entry, index, le32_to_cpu, len, offsetof, phys_to_user(), RSDT_SIGNATURE, signature, typeof(), UNULL, and user_to_phys().
Referenced by acpi_find().
userptr_t acpi_find_rsdt | ( | void | ) |
Locate ACPI root system description table.
rsdt | ACPI root system description table, or UNULL |
Referenced by acpi_find_via_rsdt().
Locate ACPI table.
signature | Requested table signature |
index | Requested index of table with this signature |
table | Table, or UNULL if not found |
Definition at line 26 of file rsdp.h.
References acpi_find_via_rsdt(), index, signature, and UNULL.
struct acpi_descriptor* acpi_describe | ( | struct interface * | intf | ) |
Get object's ACPI descriptor.
intf | Interface |
desc | ACPI descriptor, or NULL |
Definition at line 313 of file acpi.c.
References acpi_describe(), acpi_describe_TYPE, desc, dest, interface::intf, intf_get_dest_op, intf_object(), intf_put(), NULL, and op.
Referenced by acpi_describe(), and sanpath_open().
void acpi_fix_checksum | ( | struct acpi_header * | acpi | ) |
Fix up ACPI table checksum.
acpi | ACPI table header |
Definition at line 85 of file acpi.c.
References acpi, and virt_to_user().
Referenced by efi_block_install(), and int13_install().
Locate ACPI table.
signature | Requested table signature |
index | Requested index of table with this signature |
table | Table, or UNULL if not found |
Definition at line 98 of file acpi.c.
References acpi_finder, index, and signature.
Referenced by acpi_extract(), acpi_poweroff(), acpi_settings_fetch(), acpi_timer_probe(), and ecam_find().
int acpi_extract | ( | uint32_t | signature, |
void * | data, | ||
int(*)(userptr_t zsdt, size_t len, size_t offset, void *data) | extract | ||
) |
Extract value from DSDT/SSDT.
signature | Signature (e.g. "_S5_") |
data | Data buffer |
extract | Extraction method |
rc | Return status code |
Definition at line 240 of file acpi.c.
References acpi_name(), acpi_table(), acpi_zsdt(), colour, copy_from_user(), data, DBGC, acpi_fadt::dsdt, ENOENT, FADT_SIGNATURE, phys_to_user(), rc, signature, and SSDT_SIGNATURE.
Referenced by acpi_mac(), and acpi_poweroff().
void acpi_add | ( | struct acpi_descriptor * | desc | ) |
Add ACPI descriptor.
desc | ACPI descriptor |
Definition at line 287 of file acpi.c.
References desc, list_add_tail, and ref_get.
Referenced by sanpath_open().
void acpi_del | ( | struct acpi_descriptor * | desc | ) |
Remove ACPI descriptor.
desc | ACPI descriptor |
Definition at line 299 of file acpi.c.
References desc, list_check_contains_entry, list_del, and ref_put.
Referenced by sandev_undescribe(), and sanpath_open().
int acpi_install | ( | int(*)(struct acpi_header *acpi) | install | ) |
Install ACPI tables.
install | Table installation method |
rc | Return status code |
Definition at line 336 of file acpi.c.
References ACPI_MODELS, for_each_table_entry, acpi_model::install, and rc.
Referenced by dummy_san_describe(), efi_block_describe(), and int13_describe().
Referenced by acpi_table().