diff options
author | Srikant Patnaik | 2015-01-11 12:28:04 +0530 |
---|---|---|
committer | Srikant Patnaik | 2015-01-11 12:28:04 +0530 |
commit | 871480933a1c28f8a9fed4c4d34d06c439a7a422 (patch) | |
tree | 8718f573808810c2a1e8cb8fb6ac469093ca2784 /ANDROID_3.4.5/tools/perf/util/include/linux | |
parent | 9d40ac5867b9aefe0722bc1f110b965ff294d30d (diff) | |
download | FOSSEE-netbook-kernel-source-871480933a1c28f8a9fed4c4d34d06c439a7a422.tar.gz FOSSEE-netbook-kernel-source-871480933a1c28f8a9fed4c4d34d06c439a7a422.tar.bz2 FOSSEE-netbook-kernel-source-871480933a1c28f8a9fed4c4d34d06c439a7a422.zip |
Moved, renamed, and deleted files
The original directory structure was scattered and unorganized.
Changes are basically to make it look like kernel structure.
Diffstat (limited to 'ANDROID_3.4.5/tools/perf/util/include/linux')
15 files changed, 0 insertions, 407 deletions
diff --git a/ANDROID_3.4.5/tools/perf/util/include/linux/bitmap.h b/ANDROID_3.4.5/tools/perf/util/include/linux/bitmap.h deleted file mode 100644 index bb162e40..00000000 --- a/ANDROID_3.4.5/tools/perf/util/include/linux/bitmap.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef _PERF_BITOPS_H -#define _PERF_BITOPS_H - -#include <string.h> -#include <linux/bitops.h> - -int __bitmap_weight(const unsigned long *bitmap, int bits); -void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1, - const unsigned long *bitmap2, int bits); - -#define BITMAP_LAST_WORD_MASK(nbits) \ -( \ - ((nbits) % BITS_PER_LONG) ? \ - (1UL<<((nbits) % BITS_PER_LONG))-1 : ~0UL \ -) - -#define small_const_nbits(nbits) \ - (__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG) - -static inline void bitmap_zero(unsigned long *dst, int nbits) -{ - if (small_const_nbits(nbits)) - *dst = 0UL; - else { - int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long); - memset(dst, 0, len); - } -} - -static inline int bitmap_weight(const unsigned long *src, int nbits) -{ - if (small_const_nbits(nbits)) - return hweight_long(*src & BITMAP_LAST_WORD_MASK(nbits)); - return __bitmap_weight(src, nbits); -} - -static inline void bitmap_or(unsigned long *dst, const unsigned long *src1, - const unsigned long *src2, int nbits) -{ - if (small_const_nbits(nbits)) - *dst = *src1 | *src2; - else - __bitmap_or(dst, src1, src2, nbits); -} - -#endif /* _PERF_BITOPS_H */ diff --git a/ANDROID_3.4.5/tools/perf/util/include/linux/bitops.h b/ANDROID_3.4.5/tools/perf/util/include/linux/bitops.h deleted file mode 100644 index f1584833..00000000 --- a/ANDROID_3.4.5/tools/perf/util/include/linux/bitops.h +++ /dev/null @@ -1,151 +0,0 @@ -#ifndef _PERF_LINUX_BITOPS_H_ -#define _PERF_LINUX_BITOPS_H_ - -#include <linux/kernel.h> -#include <linux/compiler.h> -#include <asm/hweight.h> - -#define BITS_PER_LONG __WORDSIZE -#define BITS_PER_BYTE 8 -#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) - -#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)) - -/* same as for_each_set_bit() but use bit as value to start with */ -#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)) - -static inline void set_bit(int nr, unsigned long *addr) -{ - addr[nr / BITS_PER_LONG] |= 1UL << (nr % BITS_PER_LONG); -} - -static inline void clear_bit(int nr, unsigned long *addr) -{ - addr[nr / BITS_PER_LONG] &= ~(1UL << (nr % BITS_PER_LONG)); -} - -static __always_inline int test_bit(unsigned int nr, const unsigned long *addr) -{ - return ((1UL << (nr % BITS_PER_LONG)) & - (((unsigned long *)addr)[nr / BITS_PER_LONG])) != 0; -} - -static inline unsigned long hweight_long(unsigned long w) -{ - return sizeof(w) == 4 ? hweight32(w) : hweight64(w); -} - -#define BITOP_WORD(nr) ((nr) / BITS_PER_LONG) - -/** - * __ffs - find first bit in word. - * @word: The word to search - * - * Undefined if no bit exists, so code should check against 0 first. - */ -static __always_inline unsigned long __ffs(unsigned long word) -{ - int num = 0; - -#if BITS_PER_LONG == 64 - if ((word & 0xffffffff) == 0) { - num += 32; - word >>= 32; - } -#endif - if ((word & 0xffff) == 0) { - num += 16; - word >>= 16; - } - if ((word & 0xff) == 0) { - num += 8; - word >>= 8; - } - if ((word & 0xf) == 0) { - num += 4; - word >>= 4; - } - if ((word & 0x3) == 0) { - num += 2; - word >>= 2; - } - if ((word & 0x1) == 0) - num += 1; - return num; -} - -/* - * Find the first set bit in a memory region. - */ -static inline unsigned long -find_first_bit(const unsigned long *addr, unsigned long size) -{ - const unsigned long *p = addr; - unsigned long result = 0; - unsigned long tmp; - - while (size & ~(BITS_PER_LONG-1)) { - if ((tmp = *(p++))) - goto found; - result += BITS_PER_LONG; - size -= BITS_PER_LONG; - } - if (!size) - return result; - - tmp = (*p) & (~0UL >> (BITS_PER_LONG - size)); - if (tmp == 0UL) /* Are any bits set? */ - return result + size; /* Nope. */ -found: - return result + __ffs(tmp); -} - -/* - * Find the next set bit in a memory region. - */ -static inline unsigned long -find_next_bit(const unsigned long *addr, unsigned long size, unsigned long offset) -{ - const unsigned long *p = addr + BITOP_WORD(offset); - unsigned long result = offset & ~(BITS_PER_LONG-1); - unsigned long tmp; - - if (offset >= size) - return size; - size -= result; - offset %= BITS_PER_LONG; - if (offset) { - tmp = *(p++); - tmp &= (~0UL << offset); - if (size < BITS_PER_LONG) - goto found_first; - if (tmp) - goto found_middle; - size -= BITS_PER_LONG; - result += BITS_PER_LONG; - } - while (size & ~(BITS_PER_LONG-1)) { - if ((tmp = *(p++))) - goto found_middle; - result += BITS_PER_LONG; - size -= BITS_PER_LONG; - } - if (!size) - return result; - tmp = *p; - -found_first: - tmp &= (~0UL >> (BITS_PER_LONG - size)); - if (tmp == 0UL) /* Are any bits set? */ - return result + size; /* Nope. */ -found_middle: - return result + __ffs(tmp); -} - -#endif diff --git a/ANDROID_3.4.5/tools/perf/util/include/linux/compiler.h b/ANDROID_3.4.5/tools/perf/util/include/linux/compiler.h deleted file mode 100644 index 547628e9..00000000 --- a/ANDROID_3.4.5/tools/perf/util/include/linux/compiler.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef _PERF_LINUX_COMPILER_H_ -#define _PERF_LINUX_COMPILER_H_ - -#ifndef __always_inline -#define __always_inline inline -#endif -#define __user -#ifndef __attribute_const__ -#define __attribute_const__ -#endif - -#define __used __attribute__((__unused__)) - -#endif diff --git a/ANDROID_3.4.5/tools/perf/util/include/linux/const.h b/ANDROID_3.4.5/tools/perf/util/include/linux/const.h deleted file mode 100644 index 1b476c9a..00000000 --- a/ANDROID_3.4.5/tools/perf/util/include/linux/const.h +++ /dev/null @@ -1 +0,0 @@ -#include "../../../../include/linux/const.h" diff --git a/ANDROID_3.4.5/tools/perf/util/include/linux/ctype.h b/ANDROID_3.4.5/tools/perf/util/include/linux/ctype.h deleted file mode 100644 index a53d4ee1..00000000 --- a/ANDROID_3.4.5/tools/perf/util/include/linux/ctype.h +++ /dev/null @@ -1 +0,0 @@ -#include "../util.h" diff --git a/ANDROID_3.4.5/tools/perf/util/include/linux/export.h b/ANDROID_3.4.5/tools/perf/util/include/linux/export.h deleted file mode 100644 index b43e2dc2..00000000 --- a/ANDROID_3.4.5/tools/perf/util/include/linux/export.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef PERF_LINUX_MODULE_H -#define PERF_LINUX_MODULE_H - -#define EXPORT_SYMBOL(name) - -#endif diff --git a/ANDROID_3.4.5/tools/perf/util/include/linux/hash.h b/ANDROID_3.4.5/tools/perf/util/include/linux/hash.h deleted file mode 100644 index 201f5739..00000000 --- a/ANDROID_3.4.5/tools/perf/util/include/linux/hash.h +++ /dev/null @@ -1,5 +0,0 @@ -#include "../../../../include/linux/hash.h" - -#ifndef PERF_HASH_H -#define PERF_HASH_H -#endif diff --git a/ANDROID_3.4.5/tools/perf/util/include/linux/kernel.h b/ANDROID_3.4.5/tools/perf/util/include/linux/kernel.h deleted file mode 100644 index 1eb804fd..00000000 --- a/ANDROID_3.4.5/tools/perf/util/include/linux/kernel.h +++ /dev/null @@ -1,111 +0,0 @@ -#ifndef PERF_LINUX_KERNEL_H_ -#define PERF_LINUX_KERNEL_H_ - -#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> -#include <assert.h> - -#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) - -#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) -#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) - -#ifndef offsetof -#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) -#endif - -#ifndef container_of -/** - * container_of - cast a member of a structure out to the containing structure - * @ptr: the pointer to the member. - * @type: the type of the container struct this is embedded in. - * @member: the name of the member within the struct. - * - */ -#define container_of(ptr, type, member) ({ \ - const typeof(((type *)0)->member) * __mptr = (ptr); \ - (type *)((char *)__mptr - offsetof(type, member)); }) -#endif - -#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); })) - -#ifndef max -#define max(x, y) ({ \ - typeof(x) _max1 = (x); \ - typeof(y) _max2 = (y); \ - (void) (&_max1 == &_max2); \ - _max1 > _max2 ? _max1 : _max2; }) -#endif - -#ifndef min -#define min(x, y) ({ \ - typeof(x) _min1 = (x); \ - typeof(y) _min2 = (y); \ - (void) (&_min1 == &_min2); \ - _min1 < _min2 ? _min1 : _min2; }) -#endif - -#ifndef BUG_ON -#define BUG_ON(cond) assert(!(cond)) -#endif - -/* - * Both need more care to handle endianness - * (Don't use bitmap_copy_le() for now) - */ -#define cpu_to_le64(x) (x) -#define cpu_to_le32(x) (x) - -static inline int -vscnprintf(char *buf, size_t size, const char *fmt, va_list args) -{ - int i; - ssize_t ssize = size; - - i = vsnprintf(buf, size, fmt, args); - - return (i >= ssize) ? (ssize - 1) : i; -} - -static inline int scnprintf(char * buf, size_t size, const char * fmt, ...) -{ - va_list args; - ssize_t ssize = size; - int i; - - va_start(args, fmt); - i = vsnprintf(buf, size, fmt, args); - va_end(args); - - return (i >= ssize) ? (ssize - 1) : i; -} - -static inline unsigned long -simple_strtoul(const char *nptr, char **endptr, int base) -{ - return strtoul(nptr, endptr, base); -} - -int eprintf(int level, - const char *fmt, ...) __attribute__((format(printf, 2, 3))); - -#ifndef pr_fmt -#define pr_fmt(fmt) fmt -#endif - -#define pr_err(fmt, ...) \ - eprintf(0, pr_fmt(fmt), ##__VA_ARGS__) -#define pr_warning(fmt, ...) \ - eprintf(0, pr_fmt(fmt), ##__VA_ARGS__) -#define pr_info(fmt, ...) \ - eprintf(0, pr_fmt(fmt), ##__VA_ARGS__) -#define pr_debug(fmt, ...) \ - eprintf(1, pr_fmt(fmt), ##__VA_ARGS__) -#define pr_debugN(n, fmt, ...) \ - eprintf(n, pr_fmt(fmt), ##__VA_ARGS__) -#define pr_debug2(fmt, ...) pr_debugN(2, pr_fmt(fmt), ##__VA_ARGS__) -#define pr_debug3(fmt, ...) pr_debugN(3, pr_fmt(fmt), ##__VA_ARGS__) -#define pr_debug4(fmt, ...) pr_debugN(4, pr_fmt(fmt), ##__VA_ARGS__) - -#endif diff --git a/ANDROID_3.4.5/tools/perf/util/include/linux/linkage.h b/ANDROID_3.4.5/tools/perf/util/include/linux/linkage.h deleted file mode 100644 index 06387cff..00000000 --- a/ANDROID_3.4.5/tools/perf/util/include/linux/linkage.h +++ /dev/null @@ -1,13 +0,0 @@ - -#ifndef PERF_LINUX_LINKAGE_H_ -#define PERF_LINUX_LINKAGE_H_ - -/* linkage.h ... for including arch/x86/lib/memcpy_64.S */ - -#define ENTRY(name) \ - .globl name; \ - name: - -#define ENDPROC(name) - -#endif /* PERF_LINUX_LINKAGE_H_ */ diff --git a/ANDROID_3.4.5/tools/perf/util/include/linux/list.h b/ANDROID_3.4.5/tools/perf/util/include/linux/list.h deleted file mode 100644 index 1d928a0c..00000000 --- a/ANDROID_3.4.5/tools/perf/util/include/linux/list.h +++ /dev/null @@ -1,29 +0,0 @@ -#include <linux/kernel.h> -#include <linux/prefetch.h> - -#include "../../../../include/linux/list.h" - -#ifndef PERF_LIST_H -#define PERF_LIST_H -/** - * list_del_range - deletes range of entries from list. - * @begin: first element in the range to delete from the list. - * @end: last element in the range to delete from the list. - * Note: list_empty on the range of entries does not return true after this, - * the entries is in an undefined state. - */ -static inline void list_del_range(struct list_head *begin, - struct list_head *end) -{ - begin->prev->next = end->next; - end->next->prev = begin->prev; -} - -/** - * list_for_each_from - iterate over a list from one of its nodes - * @pos: the &struct list_head to use as a loop cursor, from where to start - * @head: the head for your list. - */ -#define list_for_each_from(pos, head) \ - for (; pos != (head); pos = pos->next) -#endif diff --git a/ANDROID_3.4.5/tools/perf/util/include/linux/poison.h b/ANDROID_3.4.5/tools/perf/util/include/linux/poison.h deleted file mode 100644 index fef6dbc9..00000000 --- a/ANDROID_3.4.5/tools/perf/util/include/linux/poison.h +++ /dev/null @@ -1 +0,0 @@ -#include "../../../../include/linux/poison.h" diff --git a/ANDROID_3.4.5/tools/perf/util/include/linux/prefetch.h b/ANDROID_3.4.5/tools/perf/util/include/linux/prefetch.h deleted file mode 100644 index 7841e485..00000000 --- a/ANDROID_3.4.5/tools/perf/util/include/linux/prefetch.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef PERF_LINUX_PREFETCH_H -#define PERF_LINUX_PREFETCH_H - -static inline void prefetch(void *a __attribute__((unused))) { } - -#endif diff --git a/ANDROID_3.4.5/tools/perf/util/include/linux/rbtree.h b/ANDROID_3.4.5/tools/perf/util/include/linux/rbtree.h deleted file mode 100644 index 7a243a14..00000000 --- a/ANDROID_3.4.5/tools/perf/util/include/linux/rbtree.h +++ /dev/null @@ -1 +0,0 @@ -#include "../../../../include/linux/rbtree.h" diff --git a/ANDROID_3.4.5/tools/perf/util/include/linux/string.h b/ANDROID_3.4.5/tools/perf/util/include/linux/string.h deleted file mode 100644 index 3b2f5900..00000000 --- a/ANDROID_3.4.5/tools/perf/util/include/linux/string.h +++ /dev/null @@ -1 +0,0 @@ -#include <string.h> diff --git a/ANDROID_3.4.5/tools/perf/util/include/linux/types.h b/ANDROID_3.4.5/tools/perf/util/include/linux/types.h deleted file mode 100644 index 12de3b81..00000000 --- a/ANDROID_3.4.5/tools/perf/util/include/linux/types.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef _PERF_LINUX_TYPES_H_ -#define _PERF_LINUX_TYPES_H_ - -#include <asm/types.h> - -#define DECLARE_BITMAP(name,bits) \ - unsigned long name[BITS_TO_LONGS(bits)] - -struct list_head { - struct list_head *next, *prev; -}; - -struct hlist_head { - struct hlist_node *first; -}; - -struct hlist_node { - struct hlist_node *next, **pprev; -}; - -#endif |