Date: Fri, 1 May 2020 10:25:07 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360530 - head/sys/compat/linuxkpi/common/include/linux Message-ID: <202005011025.041AP7Di085493@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Fri May 1 10:25:07 2020 New Revision: 360530 URL: https://svnweb.freebsd.org/changeset/base/360530 Log: Implement DIV64_U64_ROUND_UP() in the LinuxKPI. Submitted by: ashafer_badland.io (Austin Shafer) MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/math64.h Modified: head/sys/compat/linuxkpi/common/include/linux/math64.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/math64.h Fri May 1 10:18:07 2020 (r360529) +++ head/sys/compat/linuxkpi/common/include/linux/math64.h Fri May 1 10:25:07 2020 (r360530) @@ -91,4 +91,13 @@ mul_u32_u32(uint32_t a, uint32_t b) return ((uint64_t)a * b); } +static inline uint64_t +div64_u64_round_up(uint64_t dividend, uint64_t divisor) +{ + return ((dividend + divisor - 1) / divisor); +} + +#define DIV64_U64_ROUND_UP(...) \ + div64_u64_round_up(__VA_ARGS__) + #endif /* _LINUX_MATH64_H */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005011025.041AP7Di085493>