qemu/hw/core/platform-bus.c
/*
 * Returns the PlatformBus MMIO region offset for Region n of a SysBusDevice or
 * -1 if the region is not mapped on this Platform bus.
 */
Returns the PlatformBus MMIO region offset for Region n of a SysBusDevice or
-1 if the region is not mapped on this Platform bus.
Returns the PlatformBus MMIO region offset for Region n of a SysBusDevice or - 1 if the region is not mapped on this Platform bus .
hwaddr platform_bus_get_mmio_addr(PlatformBusDevice *pbus, SysBusDevice *sbdev,
                                  int n)
{
    MemoryRegion *pbus_mr = &pbus->mmio;
    MemoryRegion *sbdev_mr = sysbus_mmio_get_region(sbdev, n);
    Object *pbus_mr_obj = OBJECT(pbus_mr);
    Object *parent_mr;
    if (!memory_region_is_mapped(sbdev_mr)) {
        return -1;
    }
    parent_mr = object_property_get_link(OBJECT(sbdev_mr), "container", NULL);
    assert(parent_mr);
    if (parent_mr != pbus_mr_obj) {
        return -1;
    }
    return object_property_get_uint(OBJECT(sbdev_mr), "addr", NULL);
}
hwaddr platform_bus_get_mmio_addr ( PlatformBusDevice * pbus , SysBusDevice * sbdev , int n ) { MemoryRegion * pbus_mr = & pbus -> mmio ; MemoryRegion * sbdev_mr = sysbus_mmio_get_region ( sbdev , n ) ; Object * pbus_mr_obj = OBJECT ( pbus_mr ) ; Object * parent_mr ; if ( ! memory_region_is_mapped ( sbdev_mr ) ) { return -1 ; } parent_mr = object_property_get_link ( OBJECT ( sbdev_mr ) , " " , NULL ) ; assert ( parent_mr ) ; if ( parent_mr != pbus_mr_obj ) { return -1 ; } return object_property_get_uint ( OBJECT ( sbdev_mr ) , " " , NULL ) ; }
Returns the PlatformBus MMIO region offset for Region n of a SysBusDevice or
 -1 if the region is not mapped on this Platform bus.
Returns the PlatformBus MMIO region offset for Region n of a SysBusDevice or - 1 if the region is not mapped on this Platform bus .
/* Region is not mapped? */ /* MMIO region is not mapped on platform bus */