From 7b99a43c9e5fb29a71e174ce5d14b32d6ff5d2f5 Mon Sep 17 00:00:00 2001 From: Johannes Schlatow Date: Fri, 18 Aug 2023 16:33:54 +0200 Subject: [PATCH] acpi_drv: add size attribute to drhd genodelabs/genode#5002 --- repos/os/src/drivers/acpi/acpi.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/repos/os/src/drivers/acpi/acpi.cc b/repos/os/src/drivers/acpi/acpi.cc index 4a537bec8f..05166147d5 100644 --- a/repos/os/src/drivers/acpi/acpi.cc +++ b/repos/os/src/drivers/acpi/acpi.cc @@ -198,6 +198,8 @@ struct Dmar_drhd : Genode::Mmio { struct Length : Register<0x2, 16> { }; struct Flags : Register<0x4, 8> { }; + struct Size : Register<0x5, 8> { + struct Num_pages : Bitfield<0,4> { }; }; struct Segment : Register<0x6, 16> { }; struct Phys : Register<0x8, 64> { }; @@ -1672,10 +1674,13 @@ void Acpi::generate_report(Genode::Env &env, Genode::Allocator &alloc) if (dmar.read() == Dmar_common::Type::DRHD) { Dmar_drhd drhd(dmar.base()); + size_t size_log2 = drhd.read() + 12; + xml.node("drhd", [&] () { attribute_hex(xml, "phys", drhd.read()); attribute_hex(xml, "flags", drhd.read()); attribute_hex(xml, "segment", drhd.read()); + attribute_hex(xml, "size", 1 << size_log2); drhd.apply(func_scope); }); }