diff options
author | Michael Brown | 2017-05-22 20:27:30 +0200 |
---|---|---|
committer | Michael Brown | 2017-05-23 19:34:39 +0200 |
commit | 933e6dadc0b415b26c7c0752423e8284164945e0 (patch) | |
tree | 0fe6aaa713b499e59f20fc34d9dde44524d928a9 /src/include/ipxe | |
parent | [settings] Extend numerical setting tags to 64 bits (diff) | |
download | ipxe-933e6dadc0b415b26c7c0752423e8284164945e0.tar.gz ipxe-933e6dadc0b415b26c7c0752423e8284164945e0.tar.xz ipxe-933e6dadc0b415b26c7c0752423e8284164945e0.zip |
[acpi] Make acpi_find_rsdt() a per-platform method
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe')
-rw-r--r-- | src/include/ipxe/acpi.h | 62 | ||||
-rw-r--r-- | src/include/ipxe/null_acpi.h | 23 |
2 files changed, 69 insertions, 16 deletions
diff --git a/src/include/ipxe/acpi.h b/src/include/ipxe/acpi.h index f87b8ae9..e7ca35da 100644 --- a/src/include/ipxe/acpi.h +++ b/src/include/ipxe/acpi.h @@ -16,6 +16,8 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #include <ipxe/interface.h> #include <ipxe/uaccess.h> #include <ipxe/tables.h> +#include <ipxe/api.h> +#include <config/general.h> /** * An ACPI description header @@ -89,18 +91,6 @@ struct acpi_rsdp { uint32_t rsdt; } __attribute__ (( packed )); -/** EBDA RSDP length */ -#define RSDP_EBDA_LEN 0x400 - -/** Fixed BIOS area RSDP start address */ -#define RSDP_BIOS_START 0xe0000 - -/** Fixed BIOS area RSDP length */ -#define RSDP_BIOS_LEN 0x20000 - -/** Stride at which to search for RSDP */ -#define RSDP_STRIDE 16 - /** Root System Description Table (RSDT) signature */ #define RSDT_SIGNATURE ACPI_SIGNATURE ( 'R', 'S', 'D', 'T' ) @@ -194,16 +184,56 @@ struct acpi_model { /** Declare an ACPI model */ #define __acpi_model __table_entry ( ACPI_MODELS, 01 ) +/** + * Calculate static inline ACPI API function name + * + * @v _prefix Subsystem prefix + * @v _api_func API function + * @ret _subsys_func Subsystem API function + */ +#define ACPI_INLINE( _subsys, _api_func ) \ + SINGLE_API_INLINE ( ACPI_PREFIX_ ## _subsys, _api_func ) + +/** + * Provide an ACPI API implementation + * + * @v _prefix Subsystem prefix + * @v _api_func API function + * @v _func Implementing function + */ +#define PROVIDE_ACPI( _subsys, _api_func, _func ) \ + PROVIDE_SINGLE_API ( ACPI_PREFIX_ ## _subsys, _api_func, _func ) + +/** + * Provide a static inline ACPI API implementation + * + * @v _prefix Subsystem prefix + * @v _api_func API function + */ +#define PROVIDE_ACPI_INLINE( _subsys, _api_func ) \ + PROVIDE_SINGLE_API_INLINE ( ACPI_PREFIX_ ## _subsys, _api_func ) + +/* Include all architecture-independent ACPI API headers */ +#include <ipxe/null_acpi.h> + +/* Include all architecture-dependent ACPI API headers */ +#include <bits/acpi.h> + +/** + * Locate ACPI root system description table + * + * @ret rsdt ACPI root system description table, or UNULL + */ +userptr_t acpi_find_rsdt ( void ); + extern struct acpi_descriptor * acpi_describe ( struct interface *interface ); #define acpi_describe_TYPE( object_type ) \ typeof ( struct acpi_descriptor * ( object_type ) ) extern void acpi_fix_checksum ( struct acpi_header *acpi ); -extern userptr_t acpi_find_rsdt ( userptr_t ebda ); -extern userptr_t acpi_find ( userptr_t rsdt, uint32_t signature, - unsigned int index ); -extern int acpi_sx ( userptr_t rsdt, uint32_t signature ); +extern userptr_t acpi_find ( uint32_t signature, unsigned int index ); +extern int acpi_sx ( uint32_t signature ); 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 ) ); diff --git a/src/include/ipxe/null_acpi.h b/src/include/ipxe/null_acpi.h new file mode 100644 index 00000000..1e469e33 --- /dev/null +++ b/src/include/ipxe/null_acpi.h @@ -0,0 +1,23 @@ +#ifndef _IPXE_NULL_ACPI_H +#define _IPXE_NULL_ACPI_H + +/** @file + * + * Standard do-nothing ACPI interface + * + */ + +FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); + +#ifdef ACPI_NULL +#define ACPI_PREFIX_null +#else +#define ACPI_PREFIX_null __null_ +#endif + +static inline __always_inline userptr_t +ACPI_INLINE ( null, acpi_find_rsdt ) ( void ) { + return UNULL; +} + +#endif /* _IPXE_NULL_ACPI_H */ |