|
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/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_address |
| An ACPI generic address structure. More... | |
| 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_ADDRESS_TYPE_MEM 0x00 |
| A memory address space type. | |
| #define | ACPI_ADDRESS_TYPE_IO 0x01 |
| An I/O address space type. | |
| #define | ACPI_ADDRESS_TYPE_BUS 0x02 |
| A bus number address space type. | |
| #define | ACPI_SMALL_LEN_MASK 0x03 |
| ACPI small resource length mask. | |
| #define | ACPI_END_RESOURCE 0x78 |
| An ACPI end resource descriptor. | |
| #define | ACPI_LARGE 0x80 |
| ACPI large resource flag. | |
| #define | ACPI_QWORD_ADDRESS_SPACE_RESOURCE 0x8a |
| An ACPI QWORD address space resource descriptor. | |
| #define | ACPI_SIGNATURE(a, b, c, d) |
| Build ACPI signature. | |
| #define | RSDP_SIGNATURE { 'R', 'S', 'D', ' ', 'P', 'T', 'R', ' ' } |
| Root System Description Pointer signature. | |
| #define | RSDT_SIGNATURE ACPI_SIGNATURE ( 'R', 'S', 'D', 'T' ) |
| Root System Description Table (RSDT) signature. | |
| #define | FADT_SIGNATURE ACPI_SIGNATURE ( 'F', 'A', 'C', 'P' ) |
| Fixed ACPI Description Table (FADT) signature. | |
| #define | ACPI_PM1_CNT 0 |
| ACPI PM1 Control Register (within PM1a_CNT_BLK or PM1A_CNT_BLK) | |
| #define | ACPI_PM1_CNT_SLP_TYP(x) |
| Sleep type. | |
| #define | ACPI_PM1_CNT_SLP_EN ( 1 << 13 ) |
| Sleep enable. | |
| #define | ACPI_PM_TMR 0 |
| ACPI PM Timer Register (within PM_TMR_BLK) | |
| #define | DSDT_SIGNATURE ACPI_SIGNATURE ( 'D', 'S', 'D', 'T' ) |
| Differentiated System Description Table (DSDT) signature. | |
| #define | SSDT_SIGNATURE ACPI_SIGNATURE ( 'S', 'S', 'D', 'T' ) |
| Secondary System Description Table (SSDT) signature. | |
| #define | ACPI_MODELS __table ( struct acpi_model, "acpi_models" ) |
| ACPI models. | |
| #define | __acpi_model __table_entry ( ACPI_MODELS, 01 ) |
| Declare an ACPI model. | |
| #define | ACPI_INLINE(_subsys, _api_func) |
| Calculate static inline ACPI API function name. | |
| #define | PROVIDE_ACPI(_subsys, _api_func, _func) |
| Provide an ACPI API implementation. | |
| #define | PROVIDE_ACPI_INLINE(_subsys, _api_func) |
| Provide a static inline ACPI API implementation. | |
| #define | acpi_describe_TYPE(object_type) |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| FILE_SECBOOT (PERMITTED) | |
| static unsigned int | acpi_resource_tag (union acpi_resource *res) |
| Get ACPI resource tag. | |
| static size_t | acpi_small_len (struct acpi_small_resource *res) |
| Get length of ACPI small resource descriptor. | |
| static size_t | acpi_large_len (struct acpi_large_resource *res) |
| Get length of ACPI large resource descriptor. | |
| static size_t | acpi_resource_len (union acpi_resource *res) |
| Get length of ACPI resource descriptor. | |
| static union acpi_resource * | acpi_resource_next (union acpi_resource *res) |
| Get next ACPI resource descriptor. | |
| static const char * | acpi_name (uint32_t signature) |
| Transcribe ACPI table signature (for debugging) | |
| static void | acpi_init (struct acpi_descriptor *desc, struct acpi_model *model, struct refcnt *refcnt) |
| Initialise ACPI descriptor. | |
| const struct acpi_header * | acpi_find_via_rsdt (uint32_t signature, unsigned int index) |
| Locate ACPI table via RSDT. | |
| const struct acpi_rsdt * | acpi_find_rsdt (void) |
| Locate ACPI root system description table. | |
| const struct acpi_header * | acpi_find (uint32_t signature, unsigned int index) |
| Locate ACPI table. | |
| struct acpi_descriptor * | acpi_describe (struct interface *interface) |
| Get object's ACPI descriptor. | |
| void | acpi_fix_checksum (struct acpi_header *acpi) |
| Fix up ACPI table checksum. | |
| const struct acpi_header * | acpi_table (uint32_t signature, unsigned int index) |
| Locate ACPI table. | |
| int | acpi_extract (uint32_t signature, void *data, int(*extract)(const struct acpi_header *zsdt, size_t len, size_t offset, void *data)) |
| Extract value from DSDT/SSDT. | |
| void * | acpi_ioremap (struct acpi_address *address, size_t len) |
| Map an ACPI generic address. | |
| void | acpi_add (struct acpi_descriptor *desc) |
| Add ACPI descriptor. | |
| void | acpi_del (struct acpi_descriptor *desc) |
| Remove ACPI descriptor. | |
| int | acpi_install (int(*install)(struct acpi_header *acpi)) |
| Install ACPI tables. | |
Variables | |
| const struct acpi_header *(* | acpi_finder )(uint32_t signature, unsigned int index) |
ACPI data structures.
Definition in file acpi.h.
| #define ACPI_ADDRESS_TYPE_MEM 0x00 |
A memory address space type.
Definition at line 37 of file acpi.h.
Referenced by acpi_ioremap(), and efipci_ioremap().
| #define ACPI_ADDRESS_TYPE_IO 0x01 |
| #define ACPI_ADDRESS_TYPE_BUS 0x02 |
A bus number address space type.
Definition at line 43 of file acpi.h.
Referenced by efipci_discover_one().
| #define ACPI_SMALL_LEN_MASK 0x03 |
ACPI small resource length mask.
Definition at line 52 of file acpi.h.
Referenced by acpi_resource_tag(), and acpi_small_len().
| #define ACPI_END_RESOURCE 0x78 |
An ACPI end resource descriptor.
Definition at line 55 of file acpi.h.
Referenced by efipci_discover_one(), and efipci_ioremap().
| #define ACPI_LARGE 0x80 |
ACPI large resource flag.
Definition at line 74 of file acpi.h.
Referenced by acpi_resource_len(), and acpi_resource_tag().
| #define ACPI_QWORD_ADDRESS_SPACE_RESOURCE 0x8a |
An ACPI QWORD address space resource descriptor.
Definition at line 77 of file acpi.h.
Referenced by efipci_discover_one(), and efipci_ioremap().
| #define ACPI_SIGNATURE | ( | a, | |
| b, | |||
| c, | |||
| d ) |
Build ACPI signature.
| a | First character of ACPI signature |
| b | Second character of ACPI signature |
| c | Third character of ACPI signature |
| d | Fourth character of ACPI signature |
| signature | ACPI signature |
Definition at line 226 of file acpi.h.
| #define RSDP_SIGNATURE { 'R', 'S', 'D', ' ', 'P', 'T', 'R', ' ' } |
Root System Description Pointer signature.
Definition at line 230 of file acpi.h.
Referenced by rsdp_find_rsdt_range().
| #define RSDT_SIGNATURE ACPI_SIGNATURE ( 'R', 'S', 'D', 'T' ) |
Root System Description Table (RSDT) signature.
Definition at line 247 of file acpi.h.
Referenced by acpi_find_via_rsdt().
| #define FADT_SIGNATURE ACPI_SIGNATURE ( 'F', 'A', 'C', 'P' ) |
Fixed ACPI Description Table (FADT) signature.
Definition at line 258 of file acpi.h.
Referenced by acpi_extract(), acpi_poweroff(), and acpi_timer_probe().
| #define ACPI_PM1_CNT 0 |
ACPI PM1 Control Register (within PM1a_CNT_BLK or PM1A_CNT_BLK)
Definition at line 281 of file acpi.h.
Referenced by acpi_poweroff().
| #define ACPI_PM1_CNT_SLP_TYP | ( | x | ) |
Sleep type.
Definition at line 282 of file acpi.h.
Referenced by acpi_poweroff().
| #define ACPI_PM1_CNT_SLP_EN ( 1 << 13 ) |
| #define ACPI_PM_TMR 0 |
ACPI PM Timer Register (within PM_TMR_BLK)
Definition at line 286 of file acpi.h.
Referenced by acpi_timer_probe().
| #define DSDT_SIGNATURE ACPI_SIGNATURE ( 'D', 'S', 'D', 'T' ) |
| #define SSDT_SIGNATURE ACPI_SIGNATURE ( 'S', 'S', 'D', 'T' ) |
Secondary System Description Table (SSDT) signature.
Definition at line 292 of file acpi.h.
Referenced by acpi_extract().
| #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 ) |
Calculate static inline ACPI API function name.
| _prefix | Subsystem prefix |
| _api_func | API function |
| _subsys_func | Subsystem API function |
Definition at line 353 of file acpi.h.
| #define PROVIDE_ACPI | ( | _subsys, | |
| _api_func, | |||
| _func ) |
Provide an ACPI API implementation.
| _prefix | Subsystem prefix |
| _api_func | API function |
| _func | Implementing function |
Definition at line 363 of file acpi.h.
| #define PROVIDE_ACPI_INLINE | ( | _subsys, | |
| _api_func ) |
Provide a static inline ACPI API implementation.
| _prefix | Subsystem prefix |
| _api_func | API function |
Definition at line 372 of file acpi.h.
| #define acpi_describe_TYPE | ( | object_type | ) |
Definition at line 405 of file acpi.h.
Referenced by acpi_describe().
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
| FILE_SECBOOT | ( | PERMITTED | ) |
|
inlinestatic |
Get ACPI resource tag.
| res | ACPI resource descriptor |
| tag | Resource tag |
Definition at line 121 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 133 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 144 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 155 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 169 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 207 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 312 of file acpi.h.
References desc, and INIT_LIST_HEAD.
Referenced by aoedev_open(), ib_srp_open(), and iscsi_open().
|
extern |
Locate ACPI table via RSDT.
| signature | Requested table signature |
| index | Requested index of table with this signature |
| table | Table, or NULL if not found |
Definition at line 106 of file acpi.c.
References acpi_rsdt::acpi, acpi_find_rsdt(), acpi_name(), colour, count, cpu_to_le32, DBG, DBGC, DBGC_HDA, acpi_rsdt::entry, index, le32_to_cpu, len, acpi_header::length, NULL, RSDT_SIGNATURE, acpi_header::signature, and signature.
Referenced by acpi_find().
| const struct acpi_rsdt * acpi_find_rsdt | ( | void | ) |
Locate ACPI root system description table.
| rsdt | ACPI root system description table, or NULL |
References index, and signature.
Referenced by acpi_find_via_rsdt(), PROVIDE_ACPI(), and PROVIDE_ACPI().
| const struct acpi_header * acpi_find | ( | uint32_t | signature, |
| unsigned int | index ) |
Locate ACPI table.
| signature | Requested table signature |
| index | Requested index of table with this signature |
| table | Table, or NULL if not found |
Definition at line 27 of file rsdp.h.
References acpi_find(), acpi_find_via_rsdt(), index, rsdp, and signature.
Referenced by acpi_find(), acpi_find(), PROVIDE_ACPI_INLINE(), PROVIDE_ACPI_INLINE(), PROVIDE_ACPI_INLINE(), typeof(), and typeof().
|
extern |
Get object's ACPI descriptor.
| intf | Interface |
| desc | ACPI descriptor, or NULL |
Definition at line 321 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().
|
extern |
Fix up ACPI table checksum.
| acpi | ACPI table header |
Definition at line 80 of file acpi.c.
References acpi.
Referenced by efi_block_install(), and int13_install().
|
extern |
Locate ACPI table.
| signature | Requested table signature |
| index | Requested index of table with this signature |
| table | Table, or NULL if not found |
Definition at line 93 of file acpi.c.
References acpi_finder, index, and signature.
Referenced by acpi_extract(), acpi_poweroff(), acpi_settings_fetch(), acpi_timer_probe(), ecam_find(), and spcr_console().
|
extern |
Extract value from DSDT/SSDT.
| signature | Signature (e.g. "_S5_") |
| data | Data buffer |
| extract | Extraction method |
| rc | Return status code |
Definition at line 228 of file acpi.c.
References acpi, acpi_name(), acpi_table(), acpi_zsdt(), colour, container_of, data, DBGC, acpi_fadt::dsdt, ENOENT, FADT_SIGNATURE, len, offset, rc, signature, and SSDT_SIGNATURE.
Referenced by acpi_mac(), and acpi_poweroff().
|
extern |
Map an ACPI generic address.
| address | Generic address |
| len | Length of region |
| io_addr | I/O address, or NULL on error |
Definition at line 270 of file acpi.c.
References ACPI_ADDRESS_TYPE_IO, ACPI_ADDRESS_TYPE_MEM, address, base, ioremap(), le64_to_cpu, len, and NULL.
Referenced by spcr_16550().
|
extern |
Add ACPI descriptor.
| desc | ACPI descriptor |
Definition at line 295 of file acpi.c.
References desc, list_add_tail, and ref_get.
Referenced by sanpath_open().
|
extern |
Remove ACPI descriptor.
| desc | ACPI descriptor |
Definition at line 307 of file acpi.c.
References desc, list_check_contains_entry, list_del, and ref_put.
Referenced by sandev_undescribe(), and sanpath_open().
|
extern |
Install ACPI tables.
| install | Table installation method |
| rc | Return status code |
Definition at line 344 of file acpi.c.
References acpi, ACPI_MODELS, for_each_table_entry, acpi_model::install, and rc.
Referenced by dummy_san_describe(), efi_block_describe(), and int13_describe().
|
extern |
Referenced by acpi_table(), typeof(), and typeof().