memory: Add offset_in_region to flatview_cb arguments

The function flatview_for_each_range() calls a callback for each
range in a FlatView.  Currently the callback gets the start and
length of the range and the MemoryRegion involved, but not the offset
within the MemoryRegion.  Add this to the callback's arguments; we're
going to want it for a new use in the next commit.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20210318174823.18066-4-peter.maydell@linaro.org
This commit is contained in:
Peter Maydell 2021-03-18 17:48:21 +00:00
parent a5e32ec1ed
commit b3566001d4
3 changed files with 9 additions and 2 deletions

View file

@ -671,8 +671,10 @@ void flatview_for_each_range(FlatView *fv, flatview_cb cb , void *opaque)
assert(cb);
FOR_EACH_FLAT_RANGE(fr, fv) {
if (cb(fr->addr.start, fr->addr.size, fr->mr, opaque))
if (cb(fr->addr.start, fr->addr.size, fr->mr,
fr->offset_in_region, opaque)) {
break;
}
}
}