diff options
Diffstat (limited to 'src/commonlib')
-rw-r--r-- | src/commonlib/include/commonlib/region.h | 10 | ||||
-rw-r--r-- | src/commonlib/region.c | 5 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/commonlib/include/commonlib/region.h b/src/commonlib/include/commonlib/region.h index f27a494d39..39db1bb627 100644 --- a/src/commonlib/include/commonlib/region.h +++ b/src/commonlib/include/commonlib/region.h @@ -122,6 +122,11 @@ static inline size_t region_sz(const struct region *r) return r->size; } +static inline size_t region_end(const struct region *r) +{ + return region_offset(r) + region_sz(r); +} + static inline const struct region *region_device_region( const struct region_device *rdev) { @@ -138,6 +143,11 @@ static inline size_t region_device_offset(const struct region_device *rdev) return region_offset(region_device_region(rdev)); } +static inline size_t region_device_end(const struct region_device *rdev) +{ + return region_end(region_device_region(rdev)); +} + /* Memory map entire region device. Same semantics as rdev_mmap() above. */ static inline void *rdev_mmap_full(const struct region_device *rd) { diff --git a/src/commonlib/region.c b/src/commonlib/region.c index ca7b6efe4b..4a7e285747 100644 --- a/src/commonlib/region.c +++ b/src/commonlib/region.c @@ -15,11 +15,6 @@ #include <commonlib/region.h> #include <string.h> -static inline size_t region_end(const struct region *r) -{ - return region_sz(r) + region_offset(r); -} - int region_is_subregion(const struct region *p, const struct region *c) { if (region_offset(c) < region_offset(p)) |