Skip to content

Commit 078178b

Browse files
javedmlijinxia
authored andcommitted
DM: Fixes issue #592 NHLT is not detected on audio passthru.
When XSDT is created by DM, if audio passthru is enabled for audio device (0:e:0), an entry is added in XSDT that references the NHLT table. With this fix, NHLT appears in the kernel boot log for ACPI and entry can be seen in /sys/firmware/acpi/tables/NHLT. Signed-off-by: Madeeha Javed <madeeha_javed@mentor.com>
1 parent 3e2d1fb commit 078178b

File tree

1 file changed

+13
-1
lines changed
  • devicemodel/hw/platform/acpi

1 file changed

+13
-1
lines changed

devicemodel/hw/platform/acpi/acpi.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ struct basl_fio {
114114
#define EFPRINTF(...) fprintf(__VA_ARGS__)
115115
#define EFFLUSH(x) fflush(x)
116116

117+
static bool acpi_table_is_valid(int num);
118+
117119
static int
118120
basl_fwrite_rsdp(FILE *fp, struct vmctx *ctx)
119121
{
@@ -198,6 +200,10 @@ basl_fwrite_xsdt(FILE *fp, struct vmctx *ctx)
198200
EFPRINTF(fp, "[0004]\t\tACPI Table Address 3 : 00000000%08X\n",
199201
basl_acpi_base + MCFG_OFFSET);
200202

203+
if (acpi_table_is_valid(NHLT_ENTRY_NO))
204+
EFPRINTF(fp, "[0004]\t\tACPI Table Address 4 : 00000000%08X\n",
205+
basl_acpi_base + NHLT_OFFSET);
206+
201207
EFFLUSH(fp);
202208

203209
return 0;
@@ -976,6 +982,12 @@ acpi_table_enable(int num)
976982
basl_ftables[num].valid = true;
977983
}
978984

985+
static bool
986+
acpi_table_is_valid(int num)
987+
{
988+
return basl_ftables[num].valid;
989+
}
990+
979991
uint32_t
980992
get_acpi_base(void)
981993
{
@@ -1018,7 +1030,7 @@ acpi_build(struct vmctx *ctx, int ncpu)
10181030
* copying them into guest memory
10191031
*/
10201032
while (!err && (i < ARRAY_SIZE(basl_ftables))) {
1021-
if (basl_ftables[i].valid)
1033+
if (acpi_table_is_valid(i))
10221034
err = basl_compile(ctx, basl_ftables[i].wsect,
10231035
basl_ftables[i].offset);
10241036
i++;

0 commit comments

Comments
 (0)