diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/Kbuild | 1 | ||||
| -rw-r--r-- | include/linux/agp_backend.h | 5 | ||||
| -rw-r--r-- | include/linux/bitmap.h | 1 | ||||
| -rw-r--r-- | include/linux/bootmem.h | 4 | ||||
| -rw-r--r-- | include/linux/byteorder.h | 372 | ||||
| -rw-r--r-- | include/linux/firmware-map.h | 26 | ||||
| -rw-r--r-- | include/linux/harrier_defs.h | 212 | ||||
| -rw-r--r-- | include/linux/i2c-id.h | 2 | ||||
| -rw-r--r-- | include/linux/init.h | 1 | ||||
| -rw-r--r-- | include/linux/kernel.h | 14 | ||||
| -rw-r--r-- | include/linux/mfd/t7l66xb.h | 36 | ||||
| -rw-r--r-- | include/linux/mfd/tc6387xb.h | 23 | ||||
| -rw-r--r-- | include/linux/mfd/tc6393xb.h | 9 | ||||
| -rw-r--r-- | include/linux/mfd/tmio.h | 19 | ||||
| -rw-r--r-- | include/linux/mm.h | 20 | ||||
| -rw-r--r-- | include/linux/pci.h | 11 | ||||
| -rw-r--r-- | include/linux/pci_ids.h | 2 | ||||
| -rw-r--r-- | include/linux/sched.h | 31 | ||||
| -rw-r--r-- | include/linux/seq_file.h | 12 | ||||
| -rw-r--r-- | include/linux/slub_def.h | 1 | ||||
| -rw-r--r-- | include/linux/swab.h | 309 |
21 files changed, 801 insertions, 310 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index a26f565e8189..327f60658d94 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
| @@ -356,6 +356,7 @@ unifdef-y += virtio_balloon.h | |||
| 356 | unifdef-y += virtio_console.h | 356 | unifdef-y += virtio_console.h |
| 357 | unifdef-y += virtio_pci.h | 357 | unifdef-y += virtio_pci.h |
| 358 | unifdef-y += virtio_ring.h | 358 | unifdef-y += virtio_ring.h |
| 359 | unifdef-y += virtio_rng.h | ||
| 359 | unifdef-y += vt.h | 360 | unifdef-y += vt.h |
| 360 | unifdef-y += wait.h | 361 | unifdef-y += wait.h |
| 361 | unifdef-y += wanrouter.h | 362 | unifdef-y += wanrouter.h |
diff --git a/include/linux/agp_backend.h b/include/linux/agp_backend.h index 972b12bcfb36..2b8df8b420fd 100644 --- a/include/linux/agp_backend.h +++ b/include/linux/agp_backend.h | |||
| @@ -30,6 +30,8 @@ | |||
| 30 | #ifndef _AGP_BACKEND_H | 30 | #ifndef _AGP_BACKEND_H |
| 31 | #define _AGP_BACKEND_H 1 | 31 | #define _AGP_BACKEND_H 1 |
| 32 | 32 | ||
| 33 | #include <linux/list.h> | ||
| 34 | |||
| 33 | enum chipset_type { | 35 | enum chipset_type { |
| 34 | NOT_SUPPORTED, | 36 | NOT_SUPPORTED, |
| 35 | SUPPORTED, | 37 | SUPPORTED, |
| @@ -78,6 +80,8 @@ struct agp_memory { | |||
| 78 | bool is_bound; | 80 | bool is_bound; |
| 79 | bool is_flushed; | 81 | bool is_flushed; |
| 80 | bool vmalloc_flag; | 82 | bool vmalloc_flag; |
| 83 | /* list of agp_memory mapped to the aperture */ | ||
| 84 | struct list_head mapped_list; | ||
| 81 | }; | 85 | }; |
| 82 | 86 | ||
| 83 | #define AGP_NORMAL_MEMORY 0 | 87 | #define AGP_NORMAL_MEMORY 0 |
| @@ -96,6 +100,7 @@ extern struct agp_memory *agp_allocate_memory(struct agp_bridge_data *, size_t, | |||
| 96 | extern int agp_copy_info(struct agp_bridge_data *, struct agp_kern_info *); | 100 | extern int agp_copy_info(struct agp_bridge_data *, struct agp_kern_info *); |
| 97 | extern int agp_bind_memory(struct agp_memory *, off_t); | 101 | extern int agp_bind_memory(struct agp_memory *, off_t); |
| 98 | extern int agp_unbind_memory(struct agp_memory *); | 102 | extern int agp_unbind_memory(struct agp_memory *); |
| 103 | extern int agp_rebind_memory(void); | ||
| 99 | extern void agp_enable(struct agp_bridge_data *, u32); | 104 | extern void agp_enable(struct agp_bridge_data *, u32); |
| 100 | extern struct agp_bridge_data *agp_backend_acquire(struct pci_dev *); | 105 | extern struct agp_bridge_data *agp_backend_acquire(struct pci_dev *); |
| 101 | extern void agp_backend_release(struct agp_bridge_data *); | 106 | extern void agp_backend_release(struct agp_bridge_data *); |
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index 1abfe664c444..89781fd48859 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h | |||
| @@ -110,6 +110,7 @@ extern int __bitmap_weight(const unsigned long *bitmap, int bits); | |||
| 110 | 110 | ||
| 111 | extern int bitmap_scnprintf(char *buf, unsigned int len, | 111 | extern int bitmap_scnprintf(char *buf, unsigned int len, |
| 112 | const unsigned long *src, int nbits); | 112 | const unsigned long *src, int nbits); |
| 113 | extern int bitmap_scnprintf_len(unsigned int nr_bits); | ||
| 113 | extern int __bitmap_parse(const char *buf, unsigned int buflen, int is_user, | 114 | extern int __bitmap_parse(const char *buf, unsigned int buflen, int is_user, |
| 114 | unsigned long *dst, int nbits); | 115 | unsigned long *dst, int nbits); |
| 115 | extern int bitmap_parse_user(const char __user *ubuf, unsigned int ulen, | 116 | extern int bitmap_parse_user(const char __user *ubuf, unsigned int ulen, |
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 652470b687c9..95837bfb5256 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
| @@ -97,10 +97,14 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat, | |||
| 97 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE | 97 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE |
| 98 | #define alloc_bootmem(x) \ | 98 | #define alloc_bootmem(x) \ |
| 99 | __alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) | 99 | __alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) |
| 100 | #define alloc_bootmem_nopanic(x) \ | ||
| 101 | __alloc_bootmem_nopanic(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) | ||
| 100 | #define alloc_bootmem_low(x) \ | 102 | #define alloc_bootmem_low(x) \ |
| 101 | __alloc_bootmem_low(x, SMP_CACHE_BYTES, 0) | 103 | __alloc_bootmem_low(x, SMP_CACHE_BYTES, 0) |
| 102 | #define alloc_bootmem_pages(x) \ | 104 | #define alloc_bootmem_pages(x) \ |
| 103 | __alloc_bootmem(x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) | 105 | __alloc_bootmem(x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) |
| 106 | #define alloc_bootmem_pages_nopanic(x) \ | ||
| 107 | __alloc_bootmem_nopanic(x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) | ||
| 104 | #define alloc_bootmem_low_pages(x) \ | 108 | #define alloc_bootmem_low_pages(x) \ |
| 105 | __alloc_bootmem_low(x, PAGE_SIZE, 0) | 109 | __alloc_bootmem_low(x, PAGE_SIZE, 0) |
| 106 | #define alloc_bootmem_node(pgdat, x) \ | 110 | #define alloc_bootmem_node(pgdat, x) \ |
diff --git a/include/linux/byteorder.h b/include/linux/byteorder.h new file mode 100644 index 000000000000..29f002d73d98 --- /dev/null +++ b/include/linux/byteorder.h | |||
| @@ -0,0 +1,372 @@ | |||
| 1 | #ifndef _LINUX_BYTEORDER_H | ||
| 2 | #define _LINUX_BYTEORDER_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | #include <linux/swab.h> | ||
| 6 | |||
| 7 | #if defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN) | ||
| 8 | # error Fix asm/byteorder.h to define one endianness | ||
| 9 | #endif | ||
| 10 | |||
| 11 | #if !defined(__LITTLE_ENDIAN) && !defined(__BIG_ENDIAN) | ||
| 12 | # error Fix asm/byteorder.h to define arch endianness | ||
| 13 | #endif | ||
| 14 | |||
| 15 | #ifdef __LITTLE_ENDIAN | ||
| 16 | # undef __LITTLE_ENDIAN | ||
| 17 | # define __LITTLE_ENDIAN 1234 | ||
| 18 | #endif | ||
| 19 | |||
| 20 | #ifdef __BIG_ENDIAN | ||
| 21 | # undef __BIG_ENDIAN | ||
| 22 | # define __BIG_ENDIAN 4321 | ||
| 23 | #endif | ||
| 24 | |||
| 25 | #if defined(__LITTLE_ENDIAN) && !defined(__LITTLE_ENDIAN_BITFIELD) | ||
| 26 | # define __LITTLE_ENDIAN_BITFIELD | ||
| 27 | #endif | ||
| 28 | |||
| 29 | #if defined(__BIG_ENDIAN) && !defined(__BIG_ENDIAN_BITFIELD) | ||
| 30 | # define __BIG_ENDIAN_BITFIELD | ||
| 31 | #endif | ||
| 32 | |||
| 33 | #ifdef __LITTLE_ENDIAN | ||
| 34 | # define __le16_to_cpu(x) ((__force __u16)(__le16)(x)) | ||
| 35 | # define __le32_to_cpu(x) ((__force __u32)(__le32)(x)) | ||
| 36 | # define __le64_to_cpu(x) ((__force __u64)(__le64)(x)) | ||
| 37 | # define __cpu_to_le16(x) ((__force __le16)(__u16)(x)) | ||
| 38 | # define __cpu_to_le32(x) ((__force __le32)(__u32)(x)) | ||
| 39 | # define __cpu_to_le64(x) ((__force __le64)(__u64)(x)) | ||
| 40 | |||
| 41 | # define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x)) | ||
| 42 | # define __be32_to_cpu(x) __swab32((__force __u32)(__be32)(x)) | ||
| 43 | # define __be64_to_cpu(x) __swab64((__force __u64)(__be64)(x)) | ||
| 44 | # define __cpu_to_be16(x) ((__force __be16)__swab16(x)) | ||
| 45 | # define __cpu_to_be32(x) ((__force __be32)__swab32(x)) | ||
| 46 | # define __cpu_to_be64(x) ((__force __be64)__swab64(x)) | ||
| 47 | #endif | ||
| 48 | |||
| 49 | #ifdef __BIG_ENDIAN | ||
| 50 | # define __be16_to_cpu(x) ((__force __u16)(__be16)(x)) | ||
| 51 | # define __be32_to_cpu(x) ((__force __u32)(__be32)(x)) | ||
| 52 | # define __be64_to_cpu(x) ((__force __u64)(__be64)(x)) | ||
| 53 | # define __cpu_to_be16(x) ((__force __be16)(__u16)(x)) | ||
| 54 | # define __cpu_to_be32(x) ((__force __be32)(__u32)(x)) | ||
| 55 | # define __cpu_to_be64(x) ((__force __be64)(__u64)(x)) | ||
| 56 | |||
| 57 | # define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x)) | ||
| 58 | # define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x)) | ||
| 59 | # define __le64_to_cpu(x) __swab64((__force __u64)(__le64)(x)) | ||
| 60 | # define __cpu_to_le16(x) ((__force __le16)__swab16(x)) | ||
| 61 | # define __cpu_to_le32(x) ((__force __le32)__swab32(x)) | ||
| 62 | # define __cpu_to_le64(x) ((__force __le64)__swab64(x)) | ||
| 63 | #endif | ||
| 64 | |||
| 65 | /* | ||
| 66 | * These helpers could be phased out over time as the base version | ||
| 67 | * handles constant folding. | ||
| 68 | */ | ||
| 69 | #define __constant_htonl(x) __cpu_to_be32(x) | ||
| 70 | #define __constant_ntohl(x) __be32_to_cpu(x) | ||
| 71 | #define __constant_htons(x) __cpu_to_be16(x) | ||
| 72 | #define __constant_ntohs(x) __be16_to_cpu(x) | ||
| 73 | |||
| 74 | #define __constant_le16_to_cpu(x) __le16_to_cpu(x) | ||
| 75 | #define __constant_le32_to_cpu(x) __le32_to_cpu(x) | ||
| 76 | #define __constant_le64_to_cpu(x) __le64_to_cpu(x) | ||
| 77 | #define __constant_be16_to_cpu(x) __be16_to_cpu(x) | ||
| 78 | #define __constant_be32_to_cpu(x) __be32_to_cpu(x) | ||
| 79 | #define __constant_be64_to_cpu(x) __be64_to_cpu(x) | ||
| 80 | |||
| 81 | #define __constant_cpu_to_le16(x) __cpu_to_le16(x) | ||
| 82 | #define __constant_cpu_to_le32(x) __cpu_to_le32(x) | ||
| 83 | #define __constant_cpu_to_le64(x) __cpu_to_le64(x) | ||
| 84 | #define __constant_cpu_to_be16(x) __cpu_to_be16(x) | ||
| 85 | #define __constant_cpu_to_be32(x) __cpu_to_be32(x) | ||
| 86 | #define __constant_cpu_to_be64(x) __cpu_to_be64(x) | ||
| 87 | |||
| 88 | static inline void __le16_to_cpus(__u16 *p) | ||
| 89 | { | ||
| 90 | #ifdef __BIG_ENDIAN | ||
| 91 | __swab16s(p); | ||
| 92 | #endif | ||
| 93 | } | ||
| 94 | |||
| 95 | static inline void __cpu_to_le16s(__u16 *p) | ||
| 96 | { | ||
| 97 | #ifdef __BIG_ENDIAN | ||
| 98 | __swab16s(p); | ||
| 99 | #endif | ||
| 100 | } | ||
| 101 | |||
| 102 | static inline void __le32_to_cpus(__u32 *p) | ||
| 103 | { | ||
| 104 | #ifdef __BIG_ENDIAN | ||
| 105 | __swab32s(p); | ||
| 106 | #endif | ||
| 107 | } | ||
| 108 | |||
| 109 | static inline void __cpu_to_le32s(__u32 *p) | ||
| 110 | { | ||
| 111 | #ifdef __BIG_ENDIAN | ||
| 112 | __swab32s(p); | ||
| 113 | #endif | ||
| 114 | } | ||
| 115 | |||
| 116 | static inline void __le64_to_cpus(__u64 *p) | ||
| 117 | { | ||
| 118 | #ifdef __BIG_ENDIAN | ||
| 119 | __swab64s(p); | ||
| 120 | #endif | ||
| 121 | } | ||
| 122 | |||
| 123 | static inline void __cpu_to_le64s(__u64 *p) | ||
| 124 | { | ||
| 125 | #ifdef __BIG_ENDIAN | ||
| 126 | __swab64s(p); | ||
| 127 | #endif | ||
| 128 | } | ||
| 129 | |||
| 130 | static inline void __be16_to_cpus(__u16 *p) | ||
| 131 | { | ||
| 132 | #ifdef __LITTLE_ENDIAN | ||
| 133 | __swab16s(p); | ||
| 134 | #endif | ||
| 135 | } | ||
| 136 | |||
| 137 | static inline void __cpu_to_be16s(__u16 *p) | ||
| 138 | { | ||
| 139 | #ifdef __LITTLE_ENDIAN | ||
| 140 | __swab16s(p); | ||
| 141 | #endif | ||
| 142 | } | ||
| 143 | |||
| 144 | static inline void __be32_to_cpus(__u32 *p) | ||
| 145 | { | ||
| 146 | #ifdef __LITTLE_ENDIAN | ||
| 147 | __swab32s(p); | ||
| 148 | #endif | ||
| 149 | } | ||
| 150 | |||
| 151 | static inline void __cpu_to_be32s(__u32 *p) | ||
| 152 | { | ||
| 153 | #ifdef __LITTLE_ENDIAN | ||
| 154 | __swab32s(p); | ||
| 155 | #endif | ||
| 156 | } | ||
| 157 | |||
| 158 | static inline void __be64_to_cpus(__u64 *p) | ||
| 159 | { | ||
| 160 | #ifdef __LITTLE_ENDIAN | ||
| 161 | __swab64s(p); | ||
| 162 | #endif | ||
| 163 | } | ||
| 164 | |||
| 165 | static inline void __cpu_to_be64s(__u64 *p) | ||
| 166 | { | ||
| 167 | #ifdef __LITTLE_ENDIAN | ||
| 168 | __swab64s(p); | ||
| 169 | #endif | ||
| 170 | } | ||
| 171 | |||
| 172 | static inline __u16 __le16_to_cpup(const __le16 *p) | ||
| 173 | { | ||
| 174 | #ifdef __LITTLE_ENDIAN | ||
| 175 | return (__force __u16)*p; | ||
| 176 | #else | ||
| 177 | return __swab16p((__force __u16 *)p); | ||
| 178 | #endif | ||
| 179 | } | ||
| 180 | |||
| 181 | static inline __u32 __le32_to_cpup(const __le32 *p) | ||
| 182 | { | ||
| 183 | #ifdef __LITTLE_ENDIAN | ||
| 184 | return (__force __u32)*p; | ||
| 185 | #else | ||
| 186 | return __swab32p((__force __u32 *)p); | ||
| 187 | #endif | ||
| 188 | } | ||
| 189 | |||
| 190 | static inline __u64 __le64_to_cpup(const __le64 *p) | ||
| 191 | { | ||
| 192 | #ifdef __LITTLE_ENDIAN | ||
| 193 | return (__force __u64)*p; | ||
| 194 | #else | ||
| 195 | return __swab64p((__force __u64 *)p); | ||
| 196 | #endif | ||
| 197 | } | ||
| 198 | |||
| 199 | static inline __le16 __cpu_to_le16p(const __u16 *p) | ||
| 200 | { | ||
| 201 | #ifdef __LITTLE_ENDIAN | ||
| 202 | return (__force __le16)*p; | ||
| 203 | #else | ||
| 204 | return (__force __le16)__swab16p(p); | ||
| 205 | #endif | ||
| 206 | } | ||
| 207 | |||
| 208 | static inline __le32 __cpu_to_le32p(const __u32 *p) | ||
| 209 | { | ||
| 210 | #ifdef __LITTLE_ENDIAN | ||
| 211 | return (__force __le32)*p; | ||
| 212 | #else | ||
| 213 | return (__force __le32)__swab32p(p); | ||
| 214 | #endif | ||
| 215 | } | ||
| 216 | |||
| 217 | static inline __le64 __cpu_to_le64p(const __u64 *p) | ||
| 218 | { | ||
| 219 | #ifdef __LITTLE_ENDIAN | ||
| 220 | return (__force __le64)*p; | ||
| 221 | #else | ||
| 222 | return (__force __le64)__swab64p(p); | ||
| 223 | #endif | ||
| 224 | } | ||
| 225 | |||
| 226 | static inline __u16 __be16_to_cpup(const __be16 *p) | ||
| 227 | { | ||
| 228 | #ifdef __BIG_ENDIAN | ||
| 229 | return (__force __u16)*p; | ||
| 230 | #else | ||
| 231 | return __swab16p((__force __u16 *)p); | ||
| 232 | #endif | ||
| 233 | } | ||
| 234 | |||
| 235 | static inline __u32 __be32_to_cpup(const __be32 *p) | ||
| 236 | { | ||
| 237 | #ifdef __BIG_ENDIAN | ||
| 238 | return (__force __u32)*p; | ||
| 239 | #else | ||
| 240 | return __swab32p((__force __u32 *)p); | ||
| 241 | #endif | ||
| 242 | } | ||
| 243 | |||
| 244 | static inline __u64 __be64_to_cpup(const __be64 *p) | ||
| 245 | { | ||
| 246 | #ifdef __BIG_ENDIAN | ||
| 247 | return (__force __u64)*p; | ||
| 248 | #else | ||
| 249 | return __swab64p((__force __u64 *)p); | ||
| 250 | #endif | ||
| 251 | } | ||
| 252 | |||
| 253 | static inline __be16 __cpu_to_be16p(const __u16 *p) | ||
| 254 | { | ||
| 255 | #ifdef __BIG_ENDIAN | ||
| 256 | return (__force __be16)*p; | ||
| 257 | #else | ||
| 258 | return (__force __be16)__swab16p(p); | ||
| 259 | #endif | ||
| 260 | } | ||
| 261 | |||
| 262 | static inline __be32 __cpu_to_be32p(const __u32 *p) | ||
| 263 | { | ||
| 264 | #ifdef __BIG_ENDIAN | ||
| 265 | return (__force __be32)*p; | ||
| 266 | #else | ||
| 267 | return (__force __be32)__swab32p(p); | ||
| 268 | #endif | ||
| 269 | } | ||
| 270 | |||
| 271 | static inline __be64 __cpu_to_be64p(const __u64 *p) | ||
| 272 | { | ||
| 273 | #ifdef __BIG_ENDIAN | ||
| 274 | return (__force __be64)*p; | ||
| 275 | #else | ||
| 276 | return (__force __be64)__swab64p(p); | ||
| 277 | #endif | ||
| 278 | } | ||
| 279 | |||
| 280 | #ifdef __KERNEL__ | ||
| 281 | |||
| 282 | # define le16_to_cpu __le16_to_cpu | ||
| 283 | # define le32_to_cpu __le32_to_cpu | ||
| 284 | # define le64_to_cpu __le64_to_cpu | ||
| 285 | # define be16_to_cpu __be16_to_cpu | ||
| 286 | # define be32_to_cpu __be32_to_cpu | ||
| 287 | # define be64_to_cpu __be64_to_cpu | ||
| 288 | # define cpu_to_le16 __cpu_to_le16 | ||
| 289 | # define cpu_to_le32 __cpu_to_le32 | ||
| 290 | # define cpu_to_le64 __cpu_to_le64 | ||
| 291 | # define cpu_to_be16 __cpu_to_be16 | ||
| 292 | # define cpu_to_be32 __cpu_to_be32 | ||
| 293 | # define cpu_to_be64 __cpu_to_be64 | ||
| 294 | |||
| 295 | # define le16_to_cpup __le16_to_cpup | ||
| 296 | # define le32_to_cpup __le32_to_cpup | ||
| 297 | # define le64_to_cpup __le64_to_cpup | ||
| 298 | # define be16_to_cpup __be16_to_cpup | ||
| 299 | # define be32_to_cpup __be32_to_cpup | ||
| 300 | # define be64_to_cpup __be64_to_cpup | ||
| 301 | # define cpu_to_le16p __cpu_to_le16p | ||
| 302 | # define cpu_to_le32p __cpu_to_le32p | ||
| 303 | # define cpu_to_le64p __cpu_to_le64p | ||
| 304 | # define cpu_to_be16p __cpu_to_be16p | ||
| 305 | # define cpu_to_be32p __cpu_to_be32p | ||
| 306 | # define cpu_to_be64p __cpu_to_be64p | ||
| 307 | |||
| 308 | # define le16_to_cpus __le16_to_cpus | ||
| 309 | # define le32_to_cpus __le32_to_cpus | ||
| 310 | # define le64_to_cpus __le64_to_cpus | ||
| 311 | # define be16_to_cpus __be16_to_cpus | ||
| 312 | # define be32_to_cpus __be32_to_cpus | ||
| 313 | # define be64_to_cpus __be64_to_cpus | ||
| 314 | # define cpu_to_le16s __cpu_to_le16s | ||
| 315 | # define cpu_to_le32s __cpu_to_le32s | ||
| 316 | # define cpu_to_le64s __cpu_to_le64s | ||
| 317 | # define cpu_to_be16s __cpu_to_be16s | ||
| 318 | # define cpu_to_be32s __cpu_to_be32s | ||
| 319 | # define cpu_to_be64s __cpu_to_be64s | ||
| 320 | |||
| 321 | /* | ||
| 322 | * They have to be macros in order to do the constant folding | ||
| 323 | * correctly - if the argument passed into a inline function | ||
| 324 | * it is no longer constant according to gcc.. | ||
| 325 | */ | ||
| 326 | # undef ntohl | ||
| 327 | # undef ntohs | ||
| 328 | # undef htonl | ||
| 329 | # undef htons | ||
| 330 | |||
| 331 | # define ___htonl(x) __cpu_to_be32(x) | ||
| 332 | # define ___htons(x) __cpu_to_be16(x) | ||
| 333 | # define ___ntohl(x) __be32_to_cpu(x) | ||
| 334 | # define ___ntohs(x) __be16_to_cpu(x) | ||
| 335 | |||
| 336 | # define htonl(x) ___htonl(x) | ||
| 337 | # define ntohl(x) ___ntohl(x) | ||
| 338 | # define htons(x) ___htons(x) | ||
| 339 | # define ntohs(x) ___ntohs(x) | ||
| 340 | |||
| 341 | static inline void le16_add_cpu(__le16 *var, u16 val) | ||
| 342 | { | ||
| 343 | *var = cpu_to_le16(le16_to_cpup(var) + val); | ||
| 344 | } | ||
| 345 | |||
| 346 | static inline void le32_add_cpu(__le32 *var, u32 val) | ||
| 347 | { | ||
| 348 | *var = cpu_to_le32(le32_to_cpup(var) + val); | ||
| 349 | } | ||
| 350 | |||
| 351 | static inline void le64_add_cpu(__le64 *var, u64 val) | ||
| 352 | { | ||
| 353 | *var = cpu_to_le64(le64_to_cpup(var) + val); | ||
| 354 | } | ||
| 355 | |||
| 356 | static inline void be16_add_cpu(__be16 *var, u16 val) | ||
| 357 | { | ||
| 358 | *var = cpu_to_be16(be16_to_cpup(var) + val); | ||
| 359 | } | ||
| 360 | |||
| 361 | static inline void be32_add_cpu(__be32 *var, u32 val) | ||
| 362 | { | ||
| 363 | *var = cpu_to_be32(be32_to_cpup(var) + val); | ||
| 364 | } | ||
| 365 | |||
| 366 | static inline void be64_add_cpu(__be64 *var, u64 val) | ||
| 367 | { | ||
| 368 | *var = cpu_to_be64(be64_to_cpup(var) + val); | ||
| 369 | } | ||
| 370 | |||
| 371 | #endif /* __KERNEL__ */ | ||
| 372 | #endif /* _LINUX_BYTEORDER_H */ | ||
diff --git a/include/linux/firmware-map.h b/include/linux/firmware-map.h index acbdbcc16051..6e199c8dfacc 100644 --- a/include/linux/firmware-map.h +++ b/include/linux/firmware-map.h | |||
| @@ -24,34 +24,8 @@ | |||
| 24 | */ | 24 | */ |
| 25 | #ifdef CONFIG_FIRMWARE_MEMMAP | 25 | #ifdef CONFIG_FIRMWARE_MEMMAP |
| 26 | 26 | ||
| 27 | /** | ||
| 28 | * Adds a firmware mapping entry. This function uses kmalloc() for memory | ||
| 29 | * allocation. Use firmware_map_add_early() if you want to use the bootmem | ||
| 30 | * allocator. | ||
| 31 | * | ||
| 32 | * That function must be called before late_initcall. | ||
| 33 | * | ||
| 34 | * @start: Start of the memory range. | ||
| 35 | * @end: End of the memory range (inclusive). | ||
| 36 | * @type: Type of the memory range. | ||
| 37 | * | ||
| 38 | * Returns 0 on success, or -ENOMEM if no memory could be allocated. | ||
| 39 | */ | ||
| 40 | int firmware_map_add(resource_size_t start, resource_size_t end, | 27 | int firmware_map_add(resource_size_t start, resource_size_t end, |
| 41 | const char *type); | 28 | const char *type); |
| 42 | |||
| 43 | /** | ||
| 44 | * Adds a firmware mapping entry. This function uses the bootmem allocator | ||
| 45 | * for memory allocation. Use firmware_map_add() if you want to use kmalloc(). | ||
| 46 | * | ||
| 47 | * That function must be called before late_initcall. | ||
| 48 | * | ||
| 49 | * @start: Start of the memory range. | ||
| 50 | * @end: End of the memory range (inclusive). | ||
| 51 | * @type: Type of the memory range. | ||
| 52 | * | ||
| 53 | * Returns 0 on success, or -ENOMEM if no memory could be allocated. | ||
| 54 | */ | ||
| 55 | int firmware_map_add_early(resource_size_t start, resource_size_t end, | 29 | int firmware_map_add_early(resource_size_t start, resource_size_t end, |
| 56 | const char *type); | 30 | const char *type); |
| 57 | 31 | ||
diff --git a/include/linux/harrier_defs.h b/include/linux/harrier_defs.h deleted file mode 100644 index efef11db790f..000000000000 --- a/include/linux/harrier_defs.h +++ /dev/null | |||
| @@ -1,212 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/linux/harrier_defs.h | ||
| 3 | * | ||
| 4 | * Definitions for Motorola MCG Harrier North Bridge & Memory controller | ||
| 5 | * | ||
| 6 | * Author: Dale Farnsworth | ||
| 7 | * dale.farnsworth@mvista.com | ||
| 8 | * | ||
| 9 | * Extracted from asm-ppc/harrier.h by: | ||
| 10 | * Randy Vinson | ||
| 11 | * rvinson@mvista.com | ||
| 12 | * | ||
| 13 | * Copyright 2001-2002 MontaVista Software Inc. | ||
| 14 | * | ||
| 15 | * This program is free software; you can redistribute it and/or modify it | ||
| 16 | * under the terms of the GNU General Public License as published by the | ||
| 17 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 18 | * option) any later version. | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __ASMPPC_HARRIER_DEFS_H | ||
| 22 | #define __ASMPPC_HARRIER_DEFS_H | ||
| 23 | |||
| 24 | #define HARRIER_DEFAULT_XCSR_BASE 0xfeff0000 | ||
| 25 | |||
| 26 | #define HARRIER_VEND_DEV_ID 0x1057480b | ||
| 27 | |||
| 28 | #define HARRIER_VENI_OFF 0x00 | ||
| 29 | |||
| 30 | #define HARRIER_REVI_OFF 0x05 | ||
| 31 | #define HARRIER_UCTL_OFF 0xd0 | ||
| 32 | #define HARRIER_XTAL64_MASK 0x02 | ||
| 33 | |||
| 34 | #define HARRIER_MISC_CSR_OFF 0x1c | ||
| 35 | #define HARRIER_RSTOUT 0x01000000 | ||
| 36 | #define HARRIER_SYSCON 0x08000000 | ||
| 37 | #define HARRIER_EREADY 0x10000000 | ||
| 38 | #define HARRIER_ERDYS 0x20000000 | ||
| 39 | |||
| 40 | /* Function exception registers */ | ||
| 41 | #define HARRIER_FEEN_OFF 0x40 /* enable */ | ||
| 42 | #define HARRIER_FEST_OFF 0x44 /* status */ | ||
| 43 | #define HARRIER_FEMA_OFF 0x48 /* mask */ | ||
| 44 | #define HARRIER_FECL_OFF 0x4c /* clear */ | ||
| 45 | |||
| 46 | #define HARRIER_FE_DMA 0x80 | ||
| 47 | #define HARRIER_FE_MIDB 0x40 | ||
| 48 | #define HARRIER_FE_MIM0 0x20 | ||
| 49 | #define HARRIER_FE_MIM1 0x10 | ||
| 50 | #define HARRIER_FE_MIP 0x08 | ||
| 51 | #define HARRIER_FE_UA0 0x04 | ||
| 52 | #define HARRIER_FE_UA1 0x02 | ||
| 53 | #define HARRIER_FE_ABT 0x01 | ||
| 54 | |||
| 55 | #define HARRIER_SERIAL_0_OFF 0xc0 | ||
| 56 | |||
| 57 | #define HARRIER_MBAR_OFF 0xe0 | ||
| 58 | #define HARRIER_MBAR_MSK 0xfffc0000 | ||
| 59 | #define HARRIER_MPIC_CSR_OFF 0xe4 | ||
| 60 | #define HARRIER_MPIC_OPI_ENABLE 0x40 | ||
| 61 | #define HARRIER_MPIC_IFEVP_OFF 0x10200 | ||
| 62 | #define HARRIER_MPIC_IFEVP_VECT_MSK 0xff | ||
| 63 | #define HARRIER_MPIC_IFEDE_OFF 0x10210 | ||
| 64 | |||
| 65 | /* | ||
| 66 | * Define the Memory Controller register offsets. | ||
| 67 | */ | ||
| 68 | #define HARRIER_SDBA_OFF 0x110 | ||
| 69 | #define HARRIER_SDBB_OFF 0x114 | ||
| 70 | #define HARRIER_SDBC_OFF 0x118 | ||
| 71 | #define HARRIER_SDBD_OFF 0x11c | ||
| 72 | #define HARRIER_SDBE_OFF 0x120 | ||
| 73 | #define HARRIER_SDBF_OFF 0x124 | ||
| 74 | #define HARRIER_SDBG_OFF 0x128 | ||
| 75 | #define HARRIER_SDBH_OFF 0x12c | ||
| 76 | |||
| 77 | #define HARRIER_SDB_ENABLE 0x00000100 | ||
| 78 | #define HARRIER_SDB_SIZE_MASK 0xf | ||
| 79 | #define HARRIER_SDB_SIZE_SHIFT 16 | ||
| 80 | #define HARRIER_SDB_BASE_MASK 0xff | ||
| 81 | #define HARRIER_SDB_BASE_SHIFT 24 | ||
| 82 | |||
| 83 | /* | ||
| 84 | * Define outbound register offsets. | ||
| 85 | */ | ||
| 86 | #define HARRIER_OTAD0_OFF 0x220 | ||
| 87 | #define HARRIER_OTOF0_OFF 0x224 | ||
| 88 | #define HARRIER_OTAD1_OFF 0x228 | ||
| 89 | #define HARRIER_OTOF1_OFF 0x22c | ||
| 90 | #define HARRIER_OTAD2_OFF 0x230 | ||
| 91 | #define HARRIER_OTOF2_OFF 0x234 | ||
| 92 | #define HARRIER_OTAD3_OFF 0x238 | ||
| 93 | #define HARRIER_OTOF3_OFF 0x23c | ||
| 94 | |||
| 95 | #define HARRIER_OTADX_START_MSK 0xffff0000UL | ||
| 96 | #define HARRIER_OTADX_END_MSK 0x0000ffffUL | ||
| 97 | |||
| 98 | #define HARRIER_OTOFX_OFF_MSK 0xffff0000UL | ||
| 99 | #define HARRIER_OTOFX_ENA 0x80UL | ||
| 100 | #define HARRIER_OTOFX_WPE 0x10UL | ||
| 101 | #define HARRIER_OTOFX_SGE 0x08UL | ||
| 102 | #define HARRIER_OTOFX_RAE 0x04UL | ||
| 103 | #define HARRIER_OTOFX_MEM 0x02UL | ||
| 104 | #define HARRIER_OTOFX_IOM 0x01UL | ||
| 105 | |||
| 106 | /* | ||
| 107 | * Define generic message passing register offsets | ||
| 108 | */ | ||
| 109 | /* Mirrored registers (visible from both PowerPC and PCI space) */ | ||
| 110 | #define HARRIER_XCSR_MP_BASE_OFF 0x290 /* base offset in XCSR space */ | ||
| 111 | #define HARRIER_PMEP_MP_BASE_OFF 0x100 /* base offset in PMEM space */ | ||
| 112 | #define HARRIER_MGOM0_OFF 0x00 /* outbound msg 0 */ | ||
| 113 | #define HARRIER_MGOM1_OFF 0x04 /* outbound msg 1 */ | ||
| 114 | #define HARRIER_MGOD_OFF 0x08 /* outbound doorbells */ | ||
| 115 | |||
| 116 | #define HARRIER_MGIM0_OFF 0x10 /* inbound msg 0 */ | ||
| 117 | #define HARRIER_MGIM1_OFF 0x14 /* inbound msg 1 */ | ||
| 118 | #define HARRIER_MGID_OFF 0x18 /* inbound doorbells */ | ||
| 119 | |||
| 120 | /* PowerPC-only registers */ | ||
| 121 | #define HARRIER_MGIDM_OFF 0x20 /* inbound doorbell mask */ | ||
| 122 | |||
| 123 | /* PCI-only registers */ | ||
| 124 | #define HARRIER_PMEP_MGST_OFF 0x20 /* (outbound) interrupt status */ | ||
| 125 | #define HARRIER_PMEP_MGMS_OFF 0x24 /* (outbound) interrupt mask */ | ||
| 126 | #define HARRIER_MG_OMI0 (1<<4) | ||
| 127 | #define HARRIER_MG_OMI1 (1<<5) | ||
| 128 | |||
| 129 | #define HARRIER_PMEP_MGODM_OFF 0x28 /* outbound doorbell mask */ | ||
| 130 | |||
| 131 | /* | ||
| 132 | * Define PCI configuration space register offsets | ||
| 133 | */ | ||
| 134 | #define HARRIER_XCSR_TO_PCFS_OFF 0x300 | ||
| 135 | |||
| 136 | /* | ||
| 137 | * Define message passing attribute register offset | ||
| 138 | */ | ||
| 139 | #define HARRIER_MPAT_OFF 0x44 | ||
| 140 | |||
| 141 | /* | ||
| 142 | * Define inbound attribute register offsets. | ||
| 143 | */ | ||
| 144 | #define HARRIER_ITSZ0_OFF 0x48 | ||
| 145 | #define HARRIER_ITAT0_OFF 0x4c | ||
| 146 | |||
| 147 | #define HARRIER_ITSZ1_OFF 0x50 | ||
| 148 | #define HARRIER_ITAT1_OFF 0x54 | ||
| 149 | |||
| 150 | #define HARRIER_ITSZ2_OFF 0x58 | ||
| 151 | #define HARRIER_ITAT2_OFF 0x5c | ||
| 152 | |||
| 153 | #define HARRIER_ITSZ3_OFF 0x60 | ||
| 154 | #define HARRIER_ITAT3_OFF 0x64 | ||
| 155 | |||
| 156 | /* inbound translation size constants */ | ||
| 157 | #define HARRIER_ITSZ_MSK 0xff | ||
| 158 | #define HARRIER_ITSZ_4KB 0x00 | ||
| 159 | #define HARRIER_ITSZ_8KB 0x01 | ||
| 160 | #define HARRIER_ITSZ_16KB 0x02 | ||
| 161 | #define HARRIER_ITSZ_32KB 0x03 | ||
| 162 | #define HARRIER_ITSZ_64KB 0x04 | ||
| 163 | #define HARRIER_ITSZ_128KB 0x05 | ||
| 164 | #define HARRIER_ITSZ_256KB 0x06 | ||
| 165 | #define HARRIER_ITSZ_512KB 0x07 | ||
| 166 | #define HARRIER_ITSZ_1MB 0x08 | ||
| 167 | #define HARRIER_ITSZ_2MB 0x09 | ||
| 168 | #define HARRIER_ITSZ_4MB 0x0A | ||
| 169 | #define HARRIER_ITSZ_8MB 0x0B | ||
| 170 | #define HARRIER_ITSZ_16MB 0x0C | ||
| 171 | #define HARRIER_ITSZ_32MB 0x0D | ||
| 172 | #define HARRIER_ITSZ_64MB 0x0E | ||
| 173 | #define HARRIER_ITSZ_128MB 0x0F | ||
| 174 | #define HARRIER_ITSZ_256MB 0x10 | ||
| 175 | #define HARRIER_ITSZ_512MB 0x11 | ||
| 176 | #define HARRIER_ITSZ_1GB 0x12 | ||
| 177 | #define HARRIER_ITSZ_2GB 0x13 | ||
| 178 | |||
| 179 | /* inbound translation offset */ | ||
| 180 | #define HARRIER_ITOF_SHIFT 0x10 | ||
| 181 | #define HARRIER_ITOF_MSK 0xffff | ||
| 182 | |||
| 183 | /* inbound translation atttributes */ | ||
| 184 | #define HARRIER_ITAT_PRE (1<<3) | ||
| 185 | #define HARRIER_ITAT_RAE (1<<4) | ||
| 186 | #define HARRIER_ITAT_WPE (1<<5) | ||
| 187 | #define HARRIER_ITAT_MEM (1<<6) | ||
| 188 | #define HARRIER_ITAT_ENA (1<<7) | ||
| 189 | #define HARRIER_ITAT_GBL (1<<16) | ||
| 190 | |||
| 191 | #define HARRIER_LBA_OFF 0x80 | ||
| 192 | #define HARRIER_LBA_MSK (1<<31) | ||
| 193 | |||
| 194 | #define HARRIER_XCSR_SIZE 1024 | ||
| 195 | |||
| 196 | /* macros to calculate message passing register offsets */ | ||
| 197 | #define HARRIER_MP_XCSR(x) ((u32)HARRIER_XCSR_MP_BASE_OFF + (u32)x) | ||
| 198 | |||
| 199 | #define HARRIER_MP_PMEP(x) ((u32)HARRIER_PMEP_MP_BASE_OFF + (u32)x) | ||
| 200 | |||
| 201 | /* | ||
| 202 | * Define PCI configuration space register offsets | ||
| 203 | */ | ||
| 204 | #define HARRIER_MPBAR_OFF PCI_BASE_ADDRESS_0 | ||
| 205 | #define HARRIER_ITBAR0_OFF PCI_BASE_ADDRESS_1 | ||
| 206 | #define HARRIER_ITBAR1_OFF PCI_BASE_ADDRESS_2 | ||
| 207 | #define HARRIER_ITBAR2_OFF PCI_BASE_ADDRESS_3 | ||
| 208 | #define HARRIER_ITBAR3_OFF PCI_BASE_ADDRESS_4 | ||
| 209 | |||
| 210 | #define HARRIER_XCSR_CONFIG(x) ((u32)HARRIER_XCSR_TO_PCFS_OFF + (u32)x) | ||
| 211 | |||
| 212 | #endif /* __ASMPPC_HARRIER_DEFS_H */ | ||
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index 4862398e05bf..bf34c5f4c051 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
| @@ -39,7 +39,6 @@ | |||
| 39 | #define I2C_DRIVERID_SAA7111A 8 /* video input processor */ | 39 | #define I2C_DRIVERID_SAA7111A 8 /* video input processor */ |
| 40 | #define I2C_DRIVERID_SAA7185B 13 /* video encoder */ | 40 | #define I2C_DRIVERID_SAA7185B 13 /* video encoder */ |
| 41 | #define I2C_DRIVERID_SAA7110 22 /* video decoder */ | 41 | #define I2C_DRIVERID_SAA7110 22 /* video decoder */ |
| 42 | #define I2C_DRIVERID_MGATVO 23 /* Matrox TVOut */ | ||
| 43 | #define I2C_DRIVERID_SAA5249 24 /* SAA5249 and compatibles */ | 42 | #define I2C_DRIVERID_SAA5249 24 /* SAA5249 and compatibles */ |
| 44 | #define I2C_DRIVERID_PCF8583 25 /* real time clock */ | 43 | #define I2C_DRIVERID_PCF8583 25 /* real time clock */ |
| 45 | #define I2C_DRIVERID_SAB3036 26 /* SAB3036 tuner */ | 44 | #define I2C_DRIVERID_SAB3036 26 /* SAB3036 tuner */ |
| @@ -95,7 +94,6 @@ | |||
| 95 | #define I2C_HW_B_BT848 0x010005 /* BT848 video boards */ | 94 | #define I2C_HW_B_BT848 0x010005 /* BT848 video boards */ |
| 96 | #define I2C_HW_B_VIA 0x010007 /* Via vt82c586b */ | 95 | #define I2C_HW_B_VIA 0x010007 /* Via vt82c586b */ |
| 97 | #define I2C_HW_B_HYDRA 0x010008 /* Apple Hydra Mac I/O */ | 96 | #define I2C_HW_B_HYDRA 0x010008 /* Apple Hydra Mac I/O */ |
| 98 | #define I2C_HW_B_G400 0x010009 /* Matrox G400 */ | ||
| 99 | #define I2C_HW_B_I810 0x01000a /* Intel I810 */ | 97 | #define I2C_HW_B_I810 0x01000a /* Intel I810 */ |
| 100 | #define I2C_HW_B_VOO 0x01000b /* 3dfx Voodoo 3 / Banshee */ | 98 | #define I2C_HW_B_VOO 0x01000b /* 3dfx Voodoo 3 / Banshee */ |
| 101 | #define I2C_HW_B_SCX200 0x01000e /* Nat'l Semi SCx200 I2C */ | 99 | #define I2C_HW_B_SCX200 0x01000e /* Nat'l Semi SCx200 I2C */ |
diff --git a/include/linux/init.h b/include/linux/init.h index 11b84e106053..93538b696e3d 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
| @@ -139,6 +139,7 @@ extern initcall_t __con_initcall_start[], __con_initcall_end[]; | |||
| 139 | extern initcall_t __security_initcall_start[], __security_initcall_end[]; | 139 | extern initcall_t __security_initcall_start[], __security_initcall_end[]; |
| 140 | 140 | ||
| 141 | /* Defined in init/main.c */ | 141 | /* Defined in init/main.c */ |
| 142 | extern int do_one_initcall(initcall_t fn); | ||
| 142 | extern char __initdata boot_command_line[]; | 143 | extern char __initdata boot_command_line[]; |
| 143 | extern char *saved_command_line; | 144 | extern char *saved_command_line; |
| 144 | extern unsigned int reset_devices; | 145 | extern unsigned int reset_devices; |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index aaa998f65c7a..2651f805ba6d 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -108,6 +108,13 @@ struct completion; | |||
| 108 | struct pt_regs; | 108 | struct pt_regs; |
| 109 | struct user; | 109 | struct user; |
| 110 | 110 | ||
| 111 | #ifdef CONFIG_PREEMPT_VOLUNTARY | ||
| 112 | extern int _cond_resched(void); | ||
| 113 | # define might_resched() _cond_resched() | ||
| 114 | #else | ||
| 115 | # define might_resched() do { } while (0) | ||
| 116 | #endif | ||
| 117 | |||
| 111 | /** | 118 | /** |
| 112 | * might_sleep - annotation for functions that can sleep | 119 | * might_sleep - annotation for functions that can sleep |
| 113 | * | 120 | * |
| @@ -118,13 +125,6 @@ struct user; | |||
| 118 | * be bitten later when the calling function happens to sleep when it is not | 125 | * be bitten later when the calling function happens to sleep when it is not |
| 119 | * supposed to. | 126 | * supposed to. |
| 120 | */ | 127 | */ |
| 121 | #ifdef CONFIG_PREEMPT_VOLUNTARY | ||
| 122 | extern int _cond_resched(void); | ||
| 123 | # define might_resched() _cond_resched() | ||
| 124 | #else | ||
| 125 | # define might_resched() do { } while (0) | ||
| 126 | #endif | ||
| 127 | |||
| 128 | #ifdef CONFIG_DEBUG_SPINLOCK_SLEEP | 128 | #ifdef CONFIG_DEBUG_SPINLOCK_SLEEP |
| 129 | void __might_sleep(char *file, int line); | 129 | void __might_sleep(char *file, int line); |
| 130 | # define might_sleep() \ | 130 | # define might_sleep() \ |
diff --git a/include/linux/mfd/t7l66xb.h b/include/linux/mfd/t7l66xb.h new file mode 100644 index 000000000000..e83c7f2036f9 --- /dev/null +++ b/include/linux/mfd/t7l66xb.h | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | /* | ||
| 2 | * This file contains the definitions for the T7L66XB | ||
| 3 | * | ||
| 4 | * (C) Copyright 2005 Ian Molton <spyro@f2s.com> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | */ | ||
| 11 | #ifndef MFD_T7L66XB_H | ||
| 12 | #define MFD_T7L66XB_H | ||
| 13 | |||
| 14 | #include <linux/mfd/core.h> | ||
| 15 | #include <linux/mfd/tmio.h> | ||
| 16 | |||
| 17 | struct t7l66xb_platform_data { | ||
| 18 | int (*enable_clk32k)(struct platform_device *dev); | ||
| 19 | void (*disable_clk32k)(struct platform_device *dev); | ||
| 20 | int (*enable)(struct platform_device *dev); | ||
| 21 | int (*disable)(struct platform_device *dev); | ||
| 22 | int (*suspend)(struct platform_device *dev); | ||
| 23 | int (*resume)(struct platform_device *dev); | ||
| 24 | |||
| 25 | int irq_base; /* The base for subdevice irqs */ | ||
| 26 | |||
| 27 | struct tmio_nand_data *nand_data; | ||
| 28 | }; | ||
| 29 | |||
| 30 | |||
| 31 | #define IRQ_T7L66XB_MMC (1) | ||
| 32 | #define IRQ_T7L66XB_NAND (3) | ||
| 33 | |||
| 34 | #define T7L66XB_NR_IRQS 8 | ||
| 35 | |||
| 36 | #endif | ||
diff --git a/include/linux/mfd/tc6387xb.h b/include/linux/mfd/tc6387xb.h new file mode 100644 index 000000000000..fa06e0610b8e --- /dev/null +++ b/include/linux/mfd/tc6387xb.h | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | /* | ||
| 2 | * This file contains the definitions for the TC6387XB | ||
| 3 | * | ||
| 4 | * (C) Copyright 2005 Ian Molton <spyro@f2s.com> | ||
| 5 | * | ||
| 6 | * May be copied or modified under the terms of the GNU General Public | ||
| 7 | * License. See linux/COPYING for more information. | ||
| 8 | * | ||
| 9 | */ | ||
| 10 | #ifndef MFD_TC6387XB_H | ||
| 11 | #define MFD_TC6387XB_H | ||
| 12 | |||
| 13 | struct tc6387xb_platform_data { | ||
| 14 | int (*enable_clk32k)(struct platform_device *dev); | ||
| 15 | void (*disable_clk32k)(struct platform_device *dev); | ||
| 16 | |||
| 17 | int (*enable)(struct platform_device *dev); | ||
| 18 | int (*disable)(struct platform_device *dev); | ||
| 19 | int (*suspend)(struct platform_device *dev); | ||
| 20 | int (*resume)(struct platform_device *dev); | ||
| 21 | }; | ||
| 22 | |||
| 23 | #endif | ||
diff --git a/include/linux/mfd/tc6393xb.h b/include/linux/mfd/tc6393xb.h index 7cc824a58f7c..fec7b3f7a81f 100644 --- a/include/linux/mfd/tc6393xb.h +++ b/include/linux/mfd/tc6393xb.h | |||
| @@ -14,8 +14,8 @@ | |||
| 14 | * published by the Free Software Foundation. | 14 | * published by the Free Software Foundation. |
| 15 | */ | 15 | */ |
| 16 | 16 | ||
| 17 | #ifndef TC6393XB_H | 17 | #ifndef MFD_TC6393XB_H |
| 18 | #define TC6393XB_H | 18 | #define MFD_TC6393XB_H |
| 19 | 19 | ||
| 20 | /* Also one should provide the CK3P6MI clock */ | 20 | /* Also one should provide the CK3P6MI clock */ |
| 21 | struct tc6393xb_platform_data { | 21 | struct tc6393xb_platform_data { |
| @@ -29,7 +29,7 @@ struct tc6393xb_platform_data { | |||
| 29 | int (*suspend)(struct platform_device *dev); | 29 | int (*suspend)(struct platform_device *dev); |
| 30 | int (*resume)(struct platform_device *dev); | 30 | int (*resume)(struct platform_device *dev); |
| 31 | 31 | ||
| 32 | int irq_base; /* a base for cascaded irq */ | 32 | int irq_base; /* base for subdevice irqs */ |
| 33 | int gpio_base; | 33 | int gpio_base; |
| 34 | 34 | ||
| 35 | struct tmio_nand_data *nand_data; | 35 | struct tmio_nand_data *nand_data; |
| @@ -40,9 +40,6 @@ struct tc6393xb_platform_data { | |||
| 40 | */ | 40 | */ |
| 41 | #define IRQ_TC6393_NAND 0 | 41 | #define IRQ_TC6393_NAND 0 |
| 42 | #define IRQ_TC6393_MMC 1 | 42 | #define IRQ_TC6393_MMC 1 |
| 43 | #define IRQ_TC6393_OHCI 2 | ||
| 44 | #define IRQ_TC6393_SERIAL 3 | ||
| 45 | #define IRQ_TC6393_FB 4 | ||
| 46 | 43 | ||
| 47 | #define TC6393XB_NR_IRQS 8 | 44 | #define TC6393XB_NR_IRQS 8 |
| 48 | 45 | ||
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h index 9438d8c9ac1c..ec612e66391c 100644 --- a/include/linux/mfd/tmio.h +++ b/include/linux/mfd/tmio.h | |||
| @@ -1,6 +1,21 @@ | |||
| 1 | #ifndef MFD_TMIO_H | 1 | #ifndef MFD_TMIO_H |
| 2 | #define MFD_TMIO_H | 2 | #define MFD_TMIO_H |
| 3 | 3 | ||
| 4 | #define tmio_ioread8(addr) readb(addr) | ||
| 5 | #define tmio_ioread16(addr) readw(addr) | ||
| 6 | #define tmio_ioread16_rep(r, b, l) readsw(r, b, l) | ||
| 7 | #define tmio_ioread32(addr) \ | ||
| 8 | (((u32) readw((addr))) | (((u32) readw((addr) + 2)) << 16)) | ||
| 9 | |||
| 10 | #define tmio_iowrite8(val, addr) writeb((val), (addr)) | ||
| 11 | #define tmio_iowrite16(val, addr) writew((val), (addr)) | ||
| 12 | #define tmio_iowrite16_rep(r, b, l) writesw(r, b, l) | ||
| 13 | #define tmio_iowrite32(val, addr) \ | ||
| 14 | do { \ | ||
| 15 | writew((val), (addr)); \ | ||
| 16 | writew((val) >> 16, (addr) + 2); \ | ||
| 17 | } while (0) | ||
| 18 | |||
| 4 | /* | 19 | /* |
| 5 | * data for the NAND controller | 20 | * data for the NAND controller |
| 6 | */ | 21 | */ |
| @@ -10,8 +25,4 @@ struct tmio_nand_data { | |||
| 10 | unsigned int num_partitions; | 25 | unsigned int num_partitions; |
| 11 | }; | 26 | }; |
| 12 | 27 | ||
| 13 | #define TMIO_NAND_CONFIG "tmio-nand-config" | ||
| 14 | #define TMIO_NAND_CONTROL "tmio-nand-control" | ||
| 15 | #define TMIO_NAND_IRQ "tmio-nand" | ||
| 16 | |||
| 17 | #endif | 28 | #endif |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 335288bff1b7..fa651609b65d 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -834,7 +834,6 @@ extern int mprotect_fixup(struct vm_area_struct *vma, | |||
| 834 | struct vm_area_struct **pprev, unsigned long start, | 834 | struct vm_area_struct **pprev, unsigned long start, |
| 835 | unsigned long end, unsigned long newflags); | 835 | unsigned long end, unsigned long newflags); |
| 836 | 836 | ||
| 837 | #ifdef CONFIG_HAVE_GET_USER_PAGES_FAST | ||
| 838 | /* | 837 | /* |
| 839 | * get_user_pages_fast provides equivalent functionality to get_user_pages, | 838 | * get_user_pages_fast provides equivalent functionality to get_user_pages, |
| 840 | * operating on current and current->mm (force=0 and doesn't return any vmas). | 839 | * operating on current and current->mm (force=0 and doesn't return any vmas). |
| @@ -848,25 +847,6 @@ extern int mprotect_fixup(struct vm_area_struct *vma, | |||
| 848 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, | 847 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, |
| 849 | struct page **pages); | 848 | struct page **pages); |
| 850 | 849 | ||
| 851 | #else | ||
| 852 | /* | ||
| 853 | * Should probably be moved to asm-generic, and architectures can include it if | ||
| 854 | * they don't implement their own get_user_pages_fast. | ||
| 855 | */ | ||
| 856 | #define get_user_pages_fast(start, nr_pages, write, pages) \ | ||
| 857 | ({ \ | ||
| 858 | struct mm_struct *mm = current->mm; \ | ||
| 859 | int ret; \ | ||
| 860 | \ | ||
| 861 | down_read(&mm->mmap_sem); \ | ||
| 862 | ret = get_user_pages(current, mm, start, nr_pages, \ | ||
| 863 | write, 0, pages, NULL); \ | ||
| 864 | up_read(&mm->mmap_sem); \ | ||
| 865 | \ | ||
| 866 | ret; \ | ||
| 867 | }) | ||
| 868 | #endif | ||
| 869 | |||
| 870 | /* | 850 | /* |
| 871 | * A callback you can register to apply pressure to ageable caches. | 851 | * A callback you can register to apply pressure to ageable caches. |
| 872 | * | 852 | * |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 825be3878f68..c0e14008a3c2 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -641,6 +641,7 @@ int pci_restore_state(struct pci_dev *dev); | |||
| 641 | int pci_set_power_state(struct pci_dev *dev, pci_power_t state); | 641 | int pci_set_power_state(struct pci_dev *dev, pci_power_t state); |
| 642 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); | 642 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); |
| 643 | bool pci_pme_capable(struct pci_dev *dev, pci_power_t state); | 643 | bool pci_pme_capable(struct pci_dev *dev, pci_power_t state); |
| 644 | void pci_pme_active(struct pci_dev *dev, bool enable); | ||
| 644 | int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable); | 645 | int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable); |
| 645 | pci_power_t pci_target_state(struct pci_dev *dev); | 646 | pci_power_t pci_target_state(struct pci_dev *dev); |
| 646 | int pci_prepare_to_sleep(struct pci_dev *dev); | 647 | int pci_prepare_to_sleep(struct pci_dev *dev); |
| @@ -680,10 +681,12 @@ void pci_enable_bridges(struct pci_bus *bus); | |||
| 680 | /* Proper probing supporting hot-pluggable devices */ | 681 | /* Proper probing supporting hot-pluggable devices */ |
| 681 | int __must_check __pci_register_driver(struct pci_driver *, struct module *, | 682 | int __must_check __pci_register_driver(struct pci_driver *, struct module *, |
| 682 | const char *mod_name); | 683 | const char *mod_name); |
| 683 | static inline int __must_check pci_register_driver(struct pci_driver *driver) | 684 | |
| 684 | { | 685 | /* |
| 685 | return __pci_register_driver(driver, THIS_MODULE, KBUILD_MODNAME); | 686 | * pci_register_driver must be a macro so that KBUILD_MODNAME can be expanded |
| 686 | } | 687 | */ |
| 688 | #define pci_register_driver(driver) \ | ||
| 689 | __pci_register_driver(driver, THIS_MODULE, KBUILD_MODNAME) | ||
| 687 | 690 | ||
| 688 | void pci_unregister_driver(struct pci_driver *dev); | 691 | void pci_unregister_driver(struct pci_driver *dev); |
| 689 | void pci_remove_behind_bridge(struct pci_dev *dev); | 692 | void pci_remove_behind_bridge(struct pci_dev *dev); |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 35a78415accc..9ec2bcce8e83 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -2177,8 +2177,6 @@ | |||
| 2177 | #define PCI_DEVICE_ID_HERC_WIN 0x5732 | 2177 | #define PCI_DEVICE_ID_HERC_WIN 0x5732 |
| 2178 | #define PCI_DEVICE_ID_HERC_UNI 0x5832 | 2178 | #define PCI_DEVICE_ID_HERC_UNI 0x5832 |
| 2179 | 2179 | ||
| 2180 | #define PCI_VENDOR_ID_RDC 0x17f3 | ||
| 2181 | |||
| 2182 | #define PCI_VENDOR_ID_SITECOM 0x182d | 2180 | #define PCI_VENDOR_ID_SITECOM 0x182d |
| 2183 | #define PCI_DEVICE_ID_SITECOM_DC105V2 0x3069 | 2181 | #define PCI_DEVICE_ID_SITECOM_DC105V2 0x3069 |
| 2184 | 2182 | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index 5270d449ff9d..5850bfb968a8 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -1551,16 +1551,10 @@ static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask) | |||
| 1551 | 1551 | ||
| 1552 | extern unsigned long long sched_clock(void); | 1552 | extern unsigned long long sched_clock(void); |
| 1553 | 1553 | ||
| 1554 | #ifndef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK | 1554 | extern void sched_clock_init(void); |
| 1555 | static inline void sched_clock_init(void) | 1555 | extern u64 sched_clock_cpu(int cpu); |
| 1556 | { | ||
| 1557 | } | ||
| 1558 | |||
| 1559 | static inline u64 sched_clock_cpu(int cpu) | ||
| 1560 | { | ||
| 1561 | return sched_clock(); | ||
| 1562 | } | ||
| 1563 | 1556 | ||
| 1557 | #ifndef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK | ||
| 1564 | static inline void sched_clock_tick(void) | 1558 | static inline void sched_clock_tick(void) |
| 1565 | { | 1559 | { |
| 1566 | } | 1560 | } |
| @@ -1572,28 +1566,11 @@ static inline void sched_clock_idle_sleep_event(void) | |||
| 1572 | static inline void sched_clock_idle_wakeup_event(u64 delta_ns) | 1566 | static inline void sched_clock_idle_wakeup_event(u64 delta_ns) |
| 1573 | { | 1567 | { |
| 1574 | } | 1568 | } |
| 1575 | 1569 | #else | |
| 1576 | #ifdef CONFIG_NO_HZ | ||
| 1577 | static inline void sched_clock_tick_stop(int cpu) | ||
| 1578 | { | ||
| 1579 | } | ||
| 1580 | |||
| 1581 | static inline void sched_clock_tick_start(int cpu) | ||
| 1582 | { | ||
| 1583 | } | ||
| 1584 | #endif | ||
| 1585 | |||
| 1586 | #else /* CONFIG_HAVE_UNSTABLE_SCHED_CLOCK */ | ||
| 1587 | extern void sched_clock_init(void); | ||
| 1588 | extern u64 sched_clock_cpu(int cpu); | ||
| 1589 | extern void sched_clock_tick(void); | 1570 | extern void sched_clock_tick(void); |
| 1590 | extern void sched_clock_idle_sleep_event(void); | 1571 | extern void sched_clock_idle_sleep_event(void); |
| 1591 | extern void sched_clock_idle_wakeup_event(u64 delta_ns); | 1572 | extern void sched_clock_idle_wakeup_event(u64 delta_ns); |
| 1592 | #ifdef CONFIG_NO_HZ | ||
| 1593 | extern void sched_clock_tick_stop(int cpu); | ||
| 1594 | extern void sched_clock_tick_start(int cpu); | ||
| 1595 | #endif | 1573 | #endif |
| 1596 | #endif /* CONFIG_HAVE_UNSTABLE_SCHED_CLOCK */ | ||
| 1597 | 1574 | ||
| 1598 | /* | 1575 | /* |
| 1599 | * For kernel-internal use: high-speed (but slightly incorrect) per-cpu | 1576 | * For kernel-internal use: high-speed (but slightly incorrect) per-cpu |
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index a66304a09955..a1783b229ef4 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h | |||
| @@ -4,6 +4,8 @@ | |||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <linux/string.h> | 5 | #include <linux/string.h> |
| 6 | #include <linux/mutex.h> | 6 | #include <linux/mutex.h> |
| 7 | #include <linux/cpumask.h> | ||
| 8 | #include <linux/nodemask.h> | ||
| 7 | 9 | ||
| 8 | struct seq_operations; | 10 | struct seq_operations; |
| 9 | struct file; | 11 | struct file; |
| @@ -47,6 +49,16 @@ int seq_path(struct seq_file *, struct path *, char *); | |||
| 47 | int seq_dentry(struct seq_file *, struct dentry *, char *); | 49 | int seq_dentry(struct seq_file *, struct dentry *, char *); |
| 48 | int seq_path_root(struct seq_file *m, struct path *path, struct path *root, | 50 | int seq_path_root(struct seq_file *m, struct path *path, struct path *root, |
| 49 | char *esc); | 51 | char *esc); |
| 52 | int seq_bitmap(struct seq_file *m, unsigned long *bits, unsigned int nr_bits); | ||
| 53 | static inline int seq_cpumask(struct seq_file *m, cpumask_t *mask) | ||
| 54 | { | ||
| 55 | return seq_bitmap(m, mask->bits, NR_CPUS); | ||
| 56 | } | ||
| 57 | |||
| 58 | static inline int seq_nodemask(struct seq_file *m, nodemask_t *mask) | ||
| 59 | { | ||
| 60 | return seq_bitmap(m, mask->bits, MAX_NUMNODES); | ||
| 61 | } | ||
| 50 | 62 | ||
| 51 | int single_open(struct file *, int (*)(struct seq_file *, void *), void *); | 63 | int single_open(struct file *, int (*)(struct seq_file *, void *), void *); |
| 52 | int single_release(struct inode *, struct file *); | 64 | int single_release(struct inode *, struct file *); |
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index 5bad61a93f65..2f5c16b1aacd 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
| @@ -46,6 +46,7 @@ struct kmem_cache_cpu { | |||
| 46 | struct kmem_cache_node { | 46 | struct kmem_cache_node { |
| 47 | spinlock_t list_lock; /* Protect partial list and nr_partial */ | 47 | spinlock_t list_lock; /* Protect partial list and nr_partial */ |
| 48 | unsigned long nr_partial; | 48 | unsigned long nr_partial; |
| 49 | unsigned long min_partial; | ||
| 49 | struct list_head partial; | 50 | struct list_head partial; |
| 50 | #ifdef CONFIG_SLUB_DEBUG | 51 | #ifdef CONFIG_SLUB_DEBUG |
| 51 | atomic_long_t nr_slabs; | 52 | atomic_long_t nr_slabs; |
diff --git a/include/linux/swab.h b/include/linux/swab.h new file mode 100644 index 000000000000..270d5c208a89 --- /dev/null +++ b/include/linux/swab.h | |||
| @@ -0,0 +1,309 @@ | |||
| 1 | #ifndef _LINUX_SWAB_H | ||
| 2 | #define _LINUX_SWAB_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | #include <linux/compiler.h> | ||
| 6 | #include <asm/byteorder.h> | ||
| 7 | |||
| 8 | /* | ||
| 9 | * casts are necessary for constants, because we never know how for sure | ||
| 10 | * how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way. | ||
| 11 | */ | ||
| 12 | #define __const_swab16(x) ((__u16)( \ | ||
| 13 | (((__u16)(x) & (__u16)0x00ffU) << 8) | \ | ||
| 14 | (((__u16)(x) & (__u16)0xff00U) >> 8))) | ||
| 15 | |||
| 16 | #define __const_swab32(x) ((__u32)( \ | ||
| 17 | (((__u32)(x) & (__u32)0x000000ffUL) << 24) | \ | ||
| 18 | (((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \ | ||
| 19 | (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \ | ||
| 20 | (((__u32)(x) & (__u32)0xff000000UL) >> 24))) | ||
| 21 | |||
| 22 | #define __const_swab64(x) ((__u64)( \ | ||
| 23 | (((__u64)(x) & (__u64)0x00000000000000ffULL) << 56) | \ | ||
| 24 | (((__u64)(x) & (__u64)0x000000000000ff00ULL) << 40) | \ | ||
| 25 | (((__u64)(x) & (__u64)0x0000000000ff0000ULL) << 24) | \ | ||
| 26 | (((__u64)(x) & (__u64)0x00000000ff000000ULL) << 8) | \ | ||
| 27 | (((__u64)(x) & (__u64)0x000000ff00000000ULL) >> 8) | \ | ||
| 28 | (((__u64)(x) & (__u64)0x0000ff0000000000ULL) >> 24) | \ | ||
| 29 | (((__u64)(x) & (__u64)0x00ff000000000000ULL) >> 40) | \ | ||
| 30 | (((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56))) | ||
| 31 | |||
| 32 | #define __const_swahw32(x) ((__u32)( \ | ||
| 33 | (((__u32)(x) & (__u32)0x0000ffffUL) << 16) | \ | ||
| 34 | (((__u32)(x) & (__u32)0xffff0000UL) >> 16))) | ||
| 35 | |||
| 36 | #define __const_swahb32(x) ((__u32)( \ | ||
| 37 | (((__u32)(x) & (__u32)0x00ff00ffUL) << 8) | \ | ||
| 38 | (((__u32)(x) & (__u32)0xff00ff00UL) >> 8))) | ||
| 39 | |||
| 40 | /* | ||
| 41 | * Implement the following as inlines, but define the interface using | ||
| 42 | * macros to allow constant folding when possible: | ||
| 43 | * ___swab16, ___swab32, ___swab64, ___swahw32, ___swahb32 | ||
| 44 | */ | ||
| 45 | |||
| 46 | static inline __attribute_const__ __u16 ___swab16(__u16 val) | ||
| 47 | { | ||
| 48 | #ifdef __arch_swab16 | ||
| 49 | return __arch_swab16(val); | ||
| 50 | #elif defined(__arch_swab16p) | ||
| 51 | return __arch_swab16p(&val); | ||
| 52 | #else | ||
| 53 | return __const_swab16(val); | ||
| 54 | #endif | ||
| 55 | } | ||
| 56 | |||
| 57 | static inline __attribute_const__ __u32 ___swab32(__u32 val) | ||
| 58 | { | ||
| 59 | #ifdef __arch_swab32 | ||
| 60 | return __arch_swab32(val); | ||
| 61 | #elif defined(__arch_swab32p) | ||
| 62 | return __arch_swab32p(&val); | ||
| 63 | #else | ||
| 64 | return __const_swab32(val); | ||
| 65 | #endif | ||
| 66 | } | ||
| 67 | |||
| 68 | static inline __attribute_const__ __u64 ___swab64(__u64 val) | ||
| 69 | { | ||
| 70 | #ifdef __arch_swab64 | ||
| 71 | return __arch_swab64(val); | ||
| 72 | #elif defined(__arch_swab64p) | ||
| 73 | return __arch_swab64p(&val); | ||
| 74 | #elif defined(__SWAB_64_THRU_32__) | ||
| 75 | __u32 h = val >> 32; | ||
| 76 | __u32 l = val & ((1ULL << 32) - 1); | ||
| 77 | return (((__u64)___swab32(l)) << 32) | ((__u64)(___swab32(h))); | ||
| 78 | #else | ||
| 79 | return __const_swab64(val); | ||
| 80 | #endif | ||
| 81 | } | ||
| 82 | |||
| 83 | static inline __attribute_const__ __u32 ___swahw32(__u32 val) | ||
| 84 | { | ||
| 85 | #ifdef __arch_swahw32 | ||
| 86 | return __arch_swahw32(val); | ||
| 87 | #elif defined(__arch_swahw32p) | ||
| 88 | return __arch_swahw32p(&val); | ||
| 89 | #else | ||
| 90 | return __const_swahw32(val); | ||
| 91 | #endif | ||
| 92 | } | ||
| 93 | |||
| 94 | static inline __attribute_const__ __u32 ___swahb32(__u32 val) | ||
| 95 | { | ||
| 96 | #ifdef __arch_swahb32 | ||
| 97 | return __arch_swahb32(val); | ||
| 98 | #elif defined(__arch_swahb32p) | ||
| 99 | return __arch_swahb32p(&val); | ||
| 100 | #else | ||
| 101 | return __const_swahb32(val); | ||
| 102 | #endif | ||
| 103 | } | ||
| 104 | |||
| 105 | /** | ||
| 106 | * __swab16 - return a byteswapped 16-bit value | ||
| 107 | * @x: value to byteswap | ||
| 108 | */ | ||
| 109 | #define __swab16(x) \ | ||
| 110 | (__builtin_constant_p((__u16)(x)) ? \ | ||
| 111 | __const_swab16((x)) : \ | ||
| 112 | ___swab16((x))) | ||
| 113 | |||
| 114 | /** | ||
| 115 | * __swab32 - return a byteswapped 32-bit value | ||
| 116 | * @x: value to byteswap | ||
| 117 | */ | ||
| 118 | #define __swab32(x) \ | ||
| 119 | (__builtin_constant_p((__u32)(x)) ? \ | ||
| 120 | __const_swab32((x)) : \ | ||
| 121 | ___swab32((x))) | ||
| 122 | |||
| 123 | /** | ||
| 124 | * __swab64 - return a byteswapped 64-bit value | ||
| 125 | * @x: value to byteswap | ||
| 126 | */ | ||
| 127 | #define __swab64(x) \ | ||
| 128 | (__builtin_constant_p((__u64)(x)) ? \ | ||
| 129 | __const_swab64((x)) : \ | ||
| 130 | ___swab64((x))) | ||
| 131 | |||
| 132 | /** | ||
| 133 | * __swahw32 - return a word-swapped 32-bit value | ||
| 134 | * @x: value to wordswap | ||
| 135 | * | ||
| 136 | * __swahw32(0x12340000) is 0x00001234 | ||
| 137 | */ | ||
| 138 | #define __swahw32(x) \ | ||
| 139 | (__builtin_constant_p((__u32)(x)) ? \ | ||
| 140 | __const_swahw32((x)) : \ | ||
| 141 | ___swahw32((x))) | ||
| 142 | |||
| 143 | /** | ||
| 144 | * __swahb32 - return a high and low byte-swapped 32-bit value | ||
| 145 | * @x: value to byteswap | ||
| 146 | * | ||
| 147 | * __swahb32(0x12345678) is 0x34127856 | ||
| 148 | */ | ||
| 149 | #define __swahb32(x) \ | ||
| 150 | (__builtin_constant_p((__u32)(x)) ? \ | ||
| 151 | __const_swahb32((x)) : \ | ||
| 152 | ___swahb32((x))) | ||
| 153 | |||
| 154 | /** | ||
| 155 | * __swab16p - return a byteswapped 16-bit value from a pointer | ||
| 156 | * @p: pointer to a naturally-aligned 16-bit value | ||
| 157 | */ | ||
| 158 | static inline __u16 __swab16p(const __u16 *p) | ||
| 159 | { | ||
| 160 | #ifdef __arch_swab16p | ||
| 161 | return __arch_swab16p(p); | ||
| 162 | #else | ||
| 163 | return __swab16(*p); | ||
| 164 | #endif | ||
| 165 | } | ||
| 166 | |||
| 167 | /** | ||
| 168 | * __swab32p - return a byteswapped 32-bit value from a pointer | ||
| 169 | * @p: pointer to a naturally-aligned 32-bit value | ||
| 170 | */ | ||
| 171 | static inline __u32 __swab32p(const __u32 *p) | ||
| 172 | { | ||
| 173 | #ifdef __arch_swab32p | ||
| 174 | return __arch_swab32p(p); | ||
| 175 | #else | ||
| 176 | return __swab32(*p); | ||
| 177 | #endif | ||
| 178 | } | ||
| 179 | |||
| 180 | /** | ||
| 181 | * __swab64p - return a byteswapped 64-bit value from a pointer | ||
| 182 | * @p: pointer to a naturally-aligned 64-bit value | ||
| 183 | */ | ||
| 184 | static inline __u64 __swab64p(const __u64 *p) | ||
| 185 | { | ||
| 186 | #ifdef __arch_swab64p | ||
| 187 | return __arch_swab64p(p); | ||
| 188 | #else | ||
| 189 | return __swab64(*p); | ||
| 190 | #endif | ||
| 191 | } | ||
| 192 | |||
| 193 | /** | ||
| 194 | * __swahw32p - return a wordswapped 32-bit value from a pointer | ||
| 195 | * @p: pointer to a naturally-aligned 32-bit value | ||
| 196 | * | ||
| 197 | * See __swahw32() for details of wordswapping. | ||
| 198 | */ | ||
| 199 | static inline __u32 __swahw32p(const __u32 *p) | ||
| 200 | { | ||
| 201 | #ifdef __arch_swahw32p | ||
| 202 | return __arch_swahw32p(p); | ||
| 203 | #else | ||
| 204 | return __swahw32(*p); | ||
| 205 | #endif | ||
| 206 | } | ||
| 207 | |||
| 208 | /** | ||
| 209 | * __swahb32p - return a high and low byteswapped 32-bit value from a pointer | ||
| 210 | * @p: pointer to a naturally-aligned 32-bit value | ||
| 211 | * | ||
| 212 | * See __swahb32() for details of high/low byteswapping. | ||
| 213 | */ | ||
| 214 | static inline __u32 __swahb32p(const __u32 *p) | ||
| 215 | { | ||
| 216 | #ifdef __arch_swahb32p | ||
| 217 | return __arch_swahb32p(p); | ||
| 218 | #else | ||
| 219 | return __swahb32(*p); | ||
| 220 | #endif | ||
| 221 | } | ||
| 222 | |||
| 223 | /** | ||
| 224 | * __swab16s - byteswap a 16-bit value in-place | ||
| 225 | * @p: pointer to a naturally-aligned 16-bit value | ||
| 226 | */ | ||
| 227 | static inline void __swab16s(__u16 *p) | ||
| 228 | { | ||
| 229 | #ifdef __arch_swab16s | ||
| 230 | __arch_swab16s(p); | ||
| 231 | #else | ||
| 232 | *p = __swab16p(p); | ||
| 233 | #endif | ||
| 234 | } | ||
| 235 | /** | ||
| 236 | * __swab32s - byteswap a 32-bit value in-place | ||
| 237 | * @p: pointer to a naturally-aligned 32-bit value | ||
| 238 | */ | ||
| 239 | static inline void __swab32s(__u32 *p) | ||
| 240 | { | ||
| 241 | #ifdef __arch_swab32s | ||
| 242 | __arch_swab32s(p); | ||
| 243 | #else | ||
| 244 | *p = __swab32p(p); | ||
| 245 | #endif | ||
| 246 | } | ||
| 247 | |||
| 248 | /** | ||
| 249 | * __swab64s - byteswap a 64-bit value in-place | ||
| 250 | * @p: pointer to a naturally-aligned 64-bit value | ||
| 251 | */ | ||
| 252 | static inline void __swab64s(__u64 *p) | ||
| 253 | { | ||
| 254 | #ifdef __arch_swab64s | ||
| 255 | __arch_swab64s(p); | ||
| 256 | #else | ||
| 257 | *p = __swab64p(p); | ||
| 258 | #endif | ||
| 259 | } | ||
| 260 | |||
| 261 | /** | ||
| 262 | * __swahw32s - wordswap a 32-bit value in-place | ||
| 263 | * @p: pointer to a naturally-aligned 32-bit value | ||
| 264 | * | ||
| 265 | * See __swahw32() for details of wordswapping | ||
| 266 | */ | ||
| 267 | static inline void __swahw32s(__u32 *p) | ||
| 268 | { | ||
| 269 | #ifdef __arch_swahw32s | ||
| 270 | __arch_swahw32s(p); | ||
| 271 | #else | ||
| 272 | *p = __swahw32p(p); | ||
| 273 | #endif | ||
| 274 | } | ||
| 275 | |||
| 276 | /** | ||
| 277 | * __swahb32s - high and low byteswap a 32-bit value in-place | ||
| 278 | * @p: pointer to a naturally-aligned 32-bit value | ||
| 279 | * | ||
| 280 | * See __swahb32() for details of high and low byte swapping | ||
| 281 | */ | ||
| 282 | static inline void __swahb32s(__u32 *p) | ||
| 283 | { | ||
| 284 | #ifdef __arch_swahb32s | ||
| 285 | __arch_swahb32s(p); | ||
| 286 | #else | ||
| 287 | *p = __swahb32p(p); | ||
| 288 | #endif | ||
| 289 | } | ||
| 290 | |||
| 291 | #ifdef __KERNEL__ | ||
| 292 | # define swab16 __swab16 | ||
| 293 | # define swab32 __swab32 | ||
| 294 | # define swab64 __swab64 | ||
| 295 | # define swahw32 __swahw32 | ||
| 296 | # define swahb32 __swahb32 | ||
| 297 | # define swab16p __swab16p | ||
| 298 | # define swab32p __swab32p | ||
| 299 | # define swab64p __swab64p | ||
| 300 | # define swahw32p __swahw32p | ||
| 301 | # define swahb32p __swahb32p | ||
| 302 | # define swab16s __swab16s | ||
| 303 | # define swab32s __swab32s | ||
| 304 | # define swab64s __swab64s | ||
| 305 | # define swahw32s __swahw32s | ||
| 306 | # define swahb32s __swahb32s | ||
| 307 | #endif /* __KERNEL__ */ | ||
| 308 | |||
| 309 | #endif /* _LINUX_SWAB_H */ | ||
