Attention is currently required from: Zheng Bao.
Hello Zheng Bao,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/74259
to review the following change.
Change subject: fmap/region: Call the munmap of access_dev in xlate_windows ......................................................................
fmap/region: Call the munmap of access_dev in xlate_windows
Change-Id: I73f2f78d64a521b6da613228339e09065e37be88 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/commonlib/region.c 1 file changed, 23 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/74259/1
diff --git a/src/commonlib/region.c b/src/commonlib/region.c index 4153f0a..41662e1 100644 --- a/src/commonlib/region.c +++ b/src/commonlib/region.c @@ -369,17 +369,20 @@ return rdev_mmap(xlwindow->access_dev, offset, size); }
-static int xlate_munmap(const struct region_device *rd __always_unused, - void *mapping __always_unused) +static int xlate_munmap(const struct region_device *rd, + void *mapping) { - /* - * xlate_region_device does not keep track of the access device that was used to service - * a mmap request. So, munmap does not do anything. If munmap functionality is required, - * then xlate_region_device will have to be updated to accept some pre-allocated space - * from caller to keep track of the mapping requests. Since xlate_region_device is only - * used for memory mapped boot media on the backend right now, skipping munmap is fine. - */ - return 0; + /* TODO: Call the access_dev munmap */ + const struct xlate_region_device *xldev; + const struct xlate_window *xlwindow; + + xldev = container_of(rd, __typeof__(*xldev), rdev); + + xlwindow = &xldev->window_arr[0]; + if (!xlwindow) + return 0; + + return rdev_munmap(xlwindow->access_dev, mapping); }
static ssize_t xlate_readat(const struct region_device *rd, void *b,