Date: Mon, 18 May 2020 09:24:05 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r361194 - stable/12/sys/compat/linuxkpi/common/include/linux Message-ID: <202005180924.04I9O5hx064660@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Mon May 18 09:24:05 2020 New Revision: 361194 URL: https://svnweb.freebsd.org/changeset/base/361194 Log: MFC r360530: Implement DIV64_U64_ROUND_UP() in the LinuxKPI. Submitted by: ashafer_badland.io (Austin Shafer) Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/math64.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/math64.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/math64.h Mon May 18 09:23:18 2020 (r361193) +++ stable/12/sys/compat/linuxkpi/common/include/linux/math64.h Mon May 18 09:24:05 2020 (r361194) @@ -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?202005180924.04I9O5hx064660>