File: bitops.h

package info (click to toggle)
lttng-modules 2.14.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,808 kB
  • sloc: ansic: 74,851; sh: 548; makefile: 62
file content (23 lines) | stat: -rw-r--r-- 609 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// SPDX-FileCopyrightText: 2024 Michael Jeanson <mjeanson@efficios.com>
// SPDX-License-Identifier: GPL-2.0-only

#ifndef _LTTNG_WRAPPER_BITOPS_H
#define _LTTNG_WRAPPER_BITOPS_H

#include <linux/bitops.h>
#include <lttng/kernel-version.h>

#if LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(5,4,0)

#include <asm/byteorder.h>

/* Set bits in the first 'n' bytes when loaded from memory */
# ifdef __LITTLE_ENDIAN
#  define lttng_aligned_byte_mask(n) ((1UL << 8*(n))-1)
# else
#  define lttng_aligned_byte_mask(n) (~0xffUL << (BITS_PER_LONG - 8 - 8*(n)))
# endif

#endif

#endif /* _LTTNG_WRAPPER_BITOPS_H */