Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/41083 )
Change subject: commonlib/region: Add region_overlap ......................................................................
commonlib/region: Add region_overlap
Add inline function to check if two regions overlap.
Change-Id: I6f3dfaa9f0805893bd691ba64f112944d89a8e71 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/commonlib/include/commonlib/region.h 1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/83/41083/1
diff --git a/src/commonlib/include/commonlib/region.h b/src/commonlib/include/commonlib/region.h index 86b9ee3..cf5d2a6 100644 --- a/src/commonlib/include/commonlib/region.h +++ b/src/commonlib/include/commonlib/region.h @@ -117,6 +117,12 @@ return region_offset(r) + region_sz(r); }
+static inline bool region_overlap(const struct region *r1, const struct region *r2) +{ + return (region_end(r1) > region_offset(r2)) && + (region_offset(r1) < region_end(r2)); +} + static inline const struct region *region_device_region( const struct region_device *rdev) {
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/41083
to look at the new patch set (#2).
Change subject: commonlib/region: Add region_overlap ......................................................................
commonlib/region: Add region_overlap
Add inline function to check if two regions overlap.
Change-Id: I6f3dfaa9f0805893bd691ba64f112944d89a8e71 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/commonlib/include/commonlib/region.h 1 file changed, 7 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/83/41083/2
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41083 )
Change subject: commonlib/region: Add region_overlap ......................................................................
Patch Set 2: Code-Review+2
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41083 )
Change subject: commonlib/region: Add region_overlap ......................................................................
Patch Set 2: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/41083 )
Change subject: commonlib/region: Add region_overlap ......................................................................
commonlib/region: Add region_overlap
Add inline function to check if two regions overlap.
Change-Id: I6f3dfaa9f0805893bd691ba64f112944d89a8e71 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/41083 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Julius Werner jwerner@chromium.org Reviewed-by: Angel Pons th3fanbus@gmail.com --- M src/commonlib/include/commonlib/region.h 1 file changed, 7 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Julius Werner: Looks good to me, approved Angel Pons: Looks good to me, approved
diff --git a/src/commonlib/include/commonlib/region.h b/src/commonlib/include/commonlib/region.h index 86b9ee3..08b9191 100644 --- a/src/commonlib/include/commonlib/region.h +++ b/src/commonlib/include/commonlib/region.h @@ -7,6 +7,7 @@ #include <sys/types.h> #include <stdint.h> #include <stddef.h> +#include <stdbool.h> #include <commonlib/mem_pool.h>
/* @@ -117,6 +118,12 @@ return region_offset(r) + region_sz(r); }
+static inline bool region_overlap(const struct region *r1, const struct region *r2) +{ + return (region_end(r1) > region_offset(r2)) && + (region_offset(r1) < region_end(r2)); +} + static inline const struct region *region_device_region( const struct region_device *rdev) {
9elements QA has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41083 )
Change subject: commonlib/region: Add region_overlap ......................................................................
Patch Set 4:
Automatic boot test returned (PASS/FAIL/TOTAL): 4/0/4 Emulation targets: "QEMU x86 q35/ich9" using payload TianoCore : SUCCESS : https://lava.9esec.io/r/3271 "QEMU x86 q35/ich9" using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/3270 "QEMU x86 i440fx/piix4" using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/3269 "QEMU AArch64" using payload LinuxBoot_u-root_kexec : SUCCESS : https://lava.9esec.io/r/3268
Please note: This test is under development and might not be accurate at all!