17e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh/****************************************************************************
27e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh ****************************************************************************
37e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh ***
47e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh ***   This header was automatically generated from a Linux kernel header
57e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh ***   of the same name, to make information necessary for userspace to
67e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh ***   call into the kernel available to libc.  It contains only constants,
77e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh ***   structures, and macros generated from the original header, and thus,
87e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh ***   contains no copyrightable information.
97e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh ***
107e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh ***   To edit the content of this header, modify the corresponding
117e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh ***   source file (e.g. under external/kernel-headers/original/) then
127e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh ***   run bionic/libc/kernel/tools/update_all.py
137e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh ***
147e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh ***   Any manual change here will be lost the next time this script will
157e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh ***   be run. You've been warned!
167e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh ***
177e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh ****************************************************************************
187e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh ****************************************************************************/
197e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh#ifndef _PERF_LINUX_BITOPS_H_
207e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh#define _PERF_LINUX_BITOPS_H_
217e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
227e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh#ifndef __WORDSIZE
237e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh#define __WORDSIZE (__SIZEOF_LONG__ * 8)
247e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh#endif
257e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
267e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh#define BITS_PER_LONG __WORDSIZE
277e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh#define BITS_PER_BYTE 8
287e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long))
297e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh#define BITS_TO_U64(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(u64))
307e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
317e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh#define BITS_TO_U32(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(u32))
327e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh#define BITS_TO_BYTES(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE)
337e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh#define for_each_set_bit(bit,addr,size) for((bit) = find_first_bit((addr), (size)); (bit) < (size); (bit) = find_next_bit((addr), (size), (bit) + 1))
347e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh#define for_each_set_bit_from(bit,addr,size) for((bit) = find_next_bit((addr), (size), (bit)); (bit) < (size); (bit) = find_next_bit((addr), (size), (bit) + 1))
357e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
367e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh#define BITOP_WORD(nr) ((nr) / BITS_PER_LONG)
377e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh#if BITS_PER_LONG == 64
387e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh#endif
397e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh#endif
407e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
417e2f4e9d384d501cf86118ebac4b8de2b86eac53Than McIntosh
42