Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107030878
D37591.id113770.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
D37591.id113770.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
@@ -692,6 +692,37 @@
return (0);
}
+static int
+build_spcr(struct vmctx *const ctx)
+{
+ ACPI_TABLE_SPCR spcr;
+ struct basl_table *table;
+
+ BASL_EXEC(basl_table_create(&table, ctx, ACPI_SIG_SPCR,
+ BASL_TABLE_ALIGNMENT));
+
+ memset(&spcr, 0, sizeof(spcr));
+ BASL_EXEC(basl_table_append_header(table, ACPI_SIG_SPCR, 1, 1));
+ spcr.InterfaceType = ACPI_DBG2_16550_COMPATIBLE;
+ basl_fill_gas(&spcr.SerialPort, ACPI_ADR_SPACE_SYSTEM_IO, 8, 0,
+ ACPI_GAS_ACCESS_WIDTH_LEGACY, 0x3F8);
+ spcr.InterruptType = ACPI_SPCR_INTERRUPT_TYPE_8259;
+ spcr.PcInterrupt = 4;
+ spcr.BaudRate = ACPI_SPCR_BAUD_RATE_115200;
+ spcr.Parity = ACPI_SPCR_PARITY_NO_PARITY;
+ spcr.StopBits = ACPI_SPCR_STOP_BITS_1;
+ spcr.FlowControl = 3; /* RTS/CTS | DCD */
+ spcr.TerminalType = ACPI_SPCR_TERMINAL_TYPE_VT_UTF8;
+ BASL_EXEC(basl_table_append_content(table, &spcr, sizeof(spcr)));
+
+ BASL_EXEC(basl_table_append_pointer(rsdt, ACPI_SIG_SPCR,
+ ACPI_RSDT_ENTRY_SIZE));
+ BASL_EXEC(basl_table_append_pointer(xsdt, ACPI_SIG_SPCR,
+ ACPI_XSDT_ENTRY_SIZE));
+
+ return (0);
+}
+
static int
build_xsdt(struct vmctx *const ctx)
{
@@ -749,6 +780,7 @@
BASL_EXEC(build_hpet(ctx));
BASL_EXEC(build_mcfg(ctx));
BASL_EXEC(build_facs(ctx));
+ BASL_EXEC(build_spcr(ctx));
BASL_EXEC(build_dsdt(ctx));
BASL_EXEC(basl_finish());
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
@@ -18,6 +18,29 @@
#define ACPI_GAS_ACCESS_WIDTH_DWORD 3
#define ACPI_GAS_ACCESS_WIDTH_QWORD 4
+#define ACPI_SPCR_INTERRUPT_TYPE_8259 0x1
+#define ACPI_SPCR_INTERRUPT_TYPE_APIC 0x2
+#define ACPI_SPCR_INTERRUPT_TYPE_SAPIC 0x4
+#define ACPI_SPCR_INTERRUPT_TYPE_GIC 0x8
+
+#define ACPI_SPCR_BAUD_RATE_9600 3
+#define ACPI_SPCR_BAUD_RATE_19200 4
+#define ACPI_SPCR_BAUD_RATE_57600 6
+#define ACPI_SPCR_BAUD_RATE_115200 7
+
+#define ACPI_SPCR_PARITY_NO_PARITY 0
+
+#define ACPI_SPCR_STOP_BITS_1 1
+
+#define ACPI_SPCR_FLOW_CONTROL_DCD 0x1
+#define ACPI_SPCR_FLOW_CONTROL_RTS_CTS 0x2
+#define ACPI_SPCR_FLOW_CONTROL_XON_XOFF 0x4
+
+#define ACPI_SPCR_TERMINAL_TYPE_VT100 0
+#define ACPI_SPCR_TERMINAL_TYPE_VT100_PLUS 1
+#define ACPI_SPCR_TERMINAL_TYPE_VT_UTF8 2
+#define ACPI_SPCR_TERMINAL_TYPE_ANSI 3
+
#define BHYVE_ACPI_BASE 0xf2400
#define BASL_TABLE_ALIGNMENT 0x10
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 10, 5:50 AM (7 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15739659
Default Alt Text
D37591.id113770.diff (2 KB)
Attached To
Mode
D37591: bhyve: build SPCR ACPI table
Attached
Detach File
Event Timeline
Log In to Comment