diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
commit | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch) | |
tree | a8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /tools/perf/util/include | |
parent | 406089d01562f1e2bf9f089fd7637009ebaad589 (diff) |
Patched in Tegra support.
Diffstat (limited to 'tools/perf/util/include')
-rw-r--r-- | tools/perf/util/include/asm/byteorder.h | 2 | ||||
-rw-r--r-- | tools/perf/util/include/asm/dwarf2.h | 4 | ||||
-rw-r--r-- | tools/perf/util/include/asm/unistd_32.h | 1 | ||||
-rw-r--r-- | tools/perf/util/include/asm/unistd_64.h | 1 | ||||
-rw-r--r-- | tools/perf/util/include/linux/bitmap.h | 11 | ||||
-rw-r--r-- | tools/perf/util/include/linux/bitops.h | 124 | ||||
-rw-r--r-- | tools/perf/util/include/linux/compiler.h | 9 | ||||
-rw-r--r-- | tools/perf/util/include/linux/const.h | 2 | ||||
-rw-r--r-- | tools/perf/util/include/linux/export.h | 6 | ||||
-rw-r--r-- | tools/perf/util/include/linux/kernel.h | 27 | ||||
-rw-r--r-- | tools/perf/util/include/linux/magic.h | 12 | ||||
-rw-r--r-- | tools/perf/util/include/linux/rbtree.h | 1 | ||||
-rw-r--r-- | tools/perf/util/include/linux/rbtree_augmented.h | 2 | ||||
-rw-r--r-- | tools/perf/util/include/linux/string.h | 2 | ||||
-rw-r--r-- | tools/perf/util/include/linux/types.h | 8 |
15 files changed, 6 insertions, 206 deletions
diff --git a/tools/perf/util/include/asm/byteorder.h b/tools/perf/util/include/asm/byteorder.h index 2a9bdc06630..b722abe3a62 100644 --- a/tools/perf/util/include/asm/byteorder.h +++ b/tools/perf/util/include/asm/byteorder.h | |||
@@ -1,2 +1,2 @@ | |||
1 | #include <asm/types.h> | 1 | #include <asm/types.h> |
2 | #include "../../../../include/uapi/linux/swab.h" | 2 | #include "../../../../include/linux/swab.h" |
diff --git a/tools/perf/util/include/asm/dwarf2.h b/tools/perf/util/include/asm/dwarf2.h index afe38199e92..bb4198e7837 100644 --- a/tools/perf/util/include/asm/dwarf2.h +++ b/tools/perf/util/include/asm/dwarf2.h | |||
@@ -2,12 +2,10 @@ | |||
2 | #ifndef PERF_DWARF2_H | 2 | #ifndef PERF_DWARF2_H |
3 | #define PERF_DWARF2_H | 3 | #define PERF_DWARF2_H |
4 | 4 | ||
5 | /* dwarf2.h ... dummy header file for including arch/x86/lib/mem{cpy,set}_64.S */ | 5 | /* dwarf2.h ... dummy header file for including arch/x86/lib/memcpy_64.S */ |
6 | 6 | ||
7 | #define CFI_STARTPROC | 7 | #define CFI_STARTPROC |
8 | #define CFI_ENDPROC | 8 | #define CFI_ENDPROC |
9 | #define CFI_REMEMBER_STATE | ||
10 | #define CFI_RESTORE_STATE | ||
11 | 9 | ||
12 | #endif /* PERF_DWARF2_H */ | 10 | #endif /* PERF_DWARF2_H */ |
13 | 11 | ||
diff --git a/tools/perf/util/include/asm/unistd_32.h b/tools/perf/util/include/asm/unistd_32.h deleted file mode 100644 index 8b137891791..00000000000 --- a/tools/perf/util/include/asm/unistd_32.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | |||
diff --git a/tools/perf/util/include/asm/unistd_64.h b/tools/perf/util/include/asm/unistd_64.h deleted file mode 100644 index 8b137891791..00000000000 --- a/tools/perf/util/include/asm/unistd_64.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | |||
diff --git a/tools/perf/util/include/linux/bitmap.h b/tools/perf/util/include/linux/bitmap.h index bb162e40c76..eda4416efa0 100644 --- a/tools/perf/util/include/linux/bitmap.h +++ b/tools/perf/util/include/linux/bitmap.h | |||
@@ -5,8 +5,6 @@ | |||
5 | #include <linux/bitops.h> | 5 | #include <linux/bitops.h> |
6 | 6 | ||
7 | int __bitmap_weight(const unsigned long *bitmap, int bits); | 7 | int __bitmap_weight(const unsigned long *bitmap, int bits); |
8 | void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1, | ||
9 | const unsigned long *bitmap2, int bits); | ||
10 | 8 | ||
11 | #define BITMAP_LAST_WORD_MASK(nbits) \ | 9 | #define BITMAP_LAST_WORD_MASK(nbits) \ |
12 | ( \ | 10 | ( \ |
@@ -34,13 +32,4 @@ static inline int bitmap_weight(const unsigned long *src, int nbits) | |||
34 | return __bitmap_weight(src, nbits); | 32 | return __bitmap_weight(src, nbits); |
35 | } | 33 | } |
36 | 34 | ||
37 | static inline void bitmap_or(unsigned long *dst, const unsigned long *src1, | ||
38 | const unsigned long *src2, int nbits) | ||
39 | { | ||
40 | if (small_const_nbits(nbits)) | ||
41 | *dst = *src1 | *src2; | ||
42 | else | ||
43 | __bitmap_or(dst, src1, src2, nbits); | ||
44 | } | ||
45 | |||
46 | #endif /* _PERF_BITOPS_H */ | 35 | #endif /* _PERF_BITOPS_H */ |
diff --git a/tools/perf/util/include/linux/bitops.h b/tools/perf/util/include/linux/bitops.h index a55d8cf083c..305c8484f20 100644 --- a/tools/perf/util/include/linux/bitops.h +++ b/tools/perf/util/include/linux/bitops.h | |||
@@ -5,26 +5,9 @@ | |||
5 | #include <linux/compiler.h> | 5 | #include <linux/compiler.h> |
6 | #include <asm/hweight.h> | 6 | #include <asm/hweight.h> |
7 | 7 | ||
8 | #ifndef __WORDSIZE | ||
9 | #define __WORDSIZE (__SIZEOF_LONG__ * 8) | ||
10 | #endif | ||
11 | |||
12 | #define BITS_PER_LONG __WORDSIZE | 8 | #define BITS_PER_LONG __WORDSIZE |
13 | #define BITS_PER_BYTE 8 | 9 | #define BITS_PER_BYTE 8 |
14 | #define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) | 10 | #define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) |
15 | #define BITS_TO_U64(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(u64)) | ||
16 | #define BITS_TO_U32(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(u32)) | ||
17 | |||
18 | #define for_each_set_bit(bit, addr, size) \ | ||
19 | for ((bit) = find_first_bit((addr), (size)); \ | ||
20 | (bit) < (size); \ | ||
21 | (bit) = find_next_bit((addr), (size), (bit) + 1)) | ||
22 | |||
23 | /* same as for_each_set_bit() but use bit as value to start with */ | ||
24 | #define for_each_set_bit_from(bit, addr, size) \ | ||
25 | for ((bit) = find_next_bit((addr), (size), (bit)); \ | ||
26 | (bit) < (size); \ | ||
27 | (bit) = find_next_bit((addr), (size), (bit) + 1)) | ||
28 | 11 | ||
29 | static inline void set_bit(int nr, unsigned long *addr) | 12 | static inline void set_bit(int nr, unsigned long *addr) |
30 | { | 13 | { |
@@ -47,111 +30,4 @@ static inline unsigned long hweight_long(unsigned long w) | |||
47 | return sizeof(w) == 4 ? hweight32(w) : hweight64(w); | 30 | return sizeof(w) == 4 ? hweight32(w) : hweight64(w); |
48 | } | 31 | } |
49 | 32 | ||
50 | #define BITOP_WORD(nr) ((nr) / BITS_PER_LONG) | ||
51 | |||
52 | /** | ||
53 | * __ffs - find first bit in word. | ||
54 | * @word: The word to search | ||
55 | * | ||
56 | * Undefined if no bit exists, so code should check against 0 first. | ||
57 | */ | ||
58 | static __always_inline unsigned long __ffs(unsigned long word) | ||
59 | { | ||
60 | int num = 0; | ||
61 | |||
62 | #if BITS_PER_LONG == 64 | ||
63 | if ((word & 0xffffffff) == 0) { | ||
64 | num += 32; | ||
65 | word >>= 32; | ||
66 | } | ||
67 | #endif | ||
68 | if ((word & 0xffff) == 0) { | ||
69 | num += 16; | ||
70 | word >>= 16; | ||
71 | } | ||
72 | if ((word & 0xff) == 0) { | ||
73 | num += 8; | ||
74 | word >>= 8; | ||
75 | } | ||
76 | if ((word & 0xf) == 0) { | ||
77 | num += 4; | ||
78 | word >>= 4; | ||
79 | } | ||
80 | if ((word & 0x3) == 0) { | ||
81 | num += 2; | ||
82 | word >>= 2; | ||
83 | } | ||
84 | if ((word & 0x1) == 0) | ||
85 | num += 1; | ||
86 | return num; | ||
87 | } | ||
88 | |||
89 | /* | ||
90 | * Find the first set bit in a memory region. | ||
91 | */ | ||
92 | static inline unsigned long | ||
93 | find_first_bit(const unsigned long *addr, unsigned long size) | ||
94 | { | ||
95 | const unsigned long *p = addr; | ||
96 | unsigned long result = 0; | ||
97 | unsigned long tmp; | ||
98 | |||
99 | while (size & ~(BITS_PER_LONG-1)) { | ||
100 | if ((tmp = *(p++))) | ||
101 | goto found; | ||
102 | result += BITS_PER_LONG; | ||
103 | size -= BITS_PER_LONG; | ||
104 | } | ||
105 | if (!size) | ||
106 | return result; | ||
107 | |||
108 | tmp = (*p) & (~0UL >> (BITS_PER_LONG - size)); | ||
109 | if (tmp == 0UL) /* Are any bits set? */ | ||
110 | return result + size; /* Nope. */ | ||
111 | found: | ||
112 | return result + __ffs(tmp); | ||
113 | } | ||
114 | |||
115 | /* | ||
116 | * Find the next set bit in a memory region. | ||
117 | */ | ||
118 | static inline unsigned long | ||
119 | find_next_bit(const unsigned long *addr, unsigned long size, unsigned long offset) | ||
120 | { | ||
121 | const unsigned long *p = addr + BITOP_WORD(offset); | ||
122 | unsigned long result = offset & ~(BITS_PER_LONG-1); | ||
123 | unsigned long tmp; | ||
124 | |||
125 | if (offset >= size) | ||
126 | return size; | ||
127 | size -= result; | ||
128 | offset %= BITS_PER_LONG; | ||
129 | if (offset) { | ||
130 | tmp = *(p++); | ||
131 | tmp &= (~0UL << offset); | ||
132 | if (size < BITS_PER_LONG) | ||
133 | goto found_first; | ||
134 | if (tmp) | ||
135 | goto found_middle; | ||
136 | size -= BITS_PER_LONG; | ||
137 | result += BITS_PER_LONG; | ||
138 | } | ||
139 | while (size & ~(BITS_PER_LONG-1)) { | ||
140 | if ((tmp = *(p++))) | ||
141 | goto found_middle; | ||
142 | result += BITS_PER_LONG; | ||
143 | size -= BITS_PER_LONG; | ||
144 | } | ||
145 | if (!size) | ||
146 | return result; | ||
147 | tmp = *p; | ||
148 | |||
149 | found_first: | ||
150 | tmp &= (~0UL >> (BITS_PER_LONG - size)); | ||
151 | if (tmp == 0UL) /* Are any bits set? */ | ||
152 | return result + size; /* Nope. */ | ||
153 | found_middle: | ||
154 | return result + __ffs(tmp); | ||
155 | } | ||
156 | |||
157 | #endif | 33 | #endif |
diff --git a/tools/perf/util/include/linux/compiler.h b/tools/perf/util/include/linux/compiler.h index 96b919dae11..547628e97f3 100644 --- a/tools/perf/util/include/linux/compiler.h +++ b/tools/perf/util/include/linux/compiler.h | |||
@@ -9,13 +9,6 @@ | |||
9 | #define __attribute_const__ | 9 | #define __attribute_const__ |
10 | #endif | 10 | #endif |
11 | 11 | ||
12 | #ifndef __maybe_unused | 12 | #define __used __attribute__((__unused__)) |
13 | #define __maybe_unused __attribute__((unused)) | ||
14 | #endif | ||
15 | #define __packed __attribute__((__packed__)) | ||
16 | |||
17 | #ifndef __force | ||
18 | #define __force | ||
19 | #endif | ||
20 | 13 | ||
21 | #endif | 14 | #endif |
diff --git a/tools/perf/util/include/linux/const.h b/tools/perf/util/include/linux/const.h index c10a35e1afb..1b476c9ae64 100644 --- a/tools/perf/util/include/linux/const.h +++ b/tools/perf/util/include/linux/const.h | |||
@@ -1 +1 @@ | |||
#include "../../../../include/uapi/linux/const.h" | #include "../../../../include/linux/const.h" | ||
diff --git a/tools/perf/util/include/linux/export.h b/tools/perf/util/include/linux/export.h deleted file mode 100644 index b43e2dc21e0..00000000000 --- a/tools/perf/util/include/linux/export.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef PERF_LINUX_MODULE_H | ||
2 | #define PERF_LINUX_MODULE_H | ||
3 | |||
4 | #define EXPORT_SYMBOL(name) | ||
5 | |||
6 | #endif | ||
diff --git a/tools/perf/util/include/linux/kernel.h b/tools/perf/util/include/linux/kernel.h index d8c927c868e..1eb804fd3fb 100644 --- a/tools/perf/util/include/linux/kernel.h +++ b/tools/perf/util/include/linux/kernel.h | |||
@@ -8,8 +8,8 @@ | |||
8 | 8 | ||
9 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) | 9 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) |
10 | 10 | ||
11 | #define PERF_ALIGN(x, a) __PERF_ALIGN_MASK(x, (typeof(x))(a)-1) | 11 | #define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) |
12 | #define __PERF_ALIGN_MASK(x, mask) (((x)+(mask))&~(mask)) | 12 | #define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) |
13 | 13 | ||
14 | #ifndef offsetof | 14 | #ifndef offsetof |
15 | #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) | 15 | #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) |
@@ -46,22 +46,9 @@ | |||
46 | _min1 < _min2 ? _min1 : _min2; }) | 46 | _min1 < _min2 ? _min1 : _min2; }) |
47 | #endif | 47 | #endif |
48 | 48 | ||
49 | #ifndef roundup | ||
50 | #define roundup(x, y) ( \ | ||
51 | { \ | ||
52 | const typeof(y) __y = y; \ | ||
53 | (((x) + (__y - 1)) / __y) * __y; \ | ||
54 | } \ | ||
55 | ) | ||
56 | #endif | ||
57 | |||
58 | #ifndef BUG_ON | 49 | #ifndef BUG_ON |
59 | #ifdef NDEBUG | ||
60 | #define BUG_ON(cond) do { if (cond) {} } while (0) | ||
61 | #else | ||
62 | #define BUG_ON(cond) assert(!(cond)) | 50 | #define BUG_ON(cond) assert(!(cond)) |
63 | #endif | 51 | #endif |
64 | #endif | ||
65 | 52 | ||
66 | /* | 53 | /* |
67 | * Both need more care to handle endianness | 54 | * Both need more care to handle endianness |
@@ -121,14 +108,4 @@ int eprintf(int level, | |||
121 | #define pr_debug3(fmt, ...) pr_debugN(3, pr_fmt(fmt), ##__VA_ARGS__) | 108 | #define pr_debug3(fmt, ...) pr_debugN(3, pr_fmt(fmt), ##__VA_ARGS__) |
122 | #define pr_debug4(fmt, ...) pr_debugN(4, pr_fmt(fmt), ##__VA_ARGS__) | 109 | #define pr_debug4(fmt, ...) pr_debugN(4, pr_fmt(fmt), ##__VA_ARGS__) |
123 | 110 | ||
124 | /* | ||
125 | * This looks more complex than it should be. But we need to | ||
126 | * get the type for the ~ right in round_down (it needs to be | ||
127 | * as wide as the result!), and we want to evaluate the macro | ||
128 | * arguments just once each. | ||
129 | */ | ||
130 | #define __round_mask(x, y) ((__typeof__(x))((y)-1)) | ||
131 | #define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1) | ||
132 | #define round_down(x, y) ((x) & ~__round_mask(x, y)) | ||
133 | |||
134 | #endif | 111 | #endif |
diff --git a/tools/perf/util/include/linux/magic.h b/tools/perf/util/include/linux/magic.h deleted file mode 100644 index 58b64ed4da1..00000000000 --- a/tools/perf/util/include/linux/magic.h +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | #ifndef _PERF_LINUX_MAGIC_H_ | ||
2 | #define _PERF_LINUX_MAGIC_H_ | ||
3 | |||
4 | #ifndef DEBUGFS_MAGIC | ||
5 | #define DEBUGFS_MAGIC 0x64626720 | ||
6 | #endif | ||
7 | |||
8 | #ifndef SYSFS_MAGIC | ||
9 | #define SYSFS_MAGIC 0x62656572 | ||
10 | #endif | ||
11 | |||
12 | #endif | ||
diff --git a/tools/perf/util/include/linux/rbtree.h b/tools/perf/util/include/linux/rbtree.h index 2a030c5af3a..7a243a14303 100644 --- a/tools/perf/util/include/linux/rbtree.h +++ b/tools/perf/util/include/linux/rbtree.h | |||
@@ -1,2 +1 @@ | |||
1 | #include <stdbool.h> | ||
2 | #include "../../../../include/linux/rbtree.h" | #include "../../../../include/linux/rbtree.h" | |
diff --git a/tools/perf/util/include/linux/rbtree_augmented.h b/tools/perf/util/include/linux/rbtree_augmented.h deleted file mode 100644 index 9d6fcdf1788..00000000000 --- a/tools/perf/util/include/linux/rbtree_augmented.h +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | #include <stdbool.h> | ||
2 | #include "../../../../include/linux/rbtree_augmented.h" | ||
diff --git a/tools/perf/util/include/linux/string.h b/tools/perf/util/include/linux/string.h index 6f19c548ecc..3b2f5900276 100644 --- a/tools/perf/util/include/linux/string.h +++ b/tools/perf/util/include/linux/string.h | |||
@@ -1,3 +1 @@ | |||
1 | #include <string.h> | #include <string.h> | |
2 | |||
3 | void *memdup(const void *src, size_t len); | ||
diff --git a/tools/perf/util/include/linux/types.h b/tools/perf/util/include/linux/types.h index eb464786c08..12de3b8112f 100644 --- a/tools/perf/util/include/linux/types.h +++ b/tools/perf/util/include/linux/types.h | |||
@@ -3,14 +3,6 @@ | |||
3 | 3 | ||
4 | #include <asm/types.h> | 4 | #include <asm/types.h> |
5 | 5 | ||
6 | #ifndef __bitwise | ||
7 | #define __bitwise | ||
8 | #endif | ||
9 | |||
10 | #ifndef __le32 | ||
11 | typedef __u32 __bitwise __le32; | ||
12 | #endif | ||
13 | |||
14 | #define DECLARE_BITMAP(name,bits) \ | 6 | #define DECLARE_BITMAP(name,bits) \ |
15 | unsigned long name[BITS_TO_LONGS(bits)] | 7 | unsigned long name[BITS_TO_LONGS(bits)] |
16 | 8 | ||