bhyve: add helper to fill a ACPI_GENERIC_ADDRESS

Reviewed by:		jhb
Approved by:		manu (mentor)
MFC after:		2 weeks
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D37407
This commit is contained in:
Corvin Köhne 2022-11-16 10:45:17 +01:00
parent 2c2bd15532
commit 60277ad75e
No known key found for this signature in database
GPG key ID: D854DA56315E026A
2 changed files with 17 additions and 0 deletions

View file

@ -121,6 +121,20 @@ basl_dump(const bool mem)
return (0);
}
void
basl_fill_gas(ACPI_GENERIC_ADDRESS *const gas, const uint8_t space_id,
const uint8_t bit_width, const uint8_t bit_offset,
const uint8_t access_width, const uint64_t address)
{
assert(gas != NULL);
gas->SpaceId = space_id;
gas->BitWidth = bit_width;
gas->BitOffset = bit_offset;
gas->AccessWidth = access_width;
gas->Address = htole64(address);
}
static int
basl_finish_install_guest_tables(struct basl_table *const table)
{

View file

@ -40,6 +40,9 @@
struct basl_table;
void basl_fill_gas(ACPI_GENERIC_ADDRESS *gas, uint8_t space_id,
uint8_t bit_width, uint8_t bit_offset, uint8_t access_width,
uint64_t address);
int basl_finish(void);
int basl_init(void);
int basl_table_add_checksum(struct basl_table *const table, const uint32_t off,