diff --git a/usr.sbin/bhyve/basl.h b/usr.sbin/bhyve/basl.h --- a/usr.sbin/bhyve/basl.h +++ b/usr.sbin/bhyve/basl.h @@ -6,6 +6,7 @@ #pragma once +#include #include #define ACPI_GAS_ACCESS_WIDTH_LEGACY 0 @@ -37,6 +38,19 @@ struct basl_table; +static __inline 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) +{ + assert(gas != NULL); + + gas->SpaceId = space_id; + gas->BitWidth = bit_width; + gas->BitOffset = bit_offset; + gas->AccessWidth = access_width; + gas->Address = htole64(address); +} + int basl_finish(void); int basl_init(void); int basl_table_add_checksum(struct basl_table *const table, const uint32_t off,