Hello Anjaneya "Reddy" Chagam,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/38727
to review the following change.
Change subject: device: Expose round() ......................................................................
device: Expose round()
This function is needed by Skylake-SP SOC code, so exposing it.
Signed-off-by: Jonathan Zhang jonzhang@fb.com Signed-off-by: Reddy Chagam anjaneya.chagam@intel.com Change-Id: I317dad18176fc2339072f02a5bcdcc8859596df9 --- M src/device/device.c M src/include/device/device.h 2 files changed, 10 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/27/38727/1
diff --git a/src/device/device.c b/src/device/device.c index 236b768..9bd8f45 100644 --- a/src/device/device.c +++ b/src/device/device.c @@ -162,7 +162,7 @@ * @param pow Alignment as a power of two. * @return Rounded up number. */ -static resource_t round(resource_t val, unsigned long pow) +resource_t round(resource_t val, unsigned long pow) { resource_t mask; mask = (1ULL << pow) - 1ULL; diff --git a/src/include/device/device.h b/src/include/device/device.h index 2d7400b..9a7bacd 100644 --- a/src/include/device/device.h +++ b/src/include/device/device.h @@ -322,4 +322,13 @@ void scan_generic_bus(struct device *bus); void scan_static_bus(struct device *bus);
+/** + * Round a number up to an alignment. + * + * @param val The starting value. + * @param pow Alignment as a power of two. + * @return Rounded up number. + */ +resource_t round(resource_t val, unsigned long pow); + #endif /* DEVICE_H */