On 09/26/2014 02:05 PM, Paolo Bonzini wrote:
Il 24/09/2014 17:22, Alexander Graf ha scritto:
+    if (!memory_region_is_mapped(sbdev_mr)) {
+        /* Region is not mapped? */
+        return -1;
+    }
+
+    parent_mr = object_property_get_link(OBJECT(sbdev_mr), "container", NULL);
+
+    assert(parent_mr);
+    if (parent_mr != pbus_mr_obj) {
+        /* MMIO region is not mapped on platform bus */
+        return -1;
+    }
+
+    return object_property_get_int(OBJECT(sbdev_mr), "addr", NULL);
I think this should try going through the parent recursively until
reaching NULL (which would fail) or pbus_mr_obj.

Are you sure? Imagine one sysbus device includes another. We only want to look at the region the lowest sysbus device exposes, no?


Alex


Reply via email to