Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102636433
D36994.id113134.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D36994.id113134.diff
View Options
diff --git a/usr.sbin/bhyve/acpi.c b/usr.sbin/bhyve/acpi.c
--- a/usr.sbin/bhyve/acpi.c
+++ b/usr.sbin/bhyve/acpi.c
@@ -58,6 +58,7 @@
__FBSDID("$FreeBSD$");
#include <sys/param.h>
+#include <sys/endian.h>
#include <sys/errno.h>
#include <sys/stat.h>
@@ -619,35 +620,6 @@
return (errno);
}
-static int
-basl_fwrite_facs(FILE *fp)
-{
- EFPRINTF(fp, "/*\n");
- EFPRINTF(fp, " * bhyve FACS template\n");
- EFPRINTF(fp, " */\n");
- EFPRINTF(fp, "[0004]\t\tSignature : \"FACS\"\n");
- EFPRINTF(fp, "[0004]\t\tLength : 00000040\n");
- EFPRINTF(fp, "[0004]\t\tHardware Signature : 00000000\n");
- EFPRINTF(fp, "[0004]\t\t32 Firmware Waking Vector : 00000000\n");
- EFPRINTF(fp, "[0004]\t\tGlobal Lock : 00000000\n");
- EFPRINTF(fp, "[0004]\t\tFlags (decoded below) : 00000000\n");
- EFPRINTF(fp, "\t\t\tS4BIOS Support Present : 0\n");
- EFPRINTF(fp, "\t\t\t64-bit Wake Supported (V2) : 0\n");
- EFPRINTF(fp,
- "[0008]\t\t64 Firmware Waking Vector : 0000000000000000\n");
- EFPRINTF(fp, "[0001]\t\tVersion : 02\n");
- EFPRINTF(fp, "[0003]\t\tReserved : 000000\n");
- EFPRINTF(fp, "[0004]\t\tOspmFlags (decoded below) : 00000000\n");
- EFPRINTF(fp, "\t\t\t64-bit Wake Env Required (V2) : 0\n");
-
- EFFLUSH(fp);
-
- return (0);
-
-err_exit:
- return (errno);
-}
-
/*
* Helper routines for writing to the DSDT from other modules.
*/
@@ -960,6 +932,30 @@
return (0);
}
+static int
+build_facs(struct vmctx *const ctx)
+{
+ ACPI_TABLE_FACS facs;
+ struct basl_table *table;
+
+ memset(&facs, 0, sizeof(facs));
+ memcpy(facs.Signature, ACPI_SIG_FACS, ACPI_NAMESEG_SIZE);
+ facs.Length = sizeof(facs);
+ facs.HardwareSignature = htole32(0);
+ facs.FirmwareWakingVector = htole32(0);
+ facs.GlobalLock = htole32(0);
+ facs.Flags = htole32(0);
+ facs.XFirmwareWakingVector = htole32(0);
+ facs.Version = htole32(2);
+ facs.OspmFlags = htole32(0);
+
+ BASL_EXEC(basl_table_create(&table, ctx, ACPI_SIG_FACS,
+ BASL_TABLE_ALIGNMENT_FACS, FACS_OFFSET));
+ BASL_EXEC(basl_table_append_bytes(table, &facs, sizeof(facs)));
+
+ return (0);
+}
+
int
acpi_build(struct vmctx *ctx, int ncpu)
{
@@ -1000,7 +996,7 @@
BASL_EXEC(basl_compile(ctx, basl_fwrite_fadt, FADT_OFFSET));
BASL_EXEC(basl_compile(ctx, basl_fwrite_hpet, HPET_OFFSET));
BASL_EXEC(basl_compile(ctx, basl_fwrite_mcfg, MCFG_OFFSET));
- BASL_EXEC(basl_compile(ctx, basl_fwrite_facs, FACS_OFFSET));
+ BASL_EXEC(build_facs(ctx));
BASL_EXEC(build_dsdt(ctx));
BASL_EXEC(basl_finish());
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 3:48 AM (10 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14652705
Default Alt Text
D36994.id113134.diff (2 KB)
Attached To
Mode
D36994: [PATCH 11/19] bhyve: build FACS table by basl
Attached
Detach File
Event Timeline
Log In to Comment