bhyve: add basl support for generic addresses
In upcoming commits, bhyve will build some ACPI tables by it's own. Therefore, it should be capable of appending GENERIC_ADDRESS structs to ACPI tables. Reviewed by: jhb, markj Approved by: manu (mentor) MFC after: 2 weeks Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D36988
This commit is contained in:
@@ -156,6 +156,22 @@ basl_table_append_bytes(struct basl_table *const table, const void *const bytes,
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
basl_table_append_gas(struct basl_table *const table, const uint8_t space_id,
|
||||||
|
const uint8_t bit_width, const uint8_t bit_offset,
|
||||||
|
const uint8_t access_width, const uint64_t address)
|
||||||
|
{
|
||||||
|
ACPI_GENERIC_ADDRESS gas_le = {
|
||||||
|
.SpaceId = space_id,
|
||||||
|
.BitWidth = bit_width,
|
||||||
|
.BitOffset = bit_offset,
|
||||||
|
.AccessWidth = access_width,
|
||||||
|
.Address = htole64(address),
|
||||||
|
};
|
||||||
|
|
||||||
|
return (basl_table_append_bytes(table, &gas_le, sizeof(gas_le)));
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
basl_table_append_int(struct basl_table *const table, const uint64_t val,
|
basl_table_append_int(struct basl_table *const table, const uint64_t val,
|
||||||
const uint8_t size)
|
const uint8_t size)
|
||||||
|
|||||||
@@ -8,6 +8,13 @@
|
|||||||
|
|
||||||
#include <contrib/dev/acpica/include/acpi.h>
|
#include <contrib/dev/acpica/include/acpi.h>
|
||||||
|
|
||||||
|
#define ACPI_GAS_ACCESS_WIDTH_LEGACY 0
|
||||||
|
#define ACPI_GAS_ACCESS_WIDTH_UNDEFINED 0
|
||||||
|
#define ACPI_GAS_ACCESS_WIDTH_BYTE 1
|
||||||
|
#define ACPI_GAS_ACCESS_WIDTH_WORD 2
|
||||||
|
#define ACPI_GAS_ACCESS_WIDTH_DWORD 3
|
||||||
|
#define ACPI_GAS_ACCESS_WIDTH_QWORD 4
|
||||||
|
|
||||||
#define BHYVE_ACPI_BASE 0xf2400
|
#define BHYVE_ACPI_BASE 0xf2400
|
||||||
|
|
||||||
#define BASL_TABLE_ALIGNMENT 0x10
|
#define BASL_TABLE_ALIGNMENT 0x10
|
||||||
@@ -32,6 +39,9 @@ int basl_finish(void);
|
|||||||
int basl_init(void);
|
int basl_init(void);
|
||||||
int basl_table_append_bytes(struct basl_table *table, const void *bytes,
|
int basl_table_append_bytes(struct basl_table *table, const void *bytes,
|
||||||
uint32_t len);
|
uint32_t len);
|
||||||
|
int basl_table_append_gas(struct basl_table *table, uint8_t space_id,
|
||||||
|
uint8_t bit_width, uint8_t bit_offset, uint8_t access_width,
|
||||||
|
uint64_t address);
|
||||||
int basl_table_append_int(struct basl_table *table, uint64_t val, uint8_t size);
|
int basl_table_append_int(struct basl_table *table, uint64_t val, uint8_t size);
|
||||||
int basl_table_create(struct basl_table **table, struct vmctx *ctx,
|
int basl_table_create(struct basl_table **table, struct vmctx *ctx,
|
||||||
const uint8_t *name, uint32_t alignment, uint32_t off);
|
const uint8_t *name, uint32_t alignment, uint32_t off);
|
||||||
|
|||||||
Reference in New Issue
Block a user