2 * SPDX-License-Identifier: MIT
4 * Copyright (C) 2010-2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 #ifndef _UST_COMMON_ALIGN_H
8 #define _UST_COMMON_ALIGN_H
14 #include <machine/param.h>
18 #define LTTNG_UST_PAGE_SIZE sysconf(_SC_PAGE_SIZE)
19 #elif defined(PAGE_SIZE)
20 #define LTTNG_UST_PAGE_SIZE PAGE_SIZE
22 #error "Please add page size detection for your OS."
25 #define LTTNG_UST_PAGE_MASK (~(LTTNG_UST_PAGE_SIZE - 1))
27 #define __LTTNG_UST_ALIGN_MASK(v, mask) (((v) + (mask)) & ~(mask))
28 #define LTTNG_UST_ALIGN(v, align) __LTTNG_UST_ALIGN_MASK(v, (__typeof__(v)) (align) - 1)
29 #define LTTNG_UST_PAGE_ALIGN(addr) LTTNG_UST_ALIGN(addr, LTTNG_UST_PAGE_SIZE)
31 #endif /* _UST_COMMON_ALIGN_H */
This page took 0.039313 seconds and 5 git commands to generate.