diff options
Diffstat (limited to 'src/include/util/align.H')
| -rw-r--r-- | src/include/util/align.H | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/include/util/align.H b/src/include/util/align.H index 3ac7eee97..7ff67ba38 100644 --- a/src/include/util/align.H +++ b/src/include/util/align.H @@ -25,7 +25,13 @@ #include <limits.h> +// Return a number >= input that is aligned on a 4-byte boundary #define ALIGN_4(u) ((u + 0x3ull) & ~0x3ull) + +// Return a number >= input that is aligned on a page boundary #define ALIGN_PAGE(u) ((u + (PAGESIZE-1)) & ~(PAGESIZE-1)) +// Return a number <= input that is aligned on a page boundary +#define ALIGN_PAGE_DOWN(u) ((u) - (u)%PAGESIZE) + #endif |

