Thread (14 messages) flat view 14 messages, 6 authors, 2007-09-19

Re: [PATCH] [RFC][POWERPC] Merge 32 and 64 bit pci_process_bridge_OF_ranges() instances

From: Segher Boessenkool <hidden>
Date: 2007-09-13 02:10:00

quoted
quoted
quoted
+struct ranges_pci {
+	unsigned int pci_space;
+	u64 pci_addr;
+	phys_addr_t phys_addr;
+	u64 size;
+} __attribute__((packed));
+
This structure definition uses unaligned members because of the
'packed' attribute. Is that really what you intended?
yes, exactly, because I'm mapping this struct on ranges extracted from
the dts instead of juggling with ranges[foo] offsets.
I see. It does however look wrong to me, because you are using a 
hardcoded
phys_addr_t type. This breaks when phys_addr has a different size from 
what
you expect, e.g. when booting a pure 32 bit kernel on a machine that 
has
a 64 bit physical address space.
More generally, you can even have a different size for the "phys_addr"
for different nodes in the same device tree.

You really should look at the #address-cells in this node's parent,
and translate that all the way up to the root node to get a CPU
address.


Segher
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help