Building the FADT table by basl will allow it to be loaded by qemu's
ACPI table loader.
This is the 15. patch required to merge D36983
Differential D36998
[PATCH 15/19] bhyve: build FADT table by basl corvink on Oct 14 2022, 9:27 AM. Authored by Tags Referenced Files
Details
Building the FADT table by basl will allow it to be loaded by qemu's This is the 15. patch required to merge D36983
Diff Detail
Event TimelineComment Actions It would be nice to be able to use ACPI_TABLE_FADT, but there are some risks: 1) when ACPI-CA is updated this file would also have to be updated since it may now have new fields (though maybe an initial memset of the table to 0 would be good enough in practice for future proofing) and 2) you'd need a way to deal with storing references to pointers like basl_table_add_pointer but based on an offset instead (though you could use offsetof, something like basl_table_add_pointer(fadt, offsetof(ACPI_TABLE_FADT, FACS), sizeof(fadt_table.FACS)). OTOH, I think it would be more readable and you could avoid having to set unneeded fields and only focus on setting the non-zero fields that matter. You might also then need variants of things like building the table header or GAS structures that write to a caller-provided buffer instead of appending bytes to a table.
Comment Actions Hmmm, looks like you already use the basl_table_add_* variant for checksums and lengths, so that might not be all that awkward to do for pointers. Also, another way to handle the common header would be to still use the existing function for the common header, but when you append a filled-out FADT table do something like basl_table_append_bytes(&fadt_table->FACS, sizeof(fadt_table) - offsetof(ACPI_FADT_TABLE, FACS)). Comment Actions ACPI-CA contains struct definitions for most tables. I thought about making use of them. This would required to make add_checksum, add_lengths and add_pointer public available. It also requires that you build the table by using the struct, then adding it by append_bytes and at the end you have to add patches for checksums, lengths and pointer. So, building a table would be similar to my basl_table_append_header function. If you prefer that style, I can change it. |