Page MenuHomeFreeBSD

D4518.diff
No OneTemporary

D4518.diff

Index: head/sys/arm64/include/ofw_machdep.h
===================================================================
--- head/sys/arm64/include/ofw_machdep.h
+++ head/sys/arm64/include/ofw_machdep.h
@@ -41,4 +41,7 @@
vm_size_t mr_size;
};
+/* FDT follows ePAPR */
+#define OFW_EPAPR
+
#endif /* _MACHINE_OFW_MACHDEP_H_ */
Index: head/sys/dev/ofw/ofw_bus_subr.c
===================================================================
--- head/sys/dev/ofw/ofw_bus_subr.c
+++ head/sys/dev/ofw/ofw_bus_subr.c
@@ -341,6 +341,7 @@
uint8_t *uiregs = regs;
uint8_t *uiimapmsk = imapmsk;
uint8_t *mptr;
+ pcell_t paddrsz;
pcell_t pintrsz;
int i, rsz, tsz;
@@ -357,19 +358,31 @@
mptr = imap;
i = imapsz;
+ paddrsz = 0;
while (i > 0) {
bcopy(mptr + physsz + intrsz, &parent, sizeof(parent));
+#ifdef OFW_EPAPR
+ /*
+ * Find if we need to read the parent address data. Sparc64
+ * uses a different encoding that doesn't include this data.
+ */
+ if (OF_getencprop(OF_node_from_xref(parent),
+ "#address-cells", &paddrsz, sizeof(paddrsz)) == -1)
+ paddrsz = 0; /* default */
+ paddrsz *= sizeof(pcell_t);
+#endif
+
if (OF_searchencprop(OF_node_from_xref(parent),
"#interrupt-cells", &pintrsz, sizeof(pintrsz)) == -1)
pintrsz = 1; /* default */
pintrsz *= sizeof(pcell_t);
/* Compute the map stride size. */
- tsz = physsz + intrsz + sizeof(phandle_t) + pintrsz;
+ tsz = physsz + intrsz + sizeof(phandle_t) + paddrsz + pintrsz;
KASSERT(i >= tsz, ("ofw_bus_search_intrmap: truncated map"));
if (bcmp(ref, mptr, physsz + intrsz) == 0) {
- bcopy(mptr + physsz + intrsz + sizeof(parent),
+ bcopy(mptr + physsz + intrsz + sizeof(parent) + paddrsz,
result, MIN(rintrsz, pintrsz));
if (iparent != NULL)

File Metadata

Mime Type
text/plain
Expires
Sun, Oct 19, 4:06 AM (58 m, 55 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
23909508
Default Alt Text
D4518.diff (1 KB)

Event Timeline