/* * \brief DMA remapping hardware reporting from ACPI information in list models * \author Johannes Schlatow * \date 2023-08-14 */ /* * Copyright (C) 2023 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU Affero General Public License version 3. */ #include #include #include using namespace Genode; using namespace Pci; struct Drhd : List_model::Element { using Drhd_name = String<16>; enum Scope { INCLUDE_PCI_ALL, EXPLICIT }; addr_t addr; size_t size; unsigned segment; Scope scope; unsigned number; struct Device : Registry::Element { Bdf bdf; Device(Registry & registry, Bdf bdf) : Registry::Element(registry, *this), bdf(bdf) { } }; Registry devices { }; Drhd(addr_t addr, size_t size, unsigned segment, Scope scope, unsigned number) : addr(addr), size(size), segment(segment), scope(scope), number(number) { } Drhd_name name() const { return Drhd_name("drhd", number); } bool matches(Xml_node const &node) const { return addr == node.attribute_value("phys", 0UL); } static bool type_matches(Xml_node const &node) { return node.has_type("drhd"); } };