git: 97f2e93a66a8 - main - LinuxKPI: add ALIGN_DOWN()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 08 Apr 2022 18:29:36 UTC
The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=97f2e93a66a804ae9b6187998dbc4427b647e274 commit 97f2e93a66a804ae9b6187998dbc4427b647e274 Author: Bjoern A. Zeeb <bz@FreeBSD.org> AuthorDate: 2022-04-08 15:30:19 +0000 Commit: Bjoern A. Zeeb <bz@FreeBSD.org> CommitDate: 2022-04-08 18:27:49 +0000 LinuxKPI: add ALIGN_DOWN() Add ALIGN_DOWN as rounddown2() along ALIGN() which is implemented as roundup2(). Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: manu, hselasky (now with less ()) Differential Revision: https://reviews.freebsd.org/D34844 --- sys/compat/linuxkpi/common/include/linux/kernel.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h index 8fb92dd2f93e..51f2ffe01e15 100644 --- a/sys/compat/linuxkpi/common/include/linux/kernel.h +++ b/sys/compat/linuxkpi/common/include/linux/kernel.h @@ -150,6 +150,7 @@ extern int linuxkpi_warn_dump_stack; #undef ALIGN #define ALIGN(x, y) roundup2((x), (y)) +#define ALIGN_DOWN(x, y) rounddown2(x, y) #undef PTR_ALIGN #define PTR_ALIGN(p, a) ((__typeof(p))ALIGN((uintptr_t)(p), (a))) #define IS_ALIGNED(x, a) (((x) & ((__typeof(x))(a) - 1)) == 0)