diff options
Diffstat (limited to 'src/include/ipxe/acpi.h')
| -rw-r--r-- | src/include/ipxe/acpi.h | 55 |
1 files changed, 39 insertions, 16 deletions
diff --git a/src/include/ipxe/acpi.h b/src/include/ipxe/acpi.h index c34681238..c423aa584 100644 --- a/src/include/ipxe/acpi.h +++ b/src/include/ipxe/acpi.h @@ -8,17 +8,40 @@ */ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); +FILE_SECBOOT ( PERMITTED ); #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> +/** An ACPI generic address structure */ +struct acpi_address { + /** Address space type */ + uint8_t type; + /** Register bit width */ + uint8_t width; + /** Register bit offset */ + uint8_t offset; + /** Access size */ + uint8_t access; + /** Address */ + uint64_t address; +} __attribute__ (( packed )); + +/** A memory address space type */ +#define ACPI_ADDRESS_TYPE_MEM 0x00 + +/** An I/O address space type */ +#define ACPI_ADDRESS_TYPE_IO 0x01 + +/** A bus number address space type */ +#define ACPI_ADDRESS_TYPE_BUS 0x02 + /** An ACPI small resource descriptor header */ struct acpi_small_resource { /** Tag byte */ @@ -75,12 +98,6 @@ struct acpi_qword_address_space_resource { uint64_t len; } __attribute__ (( packed )); -/** A memory address space type */ -#define ACPI_ADDRESS_TYPE_MEM 0x00 - -/** A bus number address space type */ -#define ACPI_ADDRESS_TYPE_BUS 0x02 - /** An ACPI resource descriptor */ union acpi_resource { /** Tag byte */ @@ -355,7 +372,8 @@ struct acpi_model { #define PROVIDE_ACPI_INLINE( _subsys, _api_func ) \ PROVIDE_SINGLE_API_INLINE ( ACPI_PREFIX_ ## _subsys, _api_func ) -extern userptr_t acpi_find_via_rsdt ( uint32_t signature, unsigned int index ); +extern const struct acpi_header * acpi_find_via_rsdt ( uint32_t signature, + unsigned int index ); /* Include all architecture-independent ACPI API headers */ #include <ipxe/null_acpi.h> @@ -368,31 +386,36 @@ extern userptr_t acpi_find_via_rsdt ( uint32_t signature, unsigned int index ); /** * Locate ACPI root system description table * - * @ret rsdt ACPI root system description table, or UNULL + * @ret rsdt ACPI root system description table, or NULL */ -userptr_t acpi_find_rsdt ( void ); +const struct acpi_rsdt * acpi_find_rsdt ( void ); /** * Locate ACPI table * * @v signature Requested table signature * @v index Requested index of table with this signature - * @ret table Table, or UNULL if not found + * @ret table Table, or NULL if not found */ -userptr_t acpi_find ( uint32_t signature, unsigned int index ); +const struct acpi_header * acpi_find ( uint32_t signature, + unsigned int index ); extern struct acpi_descriptor * acpi_describe ( struct interface *interface ); #define acpi_describe_TYPE( object_type ) \ typeof ( struct acpi_descriptor * ( object_type ) ) -extern userptr_t ( * acpi_finder ) ( uint32_t signature, unsigned int index ); +extern const struct acpi_header * ( * acpi_finder ) ( uint32_t signature, + unsigned int index ); extern void acpi_fix_checksum ( struct acpi_header *acpi ); -extern userptr_t acpi_table ( uint32_t signature, unsigned int index ); +extern const struct acpi_header * acpi_table ( uint32_t signature, + unsigned int index ); extern int acpi_extract ( uint32_t signature, void *data, - int ( * extract ) ( userptr_t zsdt, size_t len, - size_t offset, void *data ) ); + int ( * extract ) ( const struct acpi_header *zsdt, + size_t len, size_t offset, + void *data ) ); +extern void * acpi_ioremap ( struct acpi_address *address, size_t len ); extern void acpi_add ( struct acpi_descriptor *desc ); extern void acpi_del ( struct acpi_descriptor *desc ); extern int acpi_install ( int ( * install ) ( struct acpi_header *acpi ) ); |
