Jonathan Zhang would like Anjaneya "Reddy" Chagam to review this change.

View Change

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 */

To view, visit change 38727. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I317dad18176fc2339072f02a5bcdcc8859596df9
Gerrit-Change-Number: 38727
Gerrit-PatchSet: 1
Gerrit-Owner: Jonathan Zhang <jonzhang@fb.com>
Gerrit-Reviewer: Anjaneya "Reddy" Chagam <anjaneya.chagam@intel.com>
Gerrit-MessageType: newchange