Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F141980692
D36985.id111784.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D36985.id111784.diff
View Options
diff --git a/usr.sbin/bhyve/basl.c b/usr.sbin/bhyve/basl.c
--- a/usr.sbin/bhyve/basl.c
+++ b/usr.sbin/bhyve/basl.c
@@ -38,6 +38,64 @@
struct qemu_loader *basl_loader;
+static int
+basl_dump_table(const struct basl_table *const table, const int mem)
+{
+ const ACPI_TABLE_HEADER *const header = table->data;
+ const uint8_t *data;
+
+ if (!mem) {
+ data = table->data;
+ } else {
+ data = (uint8_t *)vm_map_gpa(table->ctx,
+ BHYVE_ACPI_BASE + table->off, table->len);
+ if (data == NULL) {
+ return (ENOMEM);
+ }
+ }
+
+ printf("%c%c%c%c @ %8x (%s)\n\r", header->Signature[0],
+ header->Signature[1], header->Signature[2], header->Signature[3],
+ BHYVE_ACPI_BASE + table->off, mem ? "Memory" : "FwCfg");
+ for (uint32_t i = 0; i < table->len; i += 0x10) {
+ printf("%08x: ", i);
+ for (uint32_t n = 0; n < 0x10; ++n) {
+ if (table->len <= i + n) {
+ printf(" ");
+ continue;
+ }
+ printf("%02x ", data[i + n]);
+ }
+ printf("| ");
+ for (uint32_t n = 0; n < 0x10; ++n) {
+ if (table->len <= i + n) {
+ printf(" ");
+ continue;
+ }
+ const uint8_t c = data[i + n];
+ if (c < 0x20 || c >= 0x7F) {
+ printf(".");
+ } else {
+ printf("%c", c);
+ }
+ }
+ printf("\n\r");
+ }
+
+ return (0);
+}
+
+static int
+basl_dump(const int mem)
+{
+ struct basl_table *table;
+ STAILQ_FOREACH (table, &basl_tables, chain) {
+ BASL_EXEC(basl_dump_table(table, mem));
+ }
+
+ return (0);
+}
+
static int
basl_finish_alloc()
{
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 15, 11:43 AM (17 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27648576
Default Alt Text
D36985.id111784.diff (1 KB)
Attached To
Mode
D36985: [PATCH 2/19] bhyve: add table dump functions for basl
Attached
Detach File
Event Timeline
Log In to Comment