Patrick Georgi (pgeorgi@google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10392
-gerrit
commit f51e62b54692fcdbdffd3935e1ca802186abf468 Author: Julius Werner jwerner@chromium.org Date: Fri May 22 18:18:46 2015 -0700
libpayload: Add div_round_up() function
The lack of a div_round_up() function in libpayload keeps being a problem for payloads and has already caused us to sprinkle numerous less-readable ALIGN_UP(n, d) / d throughout depthcharge. Let's add this so we can avoid adding any more and then maybe cocchinelle them all over later.
BRANCH=None BUG=None TEST=None
Change-Id: I241a52770a0edcf7003b48a81875b3fa0cb7ed53 Signed-off-by: Patrick Georgi pgeorgi@chromium.org Original-Commit-Id: a3f9514f9cfd325cc3c4b542020574b605fac935 Original-Change-Id: Ia55bd4bc52ab8a249b4854e40727cf6917af7b30 Original-Signed-off-by: Julius Werner jwerner@chromium.org Original-Reviewed-on: https://chromium-review.googlesource.com/273050 Original-Reviewed-by: Patrick Georgi pgeorgi@chromium.org --- payloads/libpayload/include/libpayload.h | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/payloads/libpayload/include/libpayload.h b/payloads/libpayload/include/libpayload.h index 0be0d8e..781a41d 100644 --- a/payloads/libpayload/include/libpayload.h +++ b/payloads/libpayload/include/libpayload.h @@ -66,6 +66,8 @@ #define MAX(a,b) ((a) > (b) ? (a) : (b)) #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+static inline u32 div_round_up(u32 n, u32 d) { return n + d - 1 / d; } + #define LITTLE_ENDIAN 1234 #define BIG_ENDIAN 4321