Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Nov 2022 08:31:37 GMT
From:      =?utf-8?Q?Corvin=20K=C3=B6hne?= <corvink@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 60277ad75ec9 - main - bhyve: add helper to fill a ACPI_GENERIC_ADDRESS
Message-ID:  <202211210831.2AL8Vb2R026451@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by corvink:

URL: https://cgit.FreeBSD.org/src/commit/?id=60277ad75ec905d25182368d1022f56f43b490d5

commit 60277ad75ec905d25182368d1022f56f43b490d5
Author:     Corvin Köhne <corvink@FreeBSD.org>
AuthorDate: 2022-11-16 09:45:17 +0000
Commit:     Corvin Köhne <corvink@FreeBSD.org>
CommitDate: 2022-11-21 08:27:54 +0000

    bhyve: add helper to fill a ACPI_GENERIC_ADDRESS
    
    Reviewed by:            jhb
    Approved by:            manu (mentor)
    MFC after:              2 weeks
    Sponsored by:           Beckhoff Automation GmbH & Co. KG
    Differential Revision:  https://reviews.freebsd.org/D37407
---
 usr.sbin/bhyve/basl.c | 14 ++++++++++++++
 usr.sbin/bhyve/basl.h |  3 +++
 2 files changed, 17 insertions(+)

diff --git a/usr.sbin/bhyve/basl.c b/usr.sbin/bhyve/basl.c
index 716393caeebe..3333ecbc870c 100644
--- a/usr.sbin/bhyve/basl.c
+++ b/usr.sbin/bhyve/basl.c
@@ -121,6 +121,20 @@ basl_dump(const bool mem)
 	return (0);
 }
 
+void
+basl_fill_gas(ACPI_GENERIC_ADDRESS *const gas, const uint8_t space_id,
+    const uint8_t bit_width, const uint8_t bit_offset,
+    const uint8_t access_width, const 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);
+}
+
 static int
 basl_finish_install_guest_tables(struct basl_table *const table)
 {
diff --git a/usr.sbin/bhyve/basl.h b/usr.sbin/bhyve/basl.h
index 0fe4ef7c5e82..9c7ba0c84229 100644
--- a/usr.sbin/bhyve/basl.h
+++ b/usr.sbin/bhyve/basl.h
@@ -40,6 +40,9 @@
 
 struct basl_table;
 
+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);
 int basl_finish(void);
 int basl_init(void);
 int basl_table_add_checksum(struct basl_table *const table, const uint32_t off,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202211210831.2AL8Vb2R026451>