diff --git a/repos/os/include/pci/config.h b/repos/os/include/pci/config.h index 6e2580257b..d7751bd24e 100644 --- a/repos/os/include/pci/config.h +++ b/repos/os/include/pci/config.h @@ -142,10 +142,17 @@ struct Pci::Config : Genode::Mmio bool prefetchable() { return Bar_32bit::Memory_prefetchable::get(_conf()); } - Genode::size_t size() + Genode::uint64_t size() { - return 1 + (memory() ? ~Bar_32bit::Memory_base::masked(_conf()) - : ~Bar_32bit::Io_base::masked(_conf())); + if (memory()) { + Genode::uint64_t size = 1 + ~Bar_32bit::Memory_base::masked(_conf()); + if (bit64()) + size += ((Genode::uint64_t)~_get_and_set(read()))<<32; + + return size; + } + else + return 1 + ~Bar_32bit::Io_base::masked(_conf()); } Genode::uint64_t addr() diff --git a/repos/os/src/app/pci_decode/main.cc b/repos/os/src/app/pci_decode/main.cc index 653e49e189..c77be1054e 100644 --- a/repos/os/src/app/pci_decode/main.cc +++ b/repos/os/src/app/pci_decode/main.cc @@ -139,7 +139,7 @@ bus_t Main::parse_pci_function(Bdf bdf, } }); - cfg.for_each_bar([&] (uint64_t addr, size_t size, + cfg.for_each_bar([&] (uint64_t addr, uint64_t size, unsigned bar, bool pf) { gen.node("io_mem", [&] @@ -149,7 +149,7 @@ bus_t Main::parse_pci_function(Bdf bdf, gen.attribute("size", string(size)); if (pf) gen.attribute("prefetchable", true); }); - }, [&] (uint64_t addr, size_t size, unsigned bar) { + }, [&] (uint64_t addr, uint64_t size, unsigned bar) { gen.node("io_port_range", [&] { gen.attribute("pci_bar", bar);