mirror of
https://github.com/genodelabs/genode.git
synced 2025-05-24 19:24:25 +00:00
parent
02209e5455
commit
70c57a3be3
@ -142,10 +142,17 @@ struct Pci::Config : Genode::Mmio
|
|||||||
bool prefetchable() {
|
bool prefetchable() {
|
||||||
return Bar_32bit::Memory_prefetchable::get(_conf()); }
|
return Bar_32bit::Memory_prefetchable::get(_conf()); }
|
||||||
|
|
||||||
Genode::size_t size()
|
Genode::uint64_t size()
|
||||||
{
|
{
|
||||||
return 1 + (memory() ? ~Bar_32bit::Memory_base::masked(_conf())
|
if (memory()) {
|
||||||
: ~Bar_32bit::Io_base::masked(_conf()));
|
Genode::uint64_t size = 1 + ~Bar_32bit::Memory_base::masked(_conf());
|
||||||
|
if (bit64())
|
||||||
|
size += ((Genode::uint64_t)~_get_and_set<Upper_bits>(read<Upper_bits>()))<<32;
|
||||||
|
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return 1 + ~Bar_32bit::Io_base::masked(_conf());
|
||||||
}
|
}
|
||||||
|
|
||||||
Genode::uint64_t addr()
|
Genode::uint64_t addr()
|
||||||
|
@ -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)
|
unsigned bar, bool pf)
|
||||||
{
|
{
|
||||||
gen.node("io_mem", [&]
|
gen.node("io_mem", [&]
|
||||||
@ -149,7 +149,7 @@ bus_t Main::parse_pci_function(Bdf bdf,
|
|||||||
gen.attribute("size", string(size));
|
gen.attribute("size", string(size));
|
||||||
if (pf) gen.attribute("prefetchable", true);
|
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.node("io_port_range", [&]
|
||||||
{
|
{
|
||||||
gen.attribute("pci_bar", bar);
|
gen.attribute("pci_bar", bar);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user