20 #include "pedigree/kernel/machine/ppc_common/pci.h" 21 #include "pedigree/kernel/Log.h" 22 #include "pedigree/kernel/machine/Device.h" 23 #include "pedigree/kernel/machine/openfirmware/Device.h" 24 #include "pedigree/kernel/processor/Processor.h" 25 #include "pedigree/kernel/processor/types.h" 58 static void calculateAddresses(
Device *node)
63 ssize_t len = dev.getProperty(
74 uint32_t addressSpaceMask = addresses[i].
s << 24;
79 OFDevice parentDev(parent->getOFHandle());
82 parentDev.getProperty(
"ranges", ranges,
sizeof(
Range) * 16);
91 for (
int j = 0; j < len2 /
sizeof(
Range); j++)
95 if ((ranges[j].child_hi & addressSpaceMask) == 0)
99 if ((ranges[j].child_lo <= addresses[i].address_lo) &&
100 ((ranges[j].child_lo + ranges[j].size_lo) >
101 addresses[i].address_lo))
104 addresses[i].address_lo -= ranges[j].child_lo;
105 addresses[i].address_lo += ranges[j].parent_lo;
112 switch (addresses[i].r)
133 barStr =
"unknown bar";
137 String(barStr), addresses[i].address_lo, addresses[i].size_lo,
143 static void searchNode(
Device *pDev)
152 calculateAddresses(pChild);
156 calculateAddresses(pGrandChild);
Device * getChild(size_t n)
virtual String getSpecificType()
virtual Vector< Address * > & addresses()
uint32_t s
Address space identifier - Memory/IO.
uint32_t parent_lo
32-bit parent range start address.
uint32_t size_lo
Size of the range, in bytes.
uint32_t address_hi
High 32 bits of address. Unused.
uint32_t size_lo
Low 32 bits of size.
uint32_t address_lo
Low 32 bits of assigned address.
uint32_t parent_hi
Unused.
Device * getParent() const
uint32_t size_hi
High 32 bits of size. Unused.