diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-09-14 12:24:00 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-09-14 12:24:00 -0400 |
commit | 83bd6998b04fc1bb7280b14f16b2bdbdc07c914b (patch) | |
tree | af1bbe2bac5752b69b1ac58bf5d822c735da439b /include/linux | |
parent | e7250b8ae3870f37f660c2f65cafcaba85e3bfd3 (diff) | |
parent | adee14b2e1557d0a8559f29681732d05a89dfc35 (diff) |
Merge commit 'v2.6.27-rc6' into timers/hpet
Diffstat (limited to 'include/linux')
115 files changed, 2661 insertions, 677 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 4c4142c5aa6e..b68ec09399be 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -97,6 +97,7 @@ header-y += ioctl.h | |||
97 | header-y += ip6_tunnel.h | 97 | header-y += ip6_tunnel.h |
98 | header-y += ipmi_msgdefs.h | 98 | header-y += ipmi_msgdefs.h |
99 | header-y += ipsec.h | 99 | header-y += ipsec.h |
100 | header-y += ip_vs.h | ||
100 | header-y += ipx.h | 101 | header-y += ipx.h |
101 | header-y += irda.h | 102 | header-y += irda.h |
102 | header-y += iso_fs.h | 103 | header-y += iso_fs.h |
@@ -166,7 +167,8 @@ unifdef-y += acct.h | |||
166 | unifdef-y += adb.h | 167 | unifdef-y += adb.h |
167 | unifdef-y += adfs_fs.h | 168 | unifdef-y += adfs_fs.h |
168 | unifdef-y += agpgart.h | 169 | unifdef-y += agpgart.h |
169 | ifneq ($(wildcard $(srctree)/include/asm-$(SRCARCH)/a.out.h),) | 170 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \ |
171 | $(srctree)/include/asm-$(SRCARCH)/a.out.h),) | ||
170 | unifdef-y += a.out.h | 172 | unifdef-y += a.out.h |
171 | endif | 173 | endif |
172 | unifdef-y += apm_bios.h | 174 | unifdef-y += apm_bios.h |
@@ -249,13 +251,16 @@ unifdef-y += isdn.h | |||
249 | unifdef-y += isdnif.h | 251 | unifdef-y += isdnif.h |
250 | unifdef-y += isdn_divertif.h | 252 | unifdef-y += isdn_divertif.h |
251 | unifdef-y += isdn_ppp.h | 253 | unifdef-y += isdn_ppp.h |
254 | unifdef-y += ivtv.h | ||
255 | unifdef-y += ivtvfb.h | ||
252 | unifdef-y += joystick.h | 256 | unifdef-y += joystick.h |
253 | unifdef-y += kdev_t.h | 257 | unifdef-y += kdev_t.h |
254 | unifdef-y += kd.h | 258 | unifdef-y += kd.h |
255 | unifdef-y += kernelcapi.h | 259 | unifdef-y += kernelcapi.h |
256 | unifdef-y += kernel.h | 260 | unifdef-y += kernel.h |
257 | unifdef-y += keyboard.h | 261 | unifdef-y += keyboard.h |
258 | ifneq ($(wildcard $(srctree)/include/asm-$(SRCARCH)/kvm.h),) | 262 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \ |
263 | $(srctree)/include/asm-$(SRCARCH)/kvm.h),) | ||
259 | unifdef-y += kvm.h | 264 | unifdef-y += kvm.h |
260 | endif | 265 | endif |
261 | unifdef-y += llc.h | 266 | unifdef-y += llc.h |
@@ -294,7 +299,6 @@ unifdef-y += parport.h | |||
294 | unifdef-y += patchkey.h | 299 | unifdef-y += patchkey.h |
295 | unifdef-y += pci.h | 300 | unifdef-y += pci.h |
296 | unifdef-y += personality.h | 301 | unifdef-y += personality.h |
297 | unifdef-y += pim.h | ||
298 | unifdef-y += pktcdvd.h | 302 | unifdef-y += pktcdvd.h |
299 | unifdef-y += pmu.h | 303 | unifdef-y += pmu.h |
300 | unifdef-y += poll.h | 304 | unifdef-y += poll.h |
@@ -355,6 +359,7 @@ unifdef-y += virtio_balloon.h | |||
355 | unifdef-y += virtio_console.h | 359 | unifdef-y += virtio_console.h |
356 | unifdef-y += virtio_pci.h | 360 | unifdef-y += virtio_pci.h |
357 | unifdef-y += virtio_ring.h | 361 | unifdef-y += virtio_ring.h |
362 | unifdef-y += virtio_rng.h | ||
358 | unifdef-y += vt.h | 363 | unifdef-y += vt.h |
359 | unifdef-y += wait.h | 364 | unifdef-y += wait.h |
360 | unifdef-y += wanrouter.h | 365 | 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/ata.h b/include/linux/ata.h index 1c622e2b0504..1ce19c1ef0e9 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -46,18 +46,48 @@ enum { | |||
46 | ATA_MAX_SECTORS_TAPE = 65535, | 46 | ATA_MAX_SECTORS_TAPE = 65535, |
47 | 47 | ||
48 | ATA_ID_WORDS = 256, | 48 | ATA_ID_WORDS = 256, |
49 | ATA_ID_CONFIG = 0, | ||
50 | ATA_ID_CYLS = 1, | ||
51 | ATA_ID_HEADS = 3, | ||
52 | ATA_ID_SECTORS = 6, | ||
49 | ATA_ID_SERNO = 10, | 53 | ATA_ID_SERNO = 10, |
54 | ATA_ID_BUF_SIZE = 21, | ||
50 | ATA_ID_FW_REV = 23, | 55 | ATA_ID_FW_REV = 23, |
51 | ATA_ID_PROD = 27, | 56 | ATA_ID_PROD = 27, |
57 | ATA_ID_MAX_MULTSECT = 47, | ||
58 | ATA_ID_DWORD_IO = 48, | ||
59 | ATA_ID_CAPABILITY = 49, | ||
52 | ATA_ID_OLD_PIO_MODES = 51, | 60 | ATA_ID_OLD_PIO_MODES = 51, |
61 | ATA_ID_OLD_DMA_MODES = 52, | ||
53 | ATA_ID_FIELD_VALID = 53, | 62 | ATA_ID_FIELD_VALID = 53, |
63 | ATA_ID_CUR_CYLS = 54, | ||
64 | ATA_ID_CUR_HEADS = 55, | ||
65 | ATA_ID_CUR_SECTORS = 56, | ||
66 | ATA_ID_MULTSECT = 59, | ||
67 | ATA_ID_LBA_CAPACITY = 60, | ||
68 | ATA_ID_SWDMA_MODES = 62, | ||
54 | ATA_ID_MWDMA_MODES = 63, | 69 | ATA_ID_MWDMA_MODES = 63, |
55 | ATA_ID_PIO_MODES = 64, | 70 | ATA_ID_PIO_MODES = 64, |
56 | ATA_ID_EIDE_DMA_MIN = 65, | 71 | ATA_ID_EIDE_DMA_MIN = 65, |
72 | ATA_ID_EIDE_DMA_TIME = 66, | ||
57 | ATA_ID_EIDE_PIO = 67, | 73 | ATA_ID_EIDE_PIO = 67, |
58 | ATA_ID_EIDE_PIO_IORDY = 68, | 74 | ATA_ID_EIDE_PIO_IORDY = 68, |
59 | ATA_ID_UDMA_MODES = 88, | 75 | ATA_ID_QUEUE_DEPTH = 75, |
60 | ATA_ID_MAJOR_VER = 80, | 76 | ATA_ID_MAJOR_VER = 80, |
77 | ATA_ID_COMMAND_SET_1 = 82, | ||
78 | ATA_ID_COMMAND_SET_2 = 83, | ||
79 | ATA_ID_CFSSE = 84, | ||
80 | ATA_ID_CFS_ENABLE_1 = 85, | ||
81 | ATA_ID_CFS_ENABLE_2 = 86, | ||
82 | ATA_ID_CSF_DEFAULT = 87, | ||
83 | ATA_ID_UDMA_MODES = 88, | ||
84 | ATA_ID_HW_CONFIG = 93, | ||
85 | ATA_ID_SPG = 98, | ||
86 | ATA_ID_LBA_CAPACITY_2 = 100, | ||
87 | ATA_ID_LAST_LUN = 126, | ||
88 | ATA_ID_DLF = 128, | ||
89 | ATA_ID_CSFO = 129, | ||
90 | ATA_ID_CFA_POWER = 160, | ||
61 | ATA_ID_PIO4 = (1 << 1), | 91 | ATA_ID_PIO4 = (1 << 1), |
62 | 92 | ||
63 | ATA_ID_SERNO_LEN = 20, | 93 | ATA_ID_SERNO_LEN = 20, |
@@ -123,13 +153,26 @@ enum { | |||
123 | ATA_BUSY = (1 << 7), /* BSY status bit */ | 153 | ATA_BUSY = (1 << 7), /* BSY status bit */ |
124 | ATA_DRDY = (1 << 6), /* device ready */ | 154 | ATA_DRDY = (1 << 6), /* device ready */ |
125 | ATA_DF = (1 << 5), /* device fault */ | 155 | ATA_DF = (1 << 5), /* device fault */ |
156 | ATA_DSC = (1 << 4), /* drive seek complete */ | ||
126 | ATA_DRQ = (1 << 3), /* data request i/o */ | 157 | ATA_DRQ = (1 << 3), /* data request i/o */ |
158 | ATA_CORR = (1 << 2), /* corrected data error */ | ||
159 | ATA_IDX = (1 << 1), /* index */ | ||
127 | ATA_ERR = (1 << 0), /* have an error */ | 160 | ATA_ERR = (1 << 0), /* have an error */ |
128 | ATA_SRST = (1 << 2), /* software reset */ | 161 | ATA_SRST = (1 << 2), /* software reset */ |
129 | ATA_ICRC = (1 << 7), /* interface CRC error */ | 162 | ATA_ICRC = (1 << 7), /* interface CRC error */ |
163 | ATA_BBK = ATA_ICRC, /* pre-EIDE: block marked bad */ | ||
130 | ATA_UNC = (1 << 6), /* uncorrectable media error */ | 164 | ATA_UNC = (1 << 6), /* uncorrectable media error */ |
165 | ATA_MC = (1 << 5), /* media changed */ | ||
131 | ATA_IDNF = (1 << 4), /* ID not found */ | 166 | ATA_IDNF = (1 << 4), /* ID not found */ |
167 | ATA_MCR = (1 << 3), /* media change requested */ | ||
132 | ATA_ABORTED = (1 << 2), /* command aborted */ | 168 | ATA_ABORTED = (1 << 2), /* command aborted */ |
169 | ATA_TRK0NF = (1 << 1), /* track 0 not found */ | ||
170 | ATA_AMNF = (1 << 0), /* address mark not found */ | ||
171 | ATAPI_LFS = 0xF0, /* last failed sense */ | ||
172 | ATAPI_EOM = ATA_TRK0NF, /* end of media */ | ||
173 | ATAPI_ILI = ATA_AMNF, /* illegal length indication */ | ||
174 | ATAPI_IO = (1 << 1), | ||
175 | ATAPI_COD = (1 << 0), | ||
133 | 176 | ||
134 | /* ATA command block registers */ | 177 | /* ATA command block registers */ |
135 | ATA_REG_DATA = 0x00, | 178 | ATA_REG_DATA = 0x00, |
@@ -192,6 +235,13 @@ enum { | |||
192 | ATA_CMD_PMP_WRITE = 0xE8, | 235 | ATA_CMD_PMP_WRITE = 0xE8, |
193 | ATA_CMD_CONF_OVERLAY = 0xB1, | 236 | ATA_CMD_CONF_OVERLAY = 0xB1, |
194 | ATA_CMD_SEC_FREEZE_LOCK = 0xF5, | 237 | ATA_CMD_SEC_FREEZE_LOCK = 0xF5, |
238 | ATA_CMD_SMART = 0xB0, | ||
239 | ATA_CMD_MEDIA_LOCK = 0xDE, | ||
240 | ATA_CMD_MEDIA_UNLOCK = 0xDF, | ||
241 | /* marked obsolete in the ATA/ATAPI-7 spec */ | ||
242 | ATA_CMD_RESTORE = 0x10, | ||
243 | /* EXABYTE specific */ | ||
244 | ATA_EXABYTE_ENABLE_NEST = 0xF0, | ||
195 | 245 | ||
196 | /* READ_LOG_EXT pages */ | 246 | /* READ_LOG_EXT pages */ |
197 | ATA_LOG_SATA_NCQ = 0x10, | 247 | ATA_LOG_SATA_NCQ = 0x10, |
@@ -232,6 +282,10 @@ enum { | |||
232 | SETFEATURES_WC_ON = 0x02, /* Enable write cache */ | 282 | SETFEATURES_WC_ON = 0x02, /* Enable write cache */ |
233 | SETFEATURES_WC_OFF = 0x82, /* Disable write cache */ | 283 | SETFEATURES_WC_OFF = 0x82, /* Disable write cache */ |
234 | 284 | ||
285 | /* Enable/Disable Automatic Acoustic Management */ | ||
286 | SETFEATURES_AAM_ON = 0x42, | ||
287 | SETFEATURES_AAM_OFF = 0xC2, | ||
288 | |||
235 | SETFEATURES_SPINUP = 0x07, /* Spin-up drive */ | 289 | SETFEATURES_SPINUP = 0x07, /* Spin-up drive */ |
236 | 290 | ||
237 | SETFEATURES_SATA_ENABLE = 0x10, /* Enable use of SATA feature */ | 291 | SETFEATURES_SATA_ENABLE = 0x10, /* Enable use of SATA feature */ |
@@ -254,6 +308,15 @@ enum { | |||
254 | ATA_DCO_IDENTIFY = 0xC2, | 308 | ATA_DCO_IDENTIFY = 0xC2, |
255 | ATA_DCO_SET = 0xC3, | 309 | ATA_DCO_SET = 0xC3, |
256 | 310 | ||
311 | /* feature values for SMART */ | ||
312 | ATA_SMART_ENABLE = 0xD8, | ||
313 | ATA_SMART_READ_VALUES = 0xD0, | ||
314 | ATA_SMART_READ_THRESHOLDS = 0xD1, | ||
315 | |||
316 | /* password used in LBA Mid / LBA High for executing SMART commands */ | ||
317 | ATA_SMART_LBAM_PASS = 0x4F, | ||
318 | ATA_SMART_LBAH_PASS = 0xC2, | ||
319 | |||
257 | /* ATAPI stuff */ | 320 | /* ATAPI stuff */ |
258 | ATAPI_PKT_DMA = (1 << 0), | 321 | ATAPI_PKT_DMA = (1 << 0), |
259 | ATAPI_DMADIR = (1 << 2), /* ATAPI data dir: | 322 | ATAPI_DMADIR = (1 << 2), /* ATAPI data dir: |
@@ -438,17 +501,17 @@ static inline int ata_is_data(u8 prot) | |||
438 | /* | 501 | /* |
439 | * id tests | 502 | * id tests |
440 | */ | 503 | */ |
441 | #define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0) | 504 | #define ata_id_is_ata(id) (((id)[ATA_ID_CONFIG] & (1 << 15)) == 0) |
442 | #define ata_id_has_lba(id) ((id)[49] & (1 << 9)) | 505 | #define ata_id_has_lba(id) ((id)[ATA_ID_CAPABILITY] & (1 << 9)) |
443 | #define ata_id_has_dma(id) ((id)[49] & (1 << 8)) | 506 | #define ata_id_has_dma(id) ((id)[ATA_ID_CAPABILITY] & (1 << 8)) |
444 | #define ata_id_has_ncq(id) ((id)[76] & (1 << 8)) | 507 | #define ata_id_has_ncq(id) ((id)[76] & (1 << 8)) |
445 | #define ata_id_queue_depth(id) (((id)[75] & 0x1f) + 1) | 508 | #define ata_id_queue_depth(id) (((id)[ATA_ID_QUEUE_DEPTH] & 0x1f) + 1) |
446 | #define ata_id_removeable(id) ((id)[0] & (1 << 7)) | 509 | #define ata_id_removeable(id) ((id)[ATA_ID_CONFIG] & (1 << 7)) |
447 | #define ata_id_has_atapi_AN(id) \ | 510 | #define ata_id_has_atapi_AN(id) \ |
448 | ( (((id)[76] != 0x0000) && ((id)[76] != 0xffff)) && \ | 511 | ( (((id)[76] != 0x0000) && ((id)[76] != 0xffff)) && \ |
449 | ((id)[78] & (1 << 5)) ) | 512 | ((id)[78] & (1 << 5)) ) |
450 | #define ata_id_iordy_disable(id) ((id)[49] & (1 << 10)) | 513 | #define ata_id_iordy_disable(id) ((id)[ATA_ID_CAPABILITY] & (1 << 10)) |
451 | #define ata_id_has_iordy(id) ((id)[49] & (1 << 11)) | 514 | #define ata_id_has_iordy(id) ((id)[ATA_ID_CAPABILITY] & (1 << 11)) |
452 | #define ata_id_u32(id,n) \ | 515 | #define ata_id_u32(id,n) \ |
453 | (((u32) (id)[(n) + 1] << 16) | ((u32) (id)[(n)])) | 516 | (((u32) (id)[(n) + 1] << 16) | ((u32) (id)[(n)])) |
454 | #define ata_id_u64(id,n) \ | 517 | #define ata_id_u64(id,n) \ |
@@ -457,7 +520,7 @@ static inline int ata_is_data(u8 prot) | |||
457 | ((u64) (id)[(n) + 1] << 16) | \ | 520 | ((u64) (id)[(n) + 1] << 16) | \ |
458 | ((u64) (id)[(n) + 0]) ) | 521 | ((u64) (id)[(n) + 0]) ) |
459 | 522 | ||
460 | #define ata_id_cdb_intr(id) (((id)[0] & 0x60) == 0x20) | 523 | #define ata_id_cdb_intr(id) (((id)[ATA_ID_CONFIG] & 0x60) == 0x20) |
461 | 524 | ||
462 | static inline bool ata_id_has_hipm(const u16 *id) | 525 | static inline bool ata_id_has_hipm(const u16 *id) |
463 | { | 526 | { |
@@ -482,75 +545,75 @@ static inline bool ata_id_has_dipm(const u16 *id) | |||
482 | 545 | ||
483 | static inline int ata_id_has_fua(const u16 *id) | 546 | static inline int ata_id_has_fua(const u16 *id) |
484 | { | 547 | { |
485 | if ((id[84] & 0xC000) != 0x4000) | 548 | if ((id[ATA_ID_CFSSE] & 0xC000) != 0x4000) |
486 | return 0; | 549 | return 0; |
487 | return id[84] & (1 << 6); | 550 | return id[ATA_ID_CFSSE] & (1 << 6); |
488 | } | 551 | } |
489 | 552 | ||
490 | static inline int ata_id_has_flush(const u16 *id) | 553 | static inline int ata_id_has_flush(const u16 *id) |
491 | { | 554 | { |
492 | if ((id[83] & 0xC000) != 0x4000) | 555 | if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000) |
493 | return 0; | 556 | return 0; |
494 | return id[83] & (1 << 12); | 557 | return id[ATA_ID_COMMAND_SET_2] & (1 << 12); |
495 | } | 558 | } |
496 | 559 | ||
497 | static inline int ata_id_has_flush_ext(const u16 *id) | 560 | static inline int ata_id_has_flush_ext(const u16 *id) |
498 | { | 561 | { |
499 | if ((id[83] & 0xC000) != 0x4000) | 562 | if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000) |
500 | return 0; | 563 | return 0; |
501 | return id[83] & (1 << 13); | 564 | return id[ATA_ID_COMMAND_SET_2] & (1 << 13); |
502 | } | 565 | } |
503 | 566 | ||
504 | static inline int ata_id_has_lba48(const u16 *id) | 567 | static inline int ata_id_has_lba48(const u16 *id) |
505 | { | 568 | { |
506 | if ((id[83] & 0xC000) != 0x4000) | 569 | if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000) |
507 | return 0; | 570 | return 0; |
508 | if (!ata_id_u64(id, 100)) | 571 | if (!ata_id_u64(id, ATA_ID_LBA_CAPACITY_2)) |
509 | return 0; | 572 | return 0; |
510 | return id[83] & (1 << 10); | 573 | return id[ATA_ID_COMMAND_SET_2] & (1 << 10); |
511 | } | 574 | } |
512 | 575 | ||
513 | static inline int ata_id_hpa_enabled(const u16 *id) | 576 | static inline int ata_id_hpa_enabled(const u16 *id) |
514 | { | 577 | { |
515 | /* Yes children, word 83 valid bits cover word 82 data */ | 578 | /* Yes children, word 83 valid bits cover word 82 data */ |
516 | if ((id[83] & 0xC000) != 0x4000) | 579 | if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000) |
517 | return 0; | 580 | return 0; |
518 | /* And 87 covers 85-87 */ | 581 | /* And 87 covers 85-87 */ |
519 | if ((id[87] & 0xC000) != 0x4000) | 582 | if ((id[ATA_ID_CSF_DEFAULT] & 0xC000) != 0x4000) |
520 | return 0; | 583 | return 0; |
521 | /* Check command sets enabled as well as supported */ | 584 | /* Check command sets enabled as well as supported */ |
522 | if ((id[85] & ( 1 << 10)) == 0) | 585 | if ((id[ATA_ID_CFS_ENABLE_1] & (1 << 10)) == 0) |
523 | return 0; | 586 | return 0; |
524 | return id[82] & (1 << 10); | 587 | return id[ATA_ID_COMMAND_SET_1] & (1 << 10); |
525 | } | 588 | } |
526 | 589 | ||
527 | static inline int ata_id_has_wcache(const u16 *id) | 590 | static inline int ata_id_has_wcache(const u16 *id) |
528 | { | 591 | { |
529 | /* Yes children, word 83 valid bits cover word 82 data */ | 592 | /* Yes children, word 83 valid bits cover word 82 data */ |
530 | if ((id[83] & 0xC000) != 0x4000) | 593 | if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000) |
531 | return 0; | 594 | return 0; |
532 | return id[82] & (1 << 5); | 595 | return id[ATA_ID_COMMAND_SET_1] & (1 << 5); |
533 | } | 596 | } |
534 | 597 | ||
535 | static inline int ata_id_has_pm(const u16 *id) | 598 | static inline int ata_id_has_pm(const u16 *id) |
536 | { | 599 | { |
537 | if ((id[83] & 0xC000) != 0x4000) | 600 | if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000) |
538 | return 0; | 601 | return 0; |
539 | return id[82] & (1 << 3); | 602 | return id[ATA_ID_COMMAND_SET_1] & (1 << 3); |
540 | } | 603 | } |
541 | 604 | ||
542 | static inline int ata_id_rahead_enabled(const u16 *id) | 605 | static inline int ata_id_rahead_enabled(const u16 *id) |
543 | { | 606 | { |
544 | if ((id[87] & 0xC000) != 0x4000) | 607 | if ((id[ATA_ID_CSF_DEFAULT] & 0xC000) != 0x4000) |
545 | return 0; | 608 | return 0; |
546 | return id[85] & (1 << 6); | 609 | return id[ATA_ID_CFS_ENABLE_1] & (1 << 6); |
547 | } | 610 | } |
548 | 611 | ||
549 | static inline int ata_id_wcache_enabled(const u16 *id) | 612 | static inline int ata_id_wcache_enabled(const u16 *id) |
550 | { | 613 | { |
551 | if ((id[87] & 0xC000) != 0x4000) | 614 | if ((id[ATA_ID_CSF_DEFAULT] & 0xC000) != 0x4000) |
552 | return 0; | 615 | return 0; |
553 | return id[85] & (1 << 5); | 616 | return id[ATA_ID_CFS_ENABLE_1] & (1 << 5); |
554 | } | 617 | } |
555 | 618 | ||
556 | /** | 619 | /** |
@@ -581,7 +644,7 @@ static inline unsigned int ata_id_major_version(const u16 *id) | |||
581 | 644 | ||
582 | static inline int ata_id_is_sata(const u16 *id) | 645 | static inline int ata_id_is_sata(const u16 *id) |
583 | { | 646 | { |
584 | return ata_id_major_version(id) >= 5 && id[93] == 0; | 647 | return ata_id_major_version(id) >= 5 && id[ATA_ID_HW_CONFIG] == 0; |
585 | } | 648 | } |
586 | 649 | ||
587 | static inline int ata_id_has_tpm(const u16 *id) | 650 | static inline int ata_id_has_tpm(const u16 *id) |
@@ -599,7 +662,7 @@ static inline int ata_id_has_dword_io(const u16 *id) | |||
599 | /* ATA 8 reuses this flag for "trusted" computing */ | 662 | /* ATA 8 reuses this flag for "trusted" computing */ |
600 | if (ata_id_major_version(id) > 7) | 663 | if (ata_id_major_version(id) > 7) |
601 | return 0; | 664 | return 0; |
602 | if (id[48] & (1 << 0)) | 665 | if (id[ATA_ID_DWORD_IO] & (1 << 0)) |
603 | return 1; | 666 | return 1; |
604 | return 0; | 667 | return 0; |
605 | } | 668 | } |
@@ -608,22 +671,22 @@ static inline int ata_id_current_chs_valid(const u16 *id) | |||
608 | { | 671 | { |
609 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command | 672 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command |
610 | has not been issued to the device then the values of | 673 | has not been issued to the device then the values of |
611 | id[54] to id[56] are vendor specific. */ | 674 | id[ATA_ID_CUR_CYLS] to id[ATA_ID_CUR_SECTORS] are vendor specific. */ |
612 | return (id[53] & 0x01) && /* Current translation valid */ | 675 | return (id[ATA_ID_FIELD_VALID] & 1) && /* Current translation valid */ |
613 | id[54] && /* cylinders in current translation */ | 676 | id[ATA_ID_CUR_CYLS] && /* cylinders in current translation */ |
614 | id[55] && /* heads in current translation */ | 677 | id[ATA_ID_CUR_HEADS] && /* heads in current translation */ |
615 | id[55] <= 16 && | 678 | id[ATA_ID_CUR_HEADS] <= 16 && |
616 | id[56]; /* sectors in current translation */ | 679 | id[ATA_ID_CUR_SECTORS]; /* sectors in current translation */ |
617 | } | 680 | } |
618 | 681 | ||
619 | static inline int ata_id_is_cfa(const u16 *id) | 682 | static inline int ata_id_is_cfa(const u16 *id) |
620 | { | 683 | { |
621 | u16 v = id[0]; | 684 | if (id[ATA_ID_CONFIG] == 0x848A) /* Standard CF */ |
622 | if (v == 0x848A) /* Standard CF */ | ||
623 | return 1; | 685 | return 1; |
624 | /* Could be CF hiding as standard ATA */ | 686 | /* Could be CF hiding as standard ATA */ |
625 | if (ata_id_major_version(id) >= 3 && id[82] != 0xFFFF && | 687 | if (ata_id_major_version(id) >= 3 && |
626 | (id[82] & ( 1 << 2))) | 688 | id[ATA_ID_COMMAND_SET_1] != 0xFFFF && |
689 | (id[ATA_ID_COMMAND_SET_1] & (1 << 2))) | ||
627 | return 1; | 690 | return 1; |
628 | return 0; | 691 | return 0; |
629 | } | 692 | } |
@@ -632,21 +695,21 @@ static inline int ata_drive_40wire(const u16 *dev_id) | |||
632 | { | 695 | { |
633 | if (ata_id_is_sata(dev_id)) | 696 | if (ata_id_is_sata(dev_id)) |
634 | return 0; /* SATA */ | 697 | return 0; /* SATA */ |
635 | if ((dev_id[93] & 0xE000) == 0x6000) | 698 | if ((dev_id[ATA_ID_HW_CONFIG] & 0xE000) == 0x6000) |
636 | return 0; /* 80 wire */ | 699 | return 0; /* 80 wire */ |
637 | return 1; | 700 | return 1; |
638 | } | 701 | } |
639 | 702 | ||
640 | static inline int ata_drive_40wire_relaxed(const u16 *dev_id) | 703 | static inline int ata_drive_40wire_relaxed(const u16 *dev_id) |
641 | { | 704 | { |
642 | if ((dev_id[93] & 0x2000) == 0x2000) | 705 | if ((dev_id[ATA_ID_HW_CONFIG] & 0x2000) == 0x2000) |
643 | return 0; /* 80 wire */ | 706 | return 0; /* 80 wire */ |
644 | return 1; | 707 | return 1; |
645 | } | 708 | } |
646 | 709 | ||
647 | static inline int atapi_cdb_len(const u16 *dev_id) | 710 | static inline int atapi_cdb_len(const u16 *dev_id) |
648 | { | 711 | { |
649 | u16 tmp = dev_id[0] & 0x3; | 712 | u16 tmp = dev_id[ATA_ID_CONFIG] & 0x3; |
650 | switch (tmp) { | 713 | switch (tmp) { |
651 | case 0: return 12; | 714 | case 0: return 12; |
652 | case 1: return 16; | 715 | case 1: return 16; |
@@ -656,7 +719,7 @@ static inline int atapi_cdb_len(const u16 *dev_id) | |||
656 | 719 | ||
657 | static inline int atapi_command_packet_set(const u16 *dev_id) | 720 | static inline int atapi_command_packet_set(const u16 *dev_id) |
658 | { | 721 | { |
659 | return (dev_id[0] >> 8) & 0x1f; | 722 | return (dev_id[ATA_ID_CONFIG] >> 8) & 0x1f; |
660 | } | 723 | } |
661 | 724 | ||
662 | static inline int atapi_id_dmadir(const u16 *dev_id) | 725 | static inline int atapi_id_dmadir(const u16 *dev_id) |
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/blkdev.h b/include/linux/blkdev.h index 88d68081a0f1..44710d7e7bff 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -280,6 +280,15 @@ struct blk_queue_tag { | |||
280 | atomic_t refcnt; /* map can be shared */ | 280 | atomic_t refcnt; /* map can be shared */ |
281 | }; | 281 | }; |
282 | 282 | ||
283 | #define BLK_SCSI_MAX_CMDS (256) | ||
284 | #define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) | ||
285 | |||
286 | struct blk_cmd_filter { | ||
287 | unsigned long read_ok[BLK_SCSI_CMD_PER_LONG]; | ||
288 | unsigned long write_ok[BLK_SCSI_CMD_PER_LONG]; | ||
289 | struct kobject kobj; | ||
290 | }; | ||
291 | |||
283 | struct request_queue | 292 | struct request_queue |
284 | { | 293 | { |
285 | /* | 294 | /* |
@@ -398,6 +407,7 @@ struct request_queue | |||
398 | #if defined(CONFIG_BLK_DEV_BSG) | 407 | #if defined(CONFIG_BLK_DEV_BSG) |
399 | struct bsg_class_device bsg_dev; | 408 | struct bsg_class_device bsg_dev; |
400 | #endif | 409 | #endif |
410 | struct blk_cmd_filter cmd_filter; | ||
401 | }; | 411 | }; |
402 | 412 | ||
403 | #define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ | 413 | #define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ |
@@ -655,6 +665,7 @@ extern struct request *blk_get_request(struct request_queue *, int, gfp_t); | |||
655 | extern void blk_insert_request(struct request_queue *, struct request *, int, void *); | 665 | extern void blk_insert_request(struct request_queue *, struct request *, int, void *); |
656 | extern void blk_requeue_request(struct request_queue *, struct request *); | 666 | extern void blk_requeue_request(struct request_queue *, struct request *); |
657 | extern void blk_plug_device(struct request_queue *); | 667 | extern void blk_plug_device(struct request_queue *); |
668 | extern void blk_plug_device_unlocked(struct request_queue *); | ||
658 | extern int blk_remove_plug(struct request_queue *); | 669 | extern int blk_remove_plug(struct request_queue *); |
659 | extern void blk_recount_segments(struct request_queue *, struct bio *); | 670 | extern void blk_recount_segments(struct request_queue *, struct bio *); |
660 | extern int scsi_cmd_ioctl(struct file *, struct request_queue *, | 671 | extern int scsi_cmd_ioctl(struct file *, struct request_queue *, |
@@ -806,8 +817,6 @@ extern void blk_put_queue(struct request_queue *); | |||
806 | /* | 817 | /* |
807 | * tag stuff | 818 | * tag stuff |
808 | */ | 819 | */ |
809 | #define blk_queue_tag_depth(q) ((q)->queue_tags->busy) | ||
810 | #define blk_queue_tag_queue(q) ((q)->queue_tags->busy < (q)->queue_tags->max_depth) | ||
811 | #define blk_rq_tagged(rq) ((rq)->cmd_flags & REQ_QUEUED) | 820 | #define blk_rq_tagged(rq) ((rq)->cmd_flags & REQ_QUEUED) |
812 | extern int blk_queue_start_tag(struct request_queue *, struct request *); | 821 | extern int blk_queue_start_tag(struct request_queue *, struct request *); |
813 | extern struct request *blk_queue_find_tag(struct request_queue *, int); | 822 | extern struct request *blk_queue_find_tag(struct request_queue *, int); |
@@ -832,11 +841,11 @@ extern int blkdev_issue_flush(struct block_device *, sector_t *); | |||
832 | /* | 841 | /* |
833 | * command filter functions | 842 | * command filter functions |
834 | */ | 843 | */ |
835 | extern int blk_verify_command(struct file *file, unsigned char *cmd); | 844 | extern int blk_verify_command(struct blk_cmd_filter *filter, |
836 | extern int blk_cmd_filter_verify_command(struct blk_scsi_cmd_filter *filter, | 845 | unsigned char *cmd, int has_write_perm); |
837 | unsigned char *cmd, mode_t *f_mode); | ||
838 | extern int blk_register_filter(struct gendisk *disk); | 846 | extern int blk_register_filter(struct gendisk *disk); |
839 | extern void blk_unregister_filter(struct gendisk *disk); | 847 | extern void blk_unregister_filter(struct gendisk *disk); |
848 | extern void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter); | ||
840 | 849 | ||
841 | #define MAX_PHYS_SEGMENTS 128 | 850 | #define MAX_PHYS_SEGMENTS 128 |
842 | #define MAX_HW_SEGMENTS 128 | 851 | #define MAX_HW_SEGMENTS 128 |
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/buffer_head.h b/include/linux/buffer_head.h index 50cfe8ceb478..eadaab44015f 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -115,7 +115,6 @@ BUFFER_FNS(Uptodate, uptodate) | |||
115 | BUFFER_FNS(Dirty, dirty) | 115 | BUFFER_FNS(Dirty, dirty) |
116 | TAS_BUFFER_FNS(Dirty, dirty) | 116 | TAS_BUFFER_FNS(Dirty, dirty) |
117 | BUFFER_FNS(Lock, locked) | 117 | BUFFER_FNS(Lock, locked) |
118 | TAS_BUFFER_FNS(Lock, locked) | ||
119 | BUFFER_FNS(Req, req) | 118 | BUFFER_FNS(Req, req) |
120 | TAS_BUFFER_FNS(Req, req) | 119 | TAS_BUFFER_FNS(Req, req) |
121 | BUFFER_FNS(Mapped, mapped) | 120 | BUFFER_FNS(Mapped, mapped) |
@@ -321,10 +320,15 @@ static inline void wait_on_buffer(struct buffer_head *bh) | |||
321 | __wait_on_buffer(bh); | 320 | __wait_on_buffer(bh); |
322 | } | 321 | } |
323 | 322 | ||
323 | static inline int trylock_buffer(struct buffer_head *bh) | ||
324 | { | ||
325 | return likely(!test_and_set_bit(BH_Lock, &bh->b_state)); | ||
326 | } | ||
327 | |||
324 | static inline void lock_buffer(struct buffer_head *bh) | 328 | static inline void lock_buffer(struct buffer_head *bh) |
325 | { | 329 | { |
326 | might_sleep(); | 330 | might_sleep(); |
327 | if (test_set_buffer_locked(bh)) | 331 | if (!trylock_buffer(bh)) |
328 | __lock_buffer(bh); | 332 | __lock_buffer(bh); |
329 | } | 333 | } |
330 | 334 | ||
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/capability.h b/include/linux/capability.h index 02673846d205..9d1fe30b6f6c 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h | |||
@@ -503,8 +503,19 @@ extern const kernel_cap_t __cap_init_eff_set; | |||
503 | 503 | ||
504 | kernel_cap_t cap_set_effective(const kernel_cap_t pE_new); | 504 | kernel_cap_t cap_set_effective(const kernel_cap_t pE_new); |
505 | 505 | ||
506 | int capable(int cap); | 506 | /** |
507 | int __capable(struct task_struct *t, int cap); | 507 | * has_capability - Determine if a task has a superior capability available |
508 | * @t: The task in question | ||
509 | * @cap: The capability to be tested for | ||
510 | * | ||
511 | * Return true if the specified task has the given superior capability | ||
512 | * currently in effect, false if not. | ||
513 | * | ||
514 | * Note that this does not set PF_SUPERPRIV on the task. | ||
515 | */ | ||
516 | #define has_capability(t, cap) (security_capable((t), (cap)) == 0) | ||
517 | |||
518 | extern int capable(int cap); | ||
508 | 519 | ||
509 | #endif /* __KERNEL__ */ | 520 | #endif /* __KERNEL__ */ |
510 | 521 | ||
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index c33b0dc28e4d..ed3a5d473e52 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h | |||
@@ -127,6 +127,8 @@ extern int clockevents_register_notifier(struct notifier_block *nb); | |||
127 | extern int clockevents_program_event(struct clock_event_device *dev, | 127 | extern int clockevents_program_event(struct clock_event_device *dev, |
128 | ktime_t expires, ktime_t now); | 128 | ktime_t expires, ktime_t now); |
129 | 129 | ||
130 | extern void clockevents_handle_noop(struct clock_event_device *dev); | ||
131 | |||
130 | #ifdef CONFIG_GENERIC_CLOCKEVENTS | 132 | #ifdef CONFIG_GENERIC_CLOCKEVENTS |
131 | extern void clockevents_notify(unsigned long reason, void *arg); | 133 | extern void clockevents_notify(unsigned long reason, void *arg); |
132 | #else | 134 | #else |
diff --git a/include/linux/completion.h b/include/linux/completion.h index d2961b66d53d..02ef8835999c 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h | |||
@@ -49,10 +49,13 @@ extern unsigned long wait_for_completion_timeout(struct completion *x, | |||
49 | unsigned long timeout); | 49 | unsigned long timeout); |
50 | extern unsigned long wait_for_completion_interruptible_timeout( | 50 | extern unsigned long wait_for_completion_interruptible_timeout( |
51 | struct completion *x, unsigned long timeout); | 51 | struct completion *x, unsigned long timeout); |
52 | extern bool try_wait_for_completion(struct completion *x); | ||
53 | extern bool completion_done(struct completion *x); | ||
52 | 54 | ||
53 | extern void complete(struct completion *); | 55 | extern void complete(struct completion *); |
54 | extern void complete_all(struct completion *); | 56 | extern void complete_all(struct completion *); |
55 | 57 | ||
56 | #define INIT_COMPLETION(x) ((x).done = 0) | 58 | #define INIT_COMPLETION(x) ((x).done = 0) |
57 | 59 | ||
60 | |||
58 | #endif | 61 | #endif |
diff --git a/include/linux/configfs.h b/include/linux/configfs.h index d62c19ff041c..7f627775c947 100644 --- a/include/linux/configfs.h +++ b/include/linux/configfs.h | |||
@@ -40,6 +40,7 @@ | |||
40 | #include <linux/list.h> | 40 | #include <linux/list.h> |
41 | #include <linux/kref.h> | 41 | #include <linux/kref.h> |
42 | #include <linux/mutex.h> | 42 | #include <linux/mutex.h> |
43 | #include <linux/err.h> | ||
43 | 44 | ||
44 | #include <asm/atomic.h> | 45 | #include <asm/atomic.h> |
45 | 46 | ||
@@ -129,8 +130,25 @@ struct configfs_attribute { | |||
129 | /* | 130 | /* |
130 | * Users often need to create attribute structures for their configurable | 131 | * Users often need to create attribute structures for their configurable |
131 | * attributes, containing a configfs_attribute member and function pointers | 132 | * attributes, containing a configfs_attribute member and function pointers |
132 | * for the show() and store() operations on that attribute. They can use | 133 | * for the show() and store() operations on that attribute. If they don't |
133 | * this macro (similar to sysfs' __ATTR) to make defining attributes easier. | 134 | * need anything else on the extended attribute structure, they can use |
135 | * this macro to define it The argument _item is the name of the | ||
136 | * config_item structure. | ||
137 | */ | ||
138 | #define CONFIGFS_ATTR_STRUCT(_item) \ | ||
139 | struct _item##_attribute { \ | ||
140 | struct configfs_attribute attr; \ | ||
141 | ssize_t (*show)(struct _item *, char *); \ | ||
142 | ssize_t (*store)(struct _item *, const char *, size_t); \ | ||
143 | } | ||
144 | |||
145 | /* | ||
146 | * With the extended attribute structure, users can use this macro | ||
147 | * (similar to sysfs' __ATTR) to make defining attributes easier. | ||
148 | * An example: | ||
149 | * #define MYITEM_ATTR(_name, _mode, _show, _store) \ | ||
150 | * struct myitem_attribute childless_attr_##_name = \ | ||
151 | * __CONFIGFS_ATTR(_name, _mode, _show, _store) | ||
134 | */ | 152 | */ |
135 | #define __CONFIGFS_ATTR(_name, _mode, _show, _store) \ | 153 | #define __CONFIGFS_ATTR(_name, _mode, _show, _store) \ |
136 | { \ | 154 | { \ |
@@ -142,6 +160,52 @@ struct configfs_attribute { | |||
142 | .show = _show, \ | 160 | .show = _show, \ |
143 | .store = _store, \ | 161 | .store = _store, \ |
144 | } | 162 | } |
163 | /* Here is a readonly version, only requiring a show() operation */ | ||
164 | #define __CONFIGFS_ATTR_RO(_name, _show) \ | ||
165 | { \ | ||
166 | .attr = { \ | ||
167 | .ca_name = __stringify(_name), \ | ||
168 | .ca_mode = 0444, \ | ||
169 | .ca_owner = THIS_MODULE, \ | ||
170 | }, \ | ||
171 | .show = _show, \ | ||
172 | } | ||
173 | |||
174 | /* | ||
175 | * With these extended attributes, the simple show_attribute() and | ||
176 | * store_attribute() operations need to call the show() and store() of the | ||
177 | * attributes. This is a common pattern, so we provide a macro to define | ||
178 | * them. The argument _item is the name of the config_item structure. | ||
179 | * This macro expects the attributes to be named "struct <name>_attribute" | ||
180 | * and the function to_<name>() to exist; | ||
181 | */ | ||
182 | #define CONFIGFS_ATTR_OPS(_item) \ | ||
183 | static ssize_t _item##_attr_show(struct config_item *item, \ | ||
184 | struct configfs_attribute *attr, \ | ||
185 | char *page) \ | ||
186 | { \ | ||
187 | struct _item *_item = to_##_item(item); \ | ||
188 | struct _item##_attribute *_item##_attr = \ | ||
189 | container_of(attr, struct _item##_attribute, attr); \ | ||
190 | ssize_t ret = 0; \ | ||
191 | \ | ||
192 | if (_item##_attr->show) \ | ||
193 | ret = _item##_attr->show(_item, page); \ | ||
194 | return ret; \ | ||
195 | } \ | ||
196 | static ssize_t _item##_attr_store(struct config_item *item, \ | ||
197 | struct configfs_attribute *attr, \ | ||
198 | const char *page, size_t count) \ | ||
199 | { \ | ||
200 | struct _item *_item = to_##_item(item); \ | ||
201 | struct _item##_attribute *_item##_attr = \ | ||
202 | container_of(attr, struct _item##_attribute, attr); \ | ||
203 | ssize_t ret = -EINVAL; \ | ||
204 | \ | ||
205 | if (_item##_attr->store) \ | ||
206 | ret = _item##_attr->store(_item, page, count); \ | ||
207 | return ret; \ | ||
208 | } | ||
145 | 209 | ||
146 | /* | 210 | /* |
147 | * If allow_link() exists, the item can symlink(2) out to other | 211 | * If allow_link() exists, the item can symlink(2) out to other |
diff --git a/include/linux/connector.h b/include/linux/connector.h index 96a89d3d6727..5c7f9468f753 100644 --- a/include/linux/connector.h +++ b/include/linux/connector.h | |||
@@ -38,8 +38,9 @@ | |||
38 | #define CN_W1_VAL 0x1 | 38 | #define CN_W1_VAL 0x1 |
39 | #define CN_IDX_V86D 0x4 | 39 | #define CN_IDX_V86D 0x4 |
40 | #define CN_VAL_V86D_UVESAFB 0x1 | 40 | #define CN_VAL_V86D_UVESAFB 0x1 |
41 | #define CN_IDX_BB 0x5 /* BlackBoard, from the TSP GPL sampling framework */ | ||
41 | 42 | ||
42 | #define CN_NETLINK_USERS 5 | 43 | #define CN_NETLINK_USERS 6 |
43 | 44 | ||
44 | /* | 45 | /* |
45 | * Maximum connector's message size. | 46 | * Maximum connector's message size. |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 2270ca5ec631..6fd5668aa572 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -106,6 +106,7 @@ struct cpufreq_policy { | |||
106 | #define CPUFREQ_ADJUST (0) | 106 | #define CPUFREQ_ADJUST (0) |
107 | #define CPUFREQ_INCOMPATIBLE (1) | 107 | #define CPUFREQ_INCOMPATIBLE (1) |
108 | #define CPUFREQ_NOTIFY (2) | 108 | #define CPUFREQ_NOTIFY (2) |
109 | #define CPUFREQ_START (3) | ||
109 | 110 | ||
110 | #define CPUFREQ_SHARED_TYPE_NONE (0) /* None */ | 111 | #define CPUFREQ_SHARED_TYPE_NONE (0) /* None */ |
111 | #define CPUFREQ_SHARED_TYPE_HW (1) /* HW does needed coordination */ | 112 | #define CPUFREQ_SHARED_TYPE_HW (1) /* HW does needed coordination */ |
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 96d0509fb8d8..d3219d73f8e6 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -287,7 +287,7 @@ static inline const cpumask_t *get_cpu_mask(unsigned int cpu) | |||
287 | * gcc optimizes it out (it's a constant) and there's no huge stack | 287 | * gcc optimizes it out (it's a constant) and there's no huge stack |
288 | * variable created: | 288 | * variable created: |
289 | */ | 289 | */ |
290 | #define cpumask_of_cpu(cpu) ({ *get_cpu_mask(cpu); }) | 290 | #define cpumask_of_cpu(cpu) (*get_cpu_mask(cpu)) |
291 | 291 | ||
292 | 292 | ||
293 | #define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS) | 293 | #define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS) |
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index e8f450c499b0..2691926fb506 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h | |||
@@ -160,7 +160,7 @@ static inline int current_cpuset_is_being_rebound(void) | |||
160 | 160 | ||
161 | static inline void rebuild_sched_domains(void) | 161 | static inline void rebuild_sched_domains(void) |
162 | { | 162 | { |
163 | partition_sched_domains(0, NULL, NULL); | 163 | partition_sched_domains(1, NULL, NULL); |
164 | } | 164 | } |
165 | 165 | ||
166 | #endif /* !CONFIG_CPUSETS */ | 166 | #endif /* !CONFIG_CPUSETS */ |
diff --git a/include/linux/cred.h b/include/linux/cred.h new file mode 100644 index 000000000000..b69222cc1fd2 --- /dev/null +++ b/include/linux/cred.h | |||
@@ -0,0 +1,50 @@ | |||
1 | /* Credentials management | ||
2 | * | ||
3 | * Copyright (C) 2008 Red Hat, Inc. All Rights Reserved. | ||
4 | * Written by David Howells (dhowells@redhat.com) | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public Licence | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the Licence, or (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #ifndef _LINUX_CRED_H | ||
13 | #define _LINUX_CRED_H | ||
14 | |||
15 | #define get_current_user() (get_uid(current->user)) | ||
16 | |||
17 | #define task_uid(task) ((task)->uid) | ||
18 | #define task_gid(task) ((task)->gid) | ||
19 | #define task_euid(task) ((task)->euid) | ||
20 | #define task_egid(task) ((task)->egid) | ||
21 | |||
22 | #define current_uid() (current->uid) | ||
23 | #define current_gid() (current->gid) | ||
24 | #define current_euid() (current->euid) | ||
25 | #define current_egid() (current->egid) | ||
26 | #define current_suid() (current->suid) | ||
27 | #define current_sgid() (current->sgid) | ||
28 | #define current_fsuid() (current->fsuid) | ||
29 | #define current_fsgid() (current->fsgid) | ||
30 | #define current_cap() (current->cap_effective) | ||
31 | |||
32 | #define current_uid_gid(_uid, _gid) \ | ||
33 | do { \ | ||
34 | *(_uid) = current->uid; \ | ||
35 | *(_gid) = current->gid; \ | ||
36 | } while(0) | ||
37 | |||
38 | #define current_euid_egid(_uid, _gid) \ | ||
39 | do { \ | ||
40 | *(_uid) = current->euid; \ | ||
41 | *(_gid) = current->egid; \ | ||
42 | } while(0) | ||
43 | |||
44 | #define current_fsuid_fsgid(_uid, _gid) \ | ||
45 | do { \ | ||
46 | *(_uid) = current->fsuid; \ | ||
47 | *(_gid) = current->fsgid; \ | ||
48 | } while(0) | ||
49 | |||
50 | #endif /* _LINUX_CRED_H */ | ||
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 98202c672fde..efba1de629ac 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
@@ -230,6 +230,7 @@ extern void d_delete(struct dentry *); | |||
230 | extern struct dentry * d_alloc(struct dentry *, const struct qstr *); | 230 | extern struct dentry * d_alloc(struct dentry *, const struct qstr *); |
231 | extern struct dentry * d_alloc_anon(struct inode *); | 231 | extern struct dentry * d_alloc_anon(struct inode *); |
232 | extern struct dentry * d_splice_alias(struct inode *, struct dentry *); | 232 | extern struct dentry * d_splice_alias(struct inode *, struct dentry *); |
233 | extern struct dentry * d_add_ci(struct dentry *, struct inode *, struct qstr *); | ||
233 | extern void shrink_dcache_sb(struct super_block *); | 234 | extern void shrink_dcache_sb(struct super_block *); |
234 | extern void shrink_dcache_parent(struct dentry *); | 235 | extern void shrink_dcache_parent(struct dentry *); |
235 | extern void shrink_dcache_for_umount(struct super_block *); | 236 | extern void shrink_dcache_for_umount(struct super_block *); |
diff --git a/include/linux/device.h b/include/linux/device.h index d24a47f80f9c..4d8372d135df 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -358,6 +358,7 @@ struct device { | |||
358 | 358 | ||
359 | struct kobject kobj; | 359 | struct kobject kobj; |
360 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ | 360 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ |
361 | const char *init_name; /* initial name of the device */ | ||
361 | struct device_type *type; | 362 | struct device_type *type; |
362 | unsigned uevent_suppress:1; | 363 | unsigned uevent_suppress:1; |
363 | 364 | ||
@@ -406,7 +407,7 @@ struct device { | |||
406 | /* Get the wakeup routines, which depend on struct device */ | 407 | /* Get the wakeup routines, which depend on struct device */ |
407 | #include <linux/pm_wakeup.h> | 408 | #include <linux/pm_wakeup.h> |
408 | 409 | ||
409 | static inline const char *dev_name(struct device *dev) | 410 | static inline const char *dev_name(const struct device *dev) |
410 | { | 411 | { |
411 | /* will be changed into kobject_name(&dev->kobj) in the near future */ | 412 | /* will be changed into kobject_name(&dev->kobj) in the near future */ |
412 | return dev->bus_id; | 413 | return dev->bus_id; |
@@ -518,7 +519,7 @@ extern void device_shutdown(void); | |||
518 | extern void sysdev_shutdown(void); | 519 | extern void sysdev_shutdown(void); |
519 | 520 | ||
520 | /* debugging and troubleshooting/diagnostic helpers. */ | 521 | /* debugging and troubleshooting/diagnostic helpers. */ |
521 | extern const char *dev_driver_string(struct device *dev); | 522 | extern const char *dev_driver_string(const struct device *dev); |
522 | #define dev_printk(level, dev, format, arg...) \ | 523 | #define dev_printk(level, dev, format, arg...) \ |
523 | printk(level "%s %s: " format , dev_driver_string(dev) , \ | 524 | printk(level "%s %s: " format , dev_driver_string(dev) , \ |
524 | dev_name(dev) , ## arg) | 525 | dev_name(dev) , ## arg) |
diff --git a/include/linux/dm9000.h b/include/linux/dm9000.h index fc82446b6425..c30879cf93bc 100644 --- a/include/linux/dm9000.h +++ b/include/linux/dm9000.h | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | struct dm9000_plat_data { | 28 | struct dm9000_plat_data { |
29 | unsigned int flags; | 29 | unsigned int flags; |
30 | unsigned char dev_addr[6]; | ||
30 | 31 | ||
31 | /* allow replacement IO routines */ | 32 | /* allow replacement IO routines */ |
32 | 33 | ||
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index 8bb5e87df365..b4b038b89ee6 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -27,9 +27,24 @@ struct ethtool_cmd { | |||
27 | __u8 autoneg; /* Enable or disable autonegotiation */ | 27 | __u8 autoneg; /* Enable or disable autonegotiation */ |
28 | __u32 maxtxpkt; /* Tx pkts before generating tx int */ | 28 | __u32 maxtxpkt; /* Tx pkts before generating tx int */ |
29 | __u32 maxrxpkt; /* Rx pkts before generating rx int */ | 29 | __u32 maxrxpkt; /* Rx pkts before generating rx int */ |
30 | __u32 reserved[4]; | 30 | __u16 speed_hi; |
31 | __u16 reserved2; | ||
32 | __u32 reserved[3]; | ||
31 | }; | 33 | }; |
32 | 34 | ||
35 | static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep, | ||
36 | __u32 speed) | ||
37 | { | ||
38 | |||
39 | ep->speed = (__u16)speed; | ||
40 | ep->speed_hi = (__u16)(speed >> 16); | ||
41 | } | ||
42 | |||
43 | static inline __u32 ethtool_cmd_speed(struct ethtool_cmd *ep) | ||
44 | { | ||
45 | return (ep->speed_hi << 16) | ep->speed; | ||
46 | } | ||
47 | |||
33 | #define ETHTOOL_BUSINFO_LEN 32 | 48 | #define ETHTOOL_BUSINFO_LEN 32 |
34 | /* these strings are set to whatever the driver author decides... */ | 49 | /* these strings are set to whatever the driver author decides... */ |
35 | struct ethtool_drvinfo { | 50 | struct ethtool_drvinfo { |
diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h index f5abd1306638..27e772cefb6a 100644 --- a/include/linux/exportfs.h +++ b/include/linux/exportfs.h | |||
@@ -35,6 +35,27 @@ enum fid_type { | |||
35 | FILEID_INO32_GEN_PARENT = 2, | 35 | FILEID_INO32_GEN_PARENT = 2, |
36 | 36 | ||
37 | /* | 37 | /* |
38 | * 64 bit object ID, 64 bit root object ID, | ||
39 | * 32 bit generation number. | ||
40 | */ | ||
41 | FILEID_BTRFS_WITHOUT_PARENT = 0x4d, | ||
42 | |||
43 | /* | ||
44 | * 64 bit object ID, 64 bit root object ID, | ||
45 | * 32 bit generation number, | ||
46 | * 64 bit parent object ID, 32 bit parent generation. | ||
47 | */ | ||
48 | FILEID_BTRFS_WITH_PARENT = 0x4e, | ||
49 | |||
50 | /* | ||
51 | * 64 bit object ID, 64 bit root object ID, | ||
52 | * 32 bit generation number, | ||
53 | * 64 bit parent object ID, 32 bit parent generation, | ||
54 | * 64 bit parent root object ID. | ||
55 | */ | ||
56 | FILEID_BTRFS_WITH_PARENT_ROOT = 0x4f, | ||
57 | |||
58 | /* | ||
38 | * 32 bit block number, 16 bit partition reference, | 59 | * 32 bit block number, 16 bit partition reference, |
39 | * 16 bit unused, 32 bit generation number. | 60 | * 16 bit unused, 32 bit generation number. |
40 | */ | 61 | */ |
diff --git a/include/linux/fb.h b/include/linux/fb.h index 3b8870e32afd..531ccd5f5960 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -976,6 +976,9 @@ static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, | |||
976 | 976 | ||
977 | /* drivers/video/fb_defio.c */ | 977 | /* drivers/video/fb_defio.c */ |
978 | extern void fb_deferred_io_init(struct fb_info *info); | 978 | extern void fb_deferred_io_init(struct fb_info *info); |
979 | extern void fb_deferred_io_open(struct fb_info *info, | ||
980 | struct inode *inode, | ||
981 | struct file *file); | ||
979 | extern void fb_deferred_io_cleanup(struct fb_info *info); | 982 | extern void fb_deferred_io_cleanup(struct fb_info *info); |
980 | extern int fb_deferred_io_fsync(struct file *file, struct dentry *dentry, | 983 | extern int fb_deferred_io_fsync(struct file *file, struct dentry *dentry, |
981 | int datasync); | 984 | int datasync); |
diff --git a/include/linux/file.h b/include/linux/file.h index 27c64bdc68c9..a20259e248a5 100644 --- a/include/linux/file.h +++ b/include/linux/file.h | |||
@@ -34,8 +34,9 @@ extern struct file *fget(unsigned int fd); | |||
34 | extern struct file *fget_light(unsigned int fd, int *fput_needed); | 34 | extern struct file *fget_light(unsigned int fd, int *fput_needed); |
35 | extern void set_close_on_exec(unsigned int fd, int flag); | 35 | extern void set_close_on_exec(unsigned int fd, int flag); |
36 | extern void put_filp(struct file *); | 36 | extern void put_filp(struct file *); |
37 | extern int alloc_fd(unsigned start, unsigned flags); | ||
37 | extern int get_unused_fd(void); | 38 | extern int get_unused_fd(void); |
38 | extern int get_unused_fd_flags(int flags); | 39 | #define get_unused_fd_flags(flags) alloc_fd(0, (flags)) |
39 | extern void put_unused_fd(unsigned int fd); | 40 | extern void put_unused_fd(unsigned int fd); |
40 | 41 | ||
41 | extern void fd_install(unsigned int fd, struct file *file); | 42 | extern void fd_install(unsigned int fd, struct file *file); |
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/fs_uart_pd.h b/include/linux/fs_uart_pd.h index 809bb9ffc788..36b61ff39277 100644 --- a/include/linux/fs_uart_pd.h +++ b/include/linux/fs_uart_pd.h | |||
@@ -12,7 +12,6 @@ | |||
12 | #ifndef FS_UART_PD_H | 12 | #ifndef FS_UART_PD_H |
13 | #define FS_UART_PD_H | 13 | #define FS_UART_PD_H |
14 | 14 | ||
15 | #include <linux/version.h> | ||
16 | #include <asm/types.h> | 15 | #include <asm/types.h> |
17 | 16 | ||
18 | enum fs_uart_id { | 17 | enum fs_uart_id { |
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index f368d041e02d..bb384068272e 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -98,6 +98,27 @@ static inline void tracer_disable(void) | |||
98 | #endif | 98 | #endif |
99 | } | 99 | } |
100 | 100 | ||
101 | /* Ftrace disable/restore without lock. Some synchronization mechanism | ||
102 | * must be used to prevent ftrace_enabled to be changed between | ||
103 | * disable/restore. */ | ||
104 | static inline int __ftrace_enabled_save(void) | ||
105 | { | ||
106 | #ifdef CONFIG_FTRACE | ||
107 | int saved_ftrace_enabled = ftrace_enabled; | ||
108 | ftrace_enabled = 0; | ||
109 | return saved_ftrace_enabled; | ||
110 | #else | ||
111 | return 0; | ||
112 | #endif | ||
113 | } | ||
114 | |||
115 | static inline void __ftrace_enabled_restore(int enabled) | ||
116 | { | ||
117 | #ifdef CONFIG_FTRACE | ||
118 | ftrace_enabled = enabled; | ||
119 | #endif | ||
120 | } | ||
121 | |||
101 | #ifdef CONFIG_FRAME_POINTER | 122 | #ifdef CONFIG_FRAME_POINTER |
102 | /* TODO: need to fix this for ARM */ | 123 | /* TODO: need to fix this for ARM */ |
103 | # define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0)) | 124 | # define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0)) |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 118216f1bd3c..be4f5e5bfe06 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -110,15 +110,6 @@ struct hd_struct { | |||
110 | #define GENHD_FL_SUPPRESS_PARTITION_INFO 32 | 110 | #define GENHD_FL_SUPPRESS_PARTITION_INFO 32 |
111 | #define GENHD_FL_FAIL 64 | 111 | #define GENHD_FL_FAIL 64 |
112 | 112 | ||
113 | #define BLK_SCSI_MAX_CMDS (256) | ||
114 | #define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) | ||
115 | |||
116 | struct blk_scsi_cmd_filter { | ||
117 | unsigned long read_ok[BLK_SCSI_CMD_PER_LONG]; | ||
118 | unsigned long write_ok[BLK_SCSI_CMD_PER_LONG]; | ||
119 | struct kobject kobj; | ||
120 | }; | ||
121 | |||
122 | struct gendisk { | 113 | struct gendisk { |
123 | int major; /* major number of driver */ | 114 | int major; /* major number of driver */ |
124 | int first_minor; | 115 | int first_minor; |
@@ -128,7 +119,6 @@ struct gendisk { | |||
128 | struct hd_struct **part; /* [indexed by minor] */ | 119 | struct hd_struct **part; /* [indexed by minor] */ |
129 | struct block_device_operations *fops; | 120 | struct block_device_operations *fops; |
130 | struct request_queue *queue; | 121 | struct request_queue *queue; |
131 | struct blk_scsi_cmd_filter cmd_filter; | ||
132 | void *private_data; | 122 | void *private_data; |
133 | sector_t capacity; | 123 | sector_t capacity; |
134 | 124 | ||
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/i2c-pnx.h b/include/linux/i2c-pnx.h index e6e9c814da61..f13255e06406 100644 --- a/include/linux/i2c-pnx.h +++ b/include/linux/i2c-pnx.h | |||
@@ -12,7 +12,9 @@ | |||
12 | #ifndef __I2C_PNX_H__ | 12 | #ifndef __I2C_PNX_H__ |
13 | #define __I2C_PNX_H__ | 13 | #define __I2C_PNX_H__ |
14 | 14 | ||
15 | #include <asm/arch/i2c.h> | 15 | #include <linux/pm.h> |
16 | |||
17 | struct platform_device; | ||
16 | 18 | ||
17 | struct i2c_pnx_mif { | 19 | struct i2c_pnx_mif { |
18 | int ret; /* Return value */ | 20 | int ret; /* Return value */ |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 08be0d21864c..06115128047f 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -97,7 +97,19 @@ extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client, | |||
97 | 97 | ||
98 | /** | 98 | /** |
99 | * struct i2c_driver - represent an I2C device driver | 99 | * struct i2c_driver - represent an I2C device driver |
100 | * @id: Unique driver ID (optional) | ||
100 | * @class: What kind of i2c device we instantiate (for detect) | 101 | * @class: What kind of i2c device we instantiate (for detect) |
102 | * @attach_adapter: Callback for bus addition (for legacy drivers) | ||
103 | * @detach_adapter: Callback for bus removal (for legacy drivers) | ||
104 | * @detach_client: Callback for device removal (for legacy drivers) | ||
105 | * @probe: Callback for device binding (new-style drivers) | ||
106 | * @remove: Callback for device unbinding (new-style drivers) | ||
107 | * @shutdown: Callback for device shutdown | ||
108 | * @suspend: Callback for device suspend | ||
109 | * @resume: Callback for device resume | ||
110 | * @command: Callback for bus-wide signaling (optional) | ||
111 | * @driver: Device driver model driver | ||
112 | * @id_table: List of I2C devices supported by this driver | ||
101 | * @detect: Callback for device detection | 113 | * @detect: Callback for device detection |
102 | * @address_data: The I2C addresses to probe, ignore or force (for detect) | 114 | * @address_data: The I2C addresses to probe, ignore or force (for detect) |
103 | * @clients: List of detected clients we created (for i2c-core use only) | 115 | * @clients: List of detected clients we created (for i2c-core use only) |
diff --git a/include/linux/ide.h b/include/linux/ide.h index b846bc44a27e..1524829f73f2 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -219,18 +219,7 @@ static inline int __ide_default_irq(unsigned long base) | |||
219 | #include <asm-generic/ide_iops.h> | 219 | #include <asm-generic/ide_iops.h> |
220 | #endif | 220 | #endif |
221 | 221 | ||
222 | #ifndef MAX_HWIFS | 222 | #define MAX_HWIFS 10 |
223 | #if defined(CONFIG_BLACKFIN) || defined(CONFIG_H8300) || defined(CONFIG_XTENSA) | ||
224 | # define MAX_HWIFS 1 | ||
225 | #else | ||
226 | # define MAX_HWIFS 10 | ||
227 | #endif | ||
228 | #endif | ||
229 | |||
230 | #if !defined(MAX_HWIFS) || defined(CONFIG_EMBEDDED) | ||
231 | #undef MAX_HWIFS | ||
232 | #define MAX_HWIFS CONFIG_IDE_MAX_HWIFS | ||
233 | #endif | ||
234 | 223 | ||
235 | /* Currently only m68k, apus and m8xx need it */ | 224 | /* Currently only m68k, apus and m8xx need it */ |
236 | #ifndef IDE_ARCH_ACK_INTR | 225 | #ifndef IDE_ARCH_ACK_INTR |
@@ -509,24 +498,33 @@ struct ide_tp_ops { | |||
509 | 498 | ||
510 | extern const struct ide_tp_ops default_tp_ops; | 499 | extern const struct ide_tp_ops default_tp_ops; |
511 | 500 | ||
501 | /** | ||
502 | * struct ide_port_ops - IDE port operations | ||
503 | * | ||
504 | * @init_dev: host specific initialization of a device | ||
505 | * @set_pio_mode: routine to program host for PIO mode | ||
506 | * @set_dma_mode: routine to program host for DMA mode | ||
507 | * @selectproc: tweaks hardware to select drive | ||
508 | * @reset_poll: chipset polling based on hba specifics | ||
509 | * @pre_reset: chipset specific changes to default for device-hba resets | ||
510 | * @resetproc: routine to reset controller after a disk reset | ||
511 | * @maskproc: special host masking for drive selection | ||
512 | * @quirkproc: check host's drive quirk list | ||
513 | * | ||
514 | * @mdma_filter: filter MDMA modes | ||
515 | * @udma_filter: filter UDMA modes | ||
516 | * | ||
517 | * @cable_detect: detect cable type | ||
518 | */ | ||
512 | struct ide_port_ops { | 519 | struct ide_port_ops { |
513 | /* host specific initialization of a device */ | ||
514 | void (*init_dev)(ide_drive_t *); | 520 | void (*init_dev)(ide_drive_t *); |
515 | /* routine to program host for PIO mode */ | ||
516 | void (*set_pio_mode)(ide_drive_t *, const u8); | 521 | void (*set_pio_mode)(ide_drive_t *, const u8); |
517 | /* routine to program host for DMA mode */ | ||
518 | void (*set_dma_mode)(ide_drive_t *, const u8); | 522 | void (*set_dma_mode)(ide_drive_t *, const u8); |
519 | /* tweaks hardware to select drive */ | ||
520 | void (*selectproc)(ide_drive_t *); | 523 | void (*selectproc)(ide_drive_t *); |
521 | /* chipset polling based on hba specifics */ | ||
522 | int (*reset_poll)(ide_drive_t *); | 524 | int (*reset_poll)(ide_drive_t *); |
523 | /* chipset specific changes to default for device-hba resets */ | ||
524 | void (*pre_reset)(ide_drive_t *); | 525 | void (*pre_reset)(ide_drive_t *); |
525 | /* routine to reset controller after a disk reset */ | ||
526 | void (*resetproc)(ide_drive_t *); | 526 | void (*resetproc)(ide_drive_t *); |
527 | /* special host masking for drive selection */ | ||
528 | void (*maskproc)(ide_drive_t *, int); | 527 | void (*maskproc)(ide_drive_t *, int); |
529 | /* check host's drive quirk list */ | ||
530 | void (*quirkproc)(ide_drive_t *); | 528 | void (*quirkproc)(ide_drive_t *); |
531 | 529 | ||
532 | u8 (*mdma_filter)(ide_drive_t *); | 530 | u8 (*mdma_filter)(ide_drive_t *); |
@@ -1113,7 +1111,6 @@ void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); | |||
1113 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI | 1111 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI |
1114 | int ide_pci_set_master(struct pci_dev *, const char *); | 1112 | int ide_pci_set_master(struct pci_dev *, const char *); |
1115 | unsigned long ide_pci_dma_base(ide_hwif_t *, const struct ide_port_info *); | 1113 | unsigned long ide_pci_dma_base(ide_hwif_t *, const struct ide_port_info *); |
1116 | extern const struct ide_dma_ops sff_dma_ops; | ||
1117 | int ide_pci_check_simplex(ide_hwif_t *, const struct ide_port_info *); | 1114 | int ide_pci_check_simplex(ide_hwif_t *, const struct ide_port_info *); |
1118 | int ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *); | 1115 | int ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *); |
1119 | #else | 1116 | #else |
@@ -1277,6 +1274,7 @@ extern int __ide_dma_end(ide_drive_t *); | |||
1277 | int ide_dma_test_irq(ide_drive_t *); | 1274 | int ide_dma_test_irq(ide_drive_t *); |
1278 | extern void ide_dma_lost_irq(ide_drive_t *); | 1275 | extern void ide_dma_lost_irq(ide_drive_t *); |
1279 | extern void ide_dma_timeout(ide_drive_t *); | 1276 | extern void ide_dma_timeout(ide_drive_t *); |
1277 | extern const struct ide_dma_ops sff_dma_ops; | ||
1280 | #endif /* CONFIG_BLK_DEV_IDEDMA_SFF */ | 1278 | #endif /* CONFIG_BLK_DEV_IDEDMA_SFF */ |
1281 | 1279 | ||
1282 | #else | 1280 | #else |
@@ -1450,8 +1448,7 @@ static inline void ide_dump_identify(u8 *id) | |||
1450 | 1448 | ||
1451 | static inline int hwif_to_node(ide_hwif_t *hwif) | 1449 | static inline int hwif_to_node(ide_hwif_t *hwif) |
1452 | { | 1450 | { |
1453 | struct pci_dev *dev = to_pci_dev(hwif->dev); | 1451 | return hwif->dev ? dev_to_node(hwif->dev) : -1; |
1454 | return hwif->dev ? pcibus_to_node(dev->bus) : -1; | ||
1455 | } | 1452 | } |
1456 | 1453 | ||
1457 | static inline ide_drive_t *ide_get_paired_drive(ide_drive_t *drive) | 1454 | static inline ide_drive_t *ide_get_paired_drive(ide_drive_t *drive) |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index a1630ba0b87c..7f4df7c7659d 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -506,6 +506,19 @@ struct ieee80211_channel_sw_ie { | |||
506 | u8 count; | 506 | u8 count; |
507 | } __attribute__ ((packed)); | 507 | } __attribute__ ((packed)); |
508 | 508 | ||
509 | /** | ||
510 | * struct ieee80211_tim | ||
511 | * | ||
512 | * This structure refers to "Traffic Indication Map information element" | ||
513 | */ | ||
514 | struct ieee80211_tim_ie { | ||
515 | u8 dtim_count; | ||
516 | u8 dtim_period; | ||
517 | u8 bitmap_ctrl; | ||
518 | /* variable size: 1 - 251 bytes */ | ||
519 | u8 virtual_map[0]; | ||
520 | } __attribute__ ((packed)); | ||
521 | |||
509 | struct ieee80211_mgmt { | 522 | struct ieee80211_mgmt { |
510 | __le16 frame_control; | 523 | __le16 frame_control; |
511 | __le16 duration; | 524 | __le16 duration; |
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h index 4c6307ad9fdb..8529f57ba263 100644 --- a/include/linux/if_tun.h +++ b/include/linux/if_tun.h | |||
@@ -45,6 +45,7 @@ | |||
45 | #define TUNGETFEATURES _IOR('T', 207, unsigned int) | 45 | #define TUNGETFEATURES _IOR('T', 207, unsigned int) |
46 | #define TUNSETOFFLOAD _IOW('T', 208, unsigned int) | 46 | #define TUNSETOFFLOAD _IOW('T', 208, unsigned int) |
47 | #define TUNSETTXFILTER _IOW('T', 209, unsigned int) | 47 | #define TUNSETTXFILTER _IOW('T', 209, unsigned int) |
48 | #define TUNGETIFF _IOR('T', 210, unsigned int) | ||
48 | 49 | ||
49 | /* TUNSETIFF ifr flags */ | 50 | /* TUNSETIFF ifr flags */ |
50 | #define IFF_TUN 0x0001 | 51 | #define IFF_TUN 0x0001 |
diff --git a/include/linux/ihex.h b/include/linux/ihex.h index 2baace2788a7..31d8629e75a1 100644 --- a/include/linux/ihex.h +++ b/include/linux/ihex.h | |||
@@ -18,7 +18,7 @@ struct ihex_binrec { | |||
18 | __be32 addr; | 18 | __be32 addr; |
19 | __be16 len; | 19 | __be16 len; |
20 | uint8_t data[0]; | 20 | uint8_t data[0]; |
21 | } __attribute__((aligned(4))); | 21 | } __attribute__((packed)); |
22 | 22 | ||
23 | /* Find the next record, taking into account the 4-byte alignment */ | 23 | /* Find the next record, taking into account the 4-byte alignment */ |
24 | static inline const struct ihex_binrec * | 24 | static inline const struct ihex_binrec * |
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/interrupt.h b/include/linux/interrupt.h index 62aa4f895abe..58ff4e74b2f3 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -223,35 +223,6 @@ static inline int disable_irq_wake(unsigned int irq) | |||
223 | #define or_softirq_pending(x) (local_softirq_pending() |= (x)) | 223 | #define or_softirq_pending(x) (local_softirq_pending() |= (x)) |
224 | #endif | 224 | #endif |
225 | 225 | ||
226 | /* | ||
227 | * Temporary defines for UP kernels, until all code gets fixed. | ||
228 | */ | ||
229 | #ifndef CONFIG_SMP | ||
230 | static inline void __deprecated cli(void) | ||
231 | { | ||
232 | local_irq_disable(); | ||
233 | } | ||
234 | static inline void __deprecated sti(void) | ||
235 | { | ||
236 | local_irq_enable(); | ||
237 | } | ||
238 | static inline void __deprecated save_flags(unsigned long *x) | ||
239 | { | ||
240 | local_save_flags(*x); | ||
241 | } | ||
242 | #define save_flags(x) save_flags(&x) | ||
243 | static inline void __deprecated restore_flags(unsigned long x) | ||
244 | { | ||
245 | local_irq_restore(x); | ||
246 | } | ||
247 | |||
248 | static inline void __deprecated save_and_cli(unsigned long *x) | ||
249 | { | ||
250 | local_irq_save(*x); | ||
251 | } | ||
252 | #define save_and_cli(x) save_and_cli(&x) | ||
253 | #endif /* CONFIG_SMP */ | ||
254 | |||
255 | /* Some architectures might implement lazy enabling/disabling of | 226 | /* Some architectures might implement lazy enabling/disabling of |
256 | * interrupts. In some cases, such as stop_machine, we might want | 227 | * interrupts. In some cases, such as stop_machine, we might want |
257 | * to ensure that after a local_irq_disable(), interrupts have | 228 | * to ensure that after a local_irq_disable(), interrupts have |
diff --git a/include/linux/iommu-helper.h b/include/linux/iommu-helper.h index f8598f583944..c975caf75385 100644 --- a/include/linux/iommu-helper.h +++ b/include/linux/iommu-helper.h | |||
@@ -8,4 +8,3 @@ extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, | |||
8 | unsigned long align_mask); | 8 | unsigned long align_mask); |
9 | extern void iommu_area_free(unsigned long *map, unsigned long start, | 9 | extern void iommu_area_free(unsigned long *map, unsigned long start, |
10 | unsigned int nr); | 10 | unsigned int nr); |
11 | extern unsigned long iommu_num_pages(unsigned long addr, unsigned long len); | ||
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 2cd07cc29687..8d3b7a9afd17 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -109,6 +109,7 @@ extern struct resource iomem_resource; | |||
109 | extern int request_resource(struct resource *root, struct resource *new); | 109 | extern int request_resource(struct resource *root, struct resource *new); |
110 | extern int release_resource(struct resource *new); | 110 | extern int release_resource(struct resource *new); |
111 | extern int insert_resource(struct resource *parent, struct resource *new); | 111 | extern int insert_resource(struct resource *parent, struct resource *new); |
112 | extern void insert_resource_expand_to_fit(struct resource *root, struct resource *new); | ||
112 | extern int allocate_resource(struct resource *root, struct resource *new, | 113 | extern int allocate_resource(struct resource *root, struct resource *new, |
113 | resource_size_t size, resource_size_t min, | 114 | resource_size_t size, resource_size_t min, |
114 | resource_size_t max, resource_size_t align, | 115 | resource_size_t max, resource_size_t align, |
@@ -118,6 +119,10 @@ extern int allocate_resource(struct resource *root, struct resource *new, | |||
118 | int adjust_resource(struct resource *res, resource_size_t start, | 119 | int adjust_resource(struct resource *res, resource_size_t start, |
119 | resource_size_t size); | 120 | resource_size_t size); |
120 | resource_size_t resource_alignment(struct resource *res); | 121 | resource_size_t resource_alignment(struct resource *res); |
122 | static inline resource_size_t resource_size(struct resource *res) | ||
123 | { | ||
124 | return res->end - res->start + 1; | ||
125 | } | ||
121 | 126 | ||
122 | /* Convenience shorthand with allocation */ | 127 | /* Convenience shorthand with allocation */ |
123 | #define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name)) | 128 | #define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name)) |
diff --git a/include/linux/ip_vs.h b/include/linux/ip_vs.h new file mode 100644 index 000000000000..ec6eb49af2d8 --- /dev/null +++ b/include/linux/ip_vs.h | |||
@@ -0,0 +1,245 @@ | |||
1 | /* | ||
2 | * IP Virtual Server | ||
3 | * data structure and functionality definitions | ||
4 | */ | ||
5 | |||
6 | #ifndef _IP_VS_H | ||
7 | #define _IP_VS_H | ||
8 | |||
9 | #include <linux/types.h> /* For __beXX types in userland */ | ||
10 | |||
11 | #define IP_VS_VERSION_CODE 0x010201 | ||
12 | #define NVERSION(version) \ | ||
13 | (version >> 16) & 0xFF, \ | ||
14 | (version >> 8) & 0xFF, \ | ||
15 | version & 0xFF | ||
16 | |||
17 | /* | ||
18 | * Virtual Service Flags | ||
19 | */ | ||
20 | #define IP_VS_SVC_F_PERSISTENT 0x0001 /* persistent port */ | ||
21 | #define IP_VS_SVC_F_HASHED 0x0002 /* hashed entry */ | ||
22 | |||
23 | /* | ||
24 | * Destination Server Flags | ||
25 | */ | ||
26 | #define IP_VS_DEST_F_AVAILABLE 0x0001 /* server is available */ | ||
27 | #define IP_VS_DEST_F_OVERLOAD 0x0002 /* server is overloaded */ | ||
28 | |||
29 | /* | ||
30 | * IPVS sync daemon states | ||
31 | */ | ||
32 | #define IP_VS_STATE_NONE 0x0000 /* daemon is stopped */ | ||
33 | #define IP_VS_STATE_MASTER 0x0001 /* started as master */ | ||
34 | #define IP_VS_STATE_BACKUP 0x0002 /* started as backup */ | ||
35 | |||
36 | /* | ||
37 | * IPVS socket options | ||
38 | */ | ||
39 | #define IP_VS_BASE_CTL (64+1024+64) /* base */ | ||
40 | |||
41 | #define IP_VS_SO_SET_NONE IP_VS_BASE_CTL /* just peek */ | ||
42 | #define IP_VS_SO_SET_INSERT (IP_VS_BASE_CTL+1) | ||
43 | #define IP_VS_SO_SET_ADD (IP_VS_BASE_CTL+2) | ||
44 | #define IP_VS_SO_SET_EDIT (IP_VS_BASE_CTL+3) | ||
45 | #define IP_VS_SO_SET_DEL (IP_VS_BASE_CTL+4) | ||
46 | #define IP_VS_SO_SET_FLUSH (IP_VS_BASE_CTL+5) | ||
47 | #define IP_VS_SO_SET_LIST (IP_VS_BASE_CTL+6) | ||
48 | #define IP_VS_SO_SET_ADDDEST (IP_VS_BASE_CTL+7) | ||
49 | #define IP_VS_SO_SET_DELDEST (IP_VS_BASE_CTL+8) | ||
50 | #define IP_VS_SO_SET_EDITDEST (IP_VS_BASE_CTL+9) | ||
51 | #define IP_VS_SO_SET_TIMEOUT (IP_VS_BASE_CTL+10) | ||
52 | #define IP_VS_SO_SET_STARTDAEMON (IP_VS_BASE_CTL+11) | ||
53 | #define IP_VS_SO_SET_STOPDAEMON (IP_VS_BASE_CTL+12) | ||
54 | #define IP_VS_SO_SET_RESTORE (IP_VS_BASE_CTL+13) | ||
55 | #define IP_VS_SO_SET_SAVE (IP_VS_BASE_CTL+14) | ||
56 | #define IP_VS_SO_SET_ZERO (IP_VS_BASE_CTL+15) | ||
57 | #define IP_VS_SO_SET_MAX IP_VS_SO_SET_ZERO | ||
58 | |||
59 | #define IP_VS_SO_GET_VERSION IP_VS_BASE_CTL | ||
60 | #define IP_VS_SO_GET_INFO (IP_VS_BASE_CTL+1) | ||
61 | #define IP_VS_SO_GET_SERVICES (IP_VS_BASE_CTL+2) | ||
62 | #define IP_VS_SO_GET_SERVICE (IP_VS_BASE_CTL+3) | ||
63 | #define IP_VS_SO_GET_DESTS (IP_VS_BASE_CTL+4) | ||
64 | #define IP_VS_SO_GET_DEST (IP_VS_BASE_CTL+5) /* not used now */ | ||
65 | #define IP_VS_SO_GET_TIMEOUT (IP_VS_BASE_CTL+6) | ||
66 | #define IP_VS_SO_GET_DAEMON (IP_VS_BASE_CTL+7) | ||
67 | #define IP_VS_SO_GET_MAX IP_VS_SO_GET_DAEMON | ||
68 | |||
69 | |||
70 | /* | ||
71 | * IPVS Connection Flags | ||
72 | */ | ||
73 | #define IP_VS_CONN_F_FWD_MASK 0x0007 /* mask for the fwd methods */ | ||
74 | #define IP_VS_CONN_F_MASQ 0x0000 /* masquerading/NAT */ | ||
75 | #define IP_VS_CONN_F_LOCALNODE 0x0001 /* local node */ | ||
76 | #define IP_VS_CONN_F_TUNNEL 0x0002 /* tunneling */ | ||
77 | #define IP_VS_CONN_F_DROUTE 0x0003 /* direct routing */ | ||
78 | #define IP_VS_CONN_F_BYPASS 0x0004 /* cache bypass */ | ||
79 | #define IP_VS_CONN_F_SYNC 0x0020 /* entry created by sync */ | ||
80 | #define IP_VS_CONN_F_HASHED 0x0040 /* hashed entry */ | ||
81 | #define IP_VS_CONN_F_NOOUTPUT 0x0080 /* no output packets */ | ||
82 | #define IP_VS_CONN_F_INACTIVE 0x0100 /* not established */ | ||
83 | #define IP_VS_CONN_F_OUT_SEQ 0x0200 /* must do output seq adjust */ | ||
84 | #define IP_VS_CONN_F_IN_SEQ 0x0400 /* must do input seq adjust */ | ||
85 | #define IP_VS_CONN_F_SEQ_MASK 0x0600 /* in/out sequence mask */ | ||
86 | #define IP_VS_CONN_F_NO_CPORT 0x0800 /* no client port set yet */ | ||
87 | #define IP_VS_CONN_F_TEMPLATE 0x1000 /* template, not connection */ | ||
88 | |||
89 | #define IP_VS_SCHEDNAME_MAXLEN 16 | ||
90 | #define IP_VS_IFNAME_MAXLEN 16 | ||
91 | |||
92 | |||
93 | /* | ||
94 | * The struct ip_vs_service_user and struct ip_vs_dest_user are | ||
95 | * used to set IPVS rules through setsockopt. | ||
96 | */ | ||
97 | struct ip_vs_service_user { | ||
98 | /* virtual service addresses */ | ||
99 | u_int16_t protocol; | ||
100 | __be32 addr; /* virtual ip address */ | ||
101 | __be16 port; | ||
102 | u_int32_t fwmark; /* firwall mark of service */ | ||
103 | |||
104 | /* virtual service options */ | ||
105 | char sched_name[IP_VS_SCHEDNAME_MAXLEN]; | ||
106 | unsigned flags; /* virtual service flags */ | ||
107 | unsigned timeout; /* persistent timeout in sec */ | ||
108 | __be32 netmask; /* persistent netmask */ | ||
109 | }; | ||
110 | |||
111 | |||
112 | struct ip_vs_dest_user { | ||
113 | /* destination server address */ | ||
114 | __be32 addr; | ||
115 | __be16 port; | ||
116 | |||
117 | /* real server options */ | ||
118 | unsigned conn_flags; /* connection flags */ | ||
119 | int weight; /* destination weight */ | ||
120 | |||
121 | /* thresholds for active connections */ | ||
122 | u_int32_t u_threshold; /* upper threshold */ | ||
123 | u_int32_t l_threshold; /* lower threshold */ | ||
124 | }; | ||
125 | |||
126 | |||
127 | /* | ||
128 | * IPVS statistics object (for user space) | ||
129 | */ | ||
130 | struct ip_vs_stats_user | ||
131 | { | ||
132 | __u32 conns; /* connections scheduled */ | ||
133 | __u32 inpkts; /* incoming packets */ | ||
134 | __u32 outpkts; /* outgoing packets */ | ||
135 | __u64 inbytes; /* incoming bytes */ | ||
136 | __u64 outbytes; /* outgoing bytes */ | ||
137 | |||
138 | __u32 cps; /* current connection rate */ | ||
139 | __u32 inpps; /* current in packet rate */ | ||
140 | __u32 outpps; /* current out packet rate */ | ||
141 | __u32 inbps; /* current in byte rate */ | ||
142 | __u32 outbps; /* current out byte rate */ | ||
143 | }; | ||
144 | |||
145 | |||
146 | /* The argument to IP_VS_SO_GET_INFO */ | ||
147 | struct ip_vs_getinfo { | ||
148 | /* version number */ | ||
149 | unsigned int version; | ||
150 | |||
151 | /* size of connection hash table */ | ||
152 | unsigned int size; | ||
153 | |||
154 | /* number of virtual services */ | ||
155 | unsigned int num_services; | ||
156 | }; | ||
157 | |||
158 | |||
159 | /* The argument to IP_VS_SO_GET_SERVICE */ | ||
160 | struct ip_vs_service_entry { | ||
161 | /* which service: user fills in these */ | ||
162 | u_int16_t protocol; | ||
163 | __be32 addr; /* virtual address */ | ||
164 | __be16 port; | ||
165 | u_int32_t fwmark; /* firwall mark of service */ | ||
166 | |||
167 | /* service options */ | ||
168 | char sched_name[IP_VS_SCHEDNAME_MAXLEN]; | ||
169 | unsigned flags; /* virtual service flags */ | ||
170 | unsigned timeout; /* persistent timeout */ | ||
171 | __be32 netmask; /* persistent netmask */ | ||
172 | |||
173 | /* number of real servers */ | ||
174 | unsigned int num_dests; | ||
175 | |||
176 | /* statistics */ | ||
177 | struct ip_vs_stats_user stats; | ||
178 | }; | ||
179 | |||
180 | |||
181 | struct ip_vs_dest_entry { | ||
182 | __be32 addr; /* destination address */ | ||
183 | __be16 port; | ||
184 | unsigned conn_flags; /* connection flags */ | ||
185 | int weight; /* destination weight */ | ||
186 | |||
187 | u_int32_t u_threshold; /* upper threshold */ | ||
188 | u_int32_t l_threshold; /* lower threshold */ | ||
189 | |||
190 | u_int32_t activeconns; /* active connections */ | ||
191 | u_int32_t inactconns; /* inactive connections */ | ||
192 | u_int32_t persistconns; /* persistent connections */ | ||
193 | |||
194 | /* statistics */ | ||
195 | struct ip_vs_stats_user stats; | ||
196 | }; | ||
197 | |||
198 | |||
199 | /* The argument to IP_VS_SO_GET_DESTS */ | ||
200 | struct ip_vs_get_dests { | ||
201 | /* which service: user fills in these */ | ||
202 | u_int16_t protocol; | ||
203 | __be32 addr; /* virtual address */ | ||
204 | __be16 port; | ||
205 | u_int32_t fwmark; /* firwall mark of service */ | ||
206 | |||
207 | /* number of real servers */ | ||
208 | unsigned int num_dests; | ||
209 | |||
210 | /* the real servers */ | ||
211 | struct ip_vs_dest_entry entrytable[0]; | ||
212 | }; | ||
213 | |||
214 | |||
215 | /* The argument to IP_VS_SO_GET_SERVICES */ | ||
216 | struct ip_vs_get_services { | ||
217 | /* number of virtual services */ | ||
218 | unsigned int num_services; | ||
219 | |||
220 | /* service table */ | ||
221 | struct ip_vs_service_entry entrytable[0]; | ||
222 | }; | ||
223 | |||
224 | |||
225 | /* The argument to IP_VS_SO_GET_TIMEOUT */ | ||
226 | struct ip_vs_timeout_user { | ||
227 | int tcp_timeout; | ||
228 | int tcp_fin_timeout; | ||
229 | int udp_timeout; | ||
230 | }; | ||
231 | |||
232 | |||
233 | /* The argument to IP_VS_SO_GET_DAEMON */ | ||
234 | struct ip_vs_daemon_user { | ||
235 | /* sync daemon state (master/backup) */ | ||
236 | int state; | ||
237 | |||
238 | /* multicast interface name */ | ||
239 | char mcast_ifn[IP_VS_IFNAME_MAXLEN]; | ||
240 | |||
241 | /* SyncID we belong to */ | ||
242 | int syncid; | ||
243 | }; | ||
244 | |||
245 | #endif /* _IP_VS_H */ | ||
diff --git a/include/linux/ivtv.h b/include/linux/ivtv.h index 794b8daa9378..17ca64b5a66c 100644 --- a/include/linux/ivtv.h +++ b/include/linux/ivtv.h | |||
@@ -21,11 +21,7 @@ | |||
21 | #ifndef __LINUX_IVTV_H__ | 21 | #ifndef __LINUX_IVTV_H__ |
22 | #define __LINUX_IVTV_H__ | 22 | #define __LINUX_IVTV_H__ |
23 | 23 | ||
24 | #ifdef __KERNEL__ | 24 | #include <linux/compiler.h> |
25 | #include <linux/compiler.h> /* need __user */ | ||
26 | #else | ||
27 | #define __user | ||
28 | #endif | ||
29 | #include <linux/types.h> | 25 | #include <linux/types.h> |
30 | 26 | ||
31 | /* ivtv knows several distinct output modes: MPEG streaming, | 27 | /* ivtv knows several distinct output modes: MPEG streaming, |
diff --git a/include/linux/ivtvfb.h b/include/linux/ivtvfb.h index e980ba62ddcc..e20af47b59ad 100644 --- a/include/linux/ivtvfb.h +++ b/include/linux/ivtvfb.h | |||
@@ -21,11 +21,7 @@ | |||
21 | #ifndef __LINUX_IVTVFB_H__ | 21 | #ifndef __LINUX_IVTVFB_H__ |
22 | #define __LINUX_IVTVFB_H__ | 22 | #define __LINUX_IVTVFB_H__ |
23 | 23 | ||
24 | #ifdef __KERNEL__ | 24 | #include <linux/compiler.h> |
25 | #include <linux/compiler.h> /* need __user */ | ||
26 | #else | ||
27 | #define __user | ||
28 | #endif | ||
29 | #include <linux/types.h> | 25 | #include <linux/types.h> |
30 | 26 | ||
31 | /* Framebuffer external API */ | 27 | /* Framebuffer external API */ |
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h index 57aefa160a92..b96144887444 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h | |||
@@ -108,8 +108,7 @@ static inline void print_fn_descriptor_symbol(const char *fmt, void *addr) | |||
108 | 108 | ||
109 | static inline void print_ip_sym(unsigned long ip) | 109 | static inline void print_ip_sym(unsigned long ip) |
110 | { | 110 | { |
111 | printk("[<%p>]", (void *) ip); | 111 | printk("[<%p>] %pS\n", (void *) ip, (void *) ip); |
112 | print_symbol(" %s\n", ip); | ||
113 | } | 112 | } |
114 | 113 | ||
115 | #endif /*_LINUX_KALLSYMS_H*/ | 114 | #endif /*_LINUX_KALLSYMS_H*/ |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index fdbbf72ca2eb..2651f805ba6d 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -75,6 +75,12 @@ extern const char linux_proc_banner[]; | |||
75 | */ | 75 | */ |
76 | #define upper_32_bits(n) ((u32)(((n) >> 16) >> 16)) | 76 | #define upper_32_bits(n) ((u32)(((n) >> 16) >> 16)) |
77 | 77 | ||
78 | /** | ||
79 | * lower_32_bits - return bits 0-31 of a number | ||
80 | * @n: the number we're accessing | ||
81 | */ | ||
82 | #define lower_32_bits(n) ((u32)(n)) | ||
83 | |||
78 | #define KERN_EMERG "<0>" /* system is unusable */ | 84 | #define KERN_EMERG "<0>" /* system is unusable */ |
79 | #define KERN_ALERT "<1>" /* action must be taken immediately */ | 85 | #define KERN_ALERT "<1>" /* action must be taken immediately */ |
80 | #define KERN_CRIT "<2>" /* critical conditions */ | 86 | #define KERN_CRIT "<2>" /* critical conditions */ |
@@ -102,6 +108,13 @@ struct completion; | |||
102 | struct pt_regs; | 108 | struct pt_regs; |
103 | struct user; | 109 | struct user; |
104 | 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 | |||
105 | /** | 118 | /** |
106 | * might_sleep - annotation for functions that can sleep | 119 | * might_sleep - annotation for functions that can sleep |
107 | * | 120 | * |
@@ -112,13 +125,6 @@ struct user; | |||
112 | * 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 |
113 | * supposed to. | 126 | * supposed to. |
114 | */ | 127 | */ |
115 | #ifdef CONFIG_PREEMPT_VOLUNTARY | ||
116 | extern int _cond_resched(void); | ||
117 | # define might_resched() _cond_resched() | ||
118 | #else | ||
119 | # define might_resched() do { } while (0) | ||
120 | #endif | ||
121 | |||
122 | #ifdef CONFIG_DEBUG_SPINLOCK_SLEEP | 128 | #ifdef CONFIG_DEBUG_SPINLOCK_SLEEP |
123 | void __might_sleep(char *file, int line); | 129 | void __might_sleep(char *file, int line); |
124 | # define might_sleep() \ | 130 | # define might_sleep() \ |
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index 82f88a8a827b..17f76fc05173 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
@@ -25,8 +25,8 @@ | |||
25 | #error KEXEC_CONTROL_MEMORY_LIMIT not defined | 25 | #error KEXEC_CONTROL_MEMORY_LIMIT not defined |
26 | #endif | 26 | #endif |
27 | 27 | ||
28 | #ifndef KEXEC_CONTROL_CODE_SIZE | 28 | #ifndef KEXEC_CONTROL_PAGE_SIZE |
29 | #error KEXEC_CONTROL_CODE_SIZE not defined | 29 | #error KEXEC_CONTROL_PAGE_SIZE not defined |
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | #ifndef KEXEC_ARCH | 32 | #ifndef KEXEC_ARCH |
@@ -130,8 +130,8 @@ void vmcoreinfo_append_str(const char *fmt, ...) | |||
130 | __attribute__ ((format (printf, 1, 2))); | 130 | __attribute__ ((format (printf, 1, 2))); |
131 | unsigned long paddr_vmcoreinfo_note(void); | 131 | unsigned long paddr_vmcoreinfo_note(void); |
132 | 132 | ||
133 | #define VMCOREINFO_OSRELEASE(name) \ | 133 | #define VMCOREINFO_OSRELEASE(value) \ |
134 | vmcoreinfo_append_str("OSRELEASE=%s\n", #name) | 134 | vmcoreinfo_append_str("OSRELEASE=%s\n", value) |
135 | #define VMCOREINFO_PAGESIZE(value) \ | 135 | #define VMCOREINFO_PAGESIZE(value) \ |
136 | vmcoreinfo_append_str("PAGESIZE=%ld\n", value) | 136 | vmcoreinfo_append_str("PAGESIZE=%ld\n", value) |
137 | #define VMCOREINFO_SYMBOL(name) \ | 137 | #define VMCOREINFO_SYMBOL(name) \ |
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 0ea064cbfbc8..70a30651cd12 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -320,12 +320,12 @@ struct kvm_trace_rec { | |||
320 | struct { | 320 | struct { |
321 | __u64 cycle_u64; | 321 | __u64 cycle_u64; |
322 | __u32 extra_u32[KVM_TRC_EXTRA_MAX]; | 322 | __u32 extra_u32[KVM_TRC_EXTRA_MAX]; |
323 | } cycle; | 323 | } __attribute__((packed)) cycle; |
324 | struct { | 324 | struct { |
325 | __u32 extra_u32[KVM_TRC_EXTRA_MAX]; | 325 | __u32 extra_u32[KVM_TRC_EXTRA_MAX]; |
326 | } nocycle; | 326 | } nocycle; |
327 | } u; | 327 | } u; |
328 | } __attribute__((packed)); | 328 | }; |
329 | 329 | ||
330 | #define KVMIO 0xAE | 330 | #define KVMIO 0xAE |
331 | 331 | ||
@@ -371,6 +371,7 @@ struct kvm_trace_rec { | |||
371 | #define KVM_CAP_PV_MMU 13 | 371 | #define KVM_CAP_PV_MMU 13 |
372 | #define KVM_CAP_MP_STATE 14 | 372 | #define KVM_CAP_MP_STATE 14 |
373 | #define KVM_CAP_COALESCED_MMIO 15 | 373 | #define KVM_CAP_COALESCED_MMIO 15 |
374 | #define KVM_CAP_SYNC_MMU 16 /* Changes to host mmap are reflected in guest */ | ||
374 | 375 | ||
375 | /* | 376 | /* |
376 | * ioctls for VM fds | 377 | * ioctls for VM fds |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 07d68a8ae8e9..8525afc53107 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -121,6 +121,12 @@ struct kvm { | |||
121 | struct kvm_coalesced_mmio_dev *coalesced_mmio_dev; | 121 | struct kvm_coalesced_mmio_dev *coalesced_mmio_dev; |
122 | struct kvm_coalesced_mmio_ring *coalesced_mmio_ring; | 122 | struct kvm_coalesced_mmio_ring *coalesced_mmio_ring; |
123 | #endif | 123 | #endif |
124 | |||
125 | #ifdef KVM_ARCH_WANT_MMU_NOTIFIER | ||
126 | struct mmu_notifier mmu_notifier; | ||
127 | unsigned long mmu_notifier_seq; | ||
128 | long mmu_notifier_count; | ||
129 | #endif | ||
124 | }; | 130 | }; |
125 | 131 | ||
126 | /* The guest did something we don't support. */ | 132 | /* The guest did something we don't support. */ |
@@ -332,4 +338,22 @@ int kvm_trace_ioctl(unsigned int ioctl, unsigned long arg) | |||
332 | #define kvm_trace_cleanup() ((void)0) | 338 | #define kvm_trace_cleanup() ((void)0) |
333 | #endif | 339 | #endif |
334 | 340 | ||
341 | #ifdef KVM_ARCH_WANT_MMU_NOTIFIER | ||
342 | static inline int mmu_notifier_retry(struct kvm_vcpu *vcpu, unsigned long mmu_seq) | ||
343 | { | ||
344 | if (unlikely(vcpu->kvm->mmu_notifier_count)) | ||
345 | return 1; | ||
346 | /* | ||
347 | * Both reads happen under the mmu_lock and both values are | ||
348 | * modified under mmu_lock, so there's no need of smb_rmb() | ||
349 | * here in between, otherwise mmu_notifier_count should be | ||
350 | * read before mmu_notifier_seq, see | ||
351 | * mmu_notifier_invalidate_range_end write side. | ||
352 | */ | ||
353 | if (vcpu->kvm->mmu_notifier_seq != mmu_seq) | ||
354 | return 1; | ||
355 | return 0; | ||
356 | } | ||
357 | #endif | ||
358 | |||
335 | #endif | 359 | #endif |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 5b247b8a6b3b..225bfc5bd9ec 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -60,9 +60,9 @@ | |||
60 | 60 | ||
61 | /* note: prints function name for you */ | 61 | /* note: prints function name for you */ |
62 | #ifdef ATA_DEBUG | 62 | #ifdef ATA_DEBUG |
63 | #define DPRINTK(fmt, args...) printk(KERN_ERR "%s: " fmt, __FUNCTION__, ## args) | 63 | #define DPRINTK(fmt, args...) printk(KERN_ERR "%s: " fmt, __func__, ## args) |
64 | #ifdef ATA_VERBOSE_DEBUG | 64 | #ifdef ATA_VERBOSE_DEBUG |
65 | #define VPRINTK(fmt, args...) printk(KERN_ERR "%s: " fmt, __FUNCTION__, ## args) | 65 | #define VPRINTK(fmt, args...) printk(KERN_ERR "%s: " fmt, __func__, ## args) |
66 | #else | 66 | #else |
67 | #define VPRINTK(fmt, args...) | 67 | #define VPRINTK(fmt, args...) |
68 | #endif /* ATA_VERBOSE_DEBUG */ | 68 | #endif /* ATA_VERBOSE_DEBUG */ |
@@ -71,7 +71,7 @@ | |||
71 | #define VPRINTK(fmt, args...) | 71 | #define VPRINTK(fmt, args...) |
72 | #endif /* ATA_DEBUG */ | 72 | #endif /* ATA_DEBUG */ |
73 | 73 | ||
74 | #define BPRINTK(fmt, args...) if (ap->flags & ATA_FLAG_DEBUGMSG) printk(KERN_ERR "%s: " fmt, __FUNCTION__, ## args) | 74 | #define BPRINTK(fmt, args...) if (ap->flags & ATA_FLAG_DEBUGMSG) printk(KERN_ERR "%s: " fmt, __func__, ## args) |
75 | 75 | ||
76 | /* NEW: debug levels */ | 76 | /* NEW: debug levels */ |
77 | #define HAVE_LIBATA_MSG 1 | 77 | #define HAVE_LIBATA_MSG 1 |
@@ -163,6 +163,7 @@ enum { | |||
163 | ATA_DEV_NONE = 9, /* no device */ | 163 | ATA_DEV_NONE = 9, /* no device */ |
164 | 164 | ||
165 | /* struct ata_link flags */ | 165 | /* struct ata_link flags */ |
166 | ATA_LFLAG_NO_HRST = (1 << 1), /* avoid hardreset */ | ||
166 | ATA_LFLAG_NO_SRST = (1 << 2), /* avoid softreset */ | 167 | ATA_LFLAG_NO_SRST = (1 << 2), /* avoid softreset */ |
167 | ATA_LFLAG_ASSUME_ATA = (1 << 3), /* assume ATA class */ | 168 | ATA_LFLAG_ASSUME_ATA = (1 << 3), /* assume ATA class */ |
168 | ATA_LFLAG_ASSUME_SEMB = (1 << 4), /* assume SEMB class */ | 169 | ATA_LFLAG_ASSUME_SEMB = (1 << 4), /* assume SEMB class */ |
@@ -646,6 +647,7 @@ struct ata_link { | |||
646 | 647 | ||
647 | unsigned int flags; /* ATA_LFLAG_xxx */ | 648 | unsigned int flags; /* ATA_LFLAG_xxx */ |
648 | 649 | ||
650 | u32 saved_scontrol; /* SControl on probe */ | ||
649 | unsigned int hw_sata_spd_limit; | 651 | unsigned int hw_sata_spd_limit; |
650 | unsigned int sata_spd_limit; | 652 | unsigned int sata_spd_limit; |
651 | unsigned int sata_spd; /* current SATA PHY speed */ | 653 | unsigned int sata_spd; /* current SATA PHY speed */ |
@@ -750,6 +752,7 @@ struct ata_port_operations { | |||
750 | void (*set_piomode)(struct ata_port *ap, struct ata_device *dev); | 752 | void (*set_piomode)(struct ata_port *ap, struct ata_device *dev); |
751 | void (*set_dmamode)(struct ata_port *ap, struct ata_device *dev); | 753 | void (*set_dmamode)(struct ata_port *ap, struct ata_device *dev); |
752 | int (*set_mode)(struct ata_link *link, struct ata_device **r_failed_dev); | 754 | int (*set_mode)(struct ata_link *link, struct ata_device **r_failed_dev); |
755 | unsigned int (*read_id)(struct ata_device *dev, struct ata_taskfile *tf, u16 *id); | ||
753 | 756 | ||
754 | void (*dev_config)(struct ata_device *dev); | 757 | void (*dev_config)(struct ata_device *dev); |
755 | 758 | ||
@@ -951,6 +954,8 @@ extern void ata_id_string(const u16 *id, unsigned char *s, | |||
951 | unsigned int ofs, unsigned int len); | 954 | unsigned int ofs, unsigned int len); |
952 | extern void ata_id_c_string(const u16 *id, unsigned char *s, | 955 | extern void ata_id_c_string(const u16 *id, unsigned char *s, |
953 | unsigned int ofs, unsigned int len); | 956 | unsigned int ofs, unsigned int len); |
957 | extern unsigned int ata_do_dev_read_id(struct ata_device *dev, | ||
958 | struct ata_taskfile *tf, u16 *id); | ||
954 | extern void ata_qc_complete(struct ata_queued_cmd *qc); | 959 | extern void ata_qc_complete(struct ata_queued_cmd *qc); |
955 | extern int ata_qc_complete_multiple(struct ata_port *ap, u32 qc_active); | 960 | extern int ata_qc_complete_multiple(struct ata_port *ap, u32 qc_active); |
956 | extern void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd, | 961 | extern void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd, |
@@ -1424,6 +1429,28 @@ static inline unsigned long ata_deadline(unsigned long from_jiffies, | |||
1424 | return from_jiffies + msecs_to_jiffies(timeout_msecs); | 1429 | return from_jiffies + msecs_to_jiffies(timeout_msecs); |
1425 | } | 1430 | } |
1426 | 1431 | ||
1432 | /* Don't open code these in drivers as there are traps. Firstly the range may | ||
1433 | change in future hardware and specs, secondly 0xFF means 'no DMA' but is | ||
1434 | > UDMA_0. Dyma ddreigiau */ | ||
1435 | |||
1436 | static inline int ata_using_mwdma(struct ata_device *adev) | ||
1437 | { | ||
1438 | if (adev->dma_mode >= XFER_MW_DMA_0 && adev->dma_mode <= XFER_MW_DMA_4) | ||
1439 | return 1; | ||
1440 | return 0; | ||
1441 | } | ||
1442 | |||
1443 | static inline int ata_using_udma(struct ata_device *adev) | ||
1444 | { | ||
1445 | if (adev->dma_mode >= XFER_UDMA_0 && adev->dma_mode <= XFER_UDMA_7) | ||
1446 | return 1; | ||
1447 | return 0; | ||
1448 | } | ||
1449 | |||
1450 | static inline int ata_dma_enabled(struct ata_device *adev) | ||
1451 | { | ||
1452 | return (adev->dma_mode == 0xFF ? 0 : 1); | ||
1453 | } | ||
1427 | 1454 | ||
1428 | /************************************************************************** | 1455 | /************************************************************************** |
1429 | * PMP - drivers/ata/libata-pmp.c | 1456 | * PMP - drivers/ata/libata-pmp.c |
diff --git a/include/linux/list.h b/include/linux/list.h index 453916bc0412..969f6e92d089 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -214,22 +214,62 @@ static inline int list_is_singular(const struct list_head *head) | |||
214 | return !list_empty(head) && (head->next == head->prev); | 214 | return !list_empty(head) && (head->next == head->prev); |
215 | } | 215 | } |
216 | 216 | ||
217 | static inline void __list_cut_position(struct list_head *list, | ||
218 | struct list_head *head, struct list_head *entry) | ||
219 | { | ||
220 | struct list_head *new_first = entry->next; | ||
221 | list->next = head->next; | ||
222 | list->next->prev = list; | ||
223 | list->prev = entry; | ||
224 | entry->next = list; | ||
225 | head->next = new_first; | ||
226 | new_first->prev = head; | ||
227 | } | ||
228 | |||
229 | /** | ||
230 | * list_cut_position - cut a list into two | ||
231 | * @list: a new list to add all removed entries | ||
232 | * @head: a list with entries | ||
233 | * @entry: an entry within head, could be the head itself | ||
234 | * and if so we won't cut the list | ||
235 | * | ||
236 | * This helper moves the initial part of @head, up to and | ||
237 | * including @entry, from @head to @list. You should | ||
238 | * pass on @entry an element you know is on @head. @list | ||
239 | * should be an empty list or a list you do not care about | ||
240 | * losing its data. | ||
241 | * | ||
242 | */ | ||
243 | static inline void list_cut_position(struct list_head *list, | ||
244 | struct list_head *head, struct list_head *entry) | ||
245 | { | ||
246 | if (list_empty(head)) | ||
247 | return; | ||
248 | if (list_is_singular(head) && | ||
249 | (head->next != entry && head != entry)) | ||
250 | return; | ||
251 | if (entry == head) | ||
252 | INIT_LIST_HEAD(list); | ||
253 | else | ||
254 | __list_cut_position(list, head, entry); | ||
255 | } | ||
256 | |||
217 | static inline void __list_splice(const struct list_head *list, | 257 | static inline void __list_splice(const struct list_head *list, |
218 | struct list_head *head) | 258 | struct list_head *prev, |
259 | struct list_head *next) | ||
219 | { | 260 | { |
220 | struct list_head *first = list->next; | 261 | struct list_head *first = list->next; |
221 | struct list_head *last = list->prev; | 262 | struct list_head *last = list->prev; |
222 | struct list_head *at = head->next; | ||
223 | 263 | ||
224 | first->prev = head; | 264 | first->prev = prev; |
225 | head->next = first; | 265 | prev->next = first; |
226 | 266 | ||
227 | last->next = at; | 267 | last->next = next; |
228 | at->prev = last; | 268 | next->prev = last; |
229 | } | 269 | } |
230 | 270 | ||
231 | /** | 271 | /** |
232 | * list_splice - join two lists | 272 | * list_splice - join two lists, this is designed for stacks |
233 | * @list: the new list to add. | 273 | * @list: the new list to add. |
234 | * @head: the place to add it in the first list. | 274 | * @head: the place to add it in the first list. |
235 | */ | 275 | */ |
@@ -237,7 +277,19 @@ static inline void list_splice(const struct list_head *list, | |||
237 | struct list_head *head) | 277 | struct list_head *head) |
238 | { | 278 | { |
239 | if (!list_empty(list)) | 279 | if (!list_empty(list)) |
240 | __list_splice(list, head); | 280 | __list_splice(list, head, head->next); |
281 | } | ||
282 | |||
283 | /** | ||
284 | * list_splice_tail - join two lists, each list being a queue | ||
285 | * @list: the new list to add. | ||
286 | * @head: the place to add it in the first list. | ||
287 | */ | ||
288 | static inline void list_splice_tail(struct list_head *list, | ||
289 | struct list_head *head) | ||
290 | { | ||
291 | if (!list_empty(list)) | ||
292 | __list_splice(list, head->prev, head); | ||
241 | } | 293 | } |
242 | 294 | ||
243 | /** | 295 | /** |
@@ -251,7 +303,24 @@ static inline void list_splice_init(struct list_head *list, | |||
251 | struct list_head *head) | 303 | struct list_head *head) |
252 | { | 304 | { |
253 | if (!list_empty(list)) { | 305 | if (!list_empty(list)) { |
254 | __list_splice(list, head); | 306 | __list_splice(list, head, head->next); |
307 | INIT_LIST_HEAD(list); | ||
308 | } | ||
309 | } | ||
310 | |||
311 | /** | ||
312 | * list_splice_tail_init - join two lists and reinitialise the emptied list | ||
313 | * @list: the new list to add. | ||
314 | * @head: the place to add it in the first list. | ||
315 | * | ||
316 | * Each of the lists is a queue. | ||
317 | * The list at @list is reinitialised | ||
318 | */ | ||
319 | static inline void list_splice_tail_init(struct list_head *list, | ||
320 | struct list_head *head) | ||
321 | { | ||
322 | if (!list_empty(list)) { | ||
323 | __list_splice(list, head->prev, head); | ||
255 | INIT_LIST_HEAD(list); | 324 | INIT_LIST_HEAD(list); |
256 | } | 325 | } |
257 | } | 326 | } |
@@ -550,6 +619,19 @@ static inline void hlist_add_after(struct hlist_node *n, | |||
550 | next->next->pprev = &next->next; | 619 | next->next->pprev = &next->next; |
551 | } | 620 | } |
552 | 621 | ||
622 | /* | ||
623 | * Move a list from one list head to another. Fixup the pprev | ||
624 | * reference of the first entry if it exists. | ||
625 | */ | ||
626 | static inline void hlist_move_list(struct hlist_head *old, | ||
627 | struct hlist_head *new) | ||
628 | { | ||
629 | new->first = old->first; | ||
630 | if (new->first) | ||
631 | new->first->pprev = &new->first; | ||
632 | old->first = NULL; | ||
633 | } | ||
634 | |||
553 | #define hlist_entry(ptr, type, member) container_of(ptr,type,member) | 635 | #define hlist_entry(ptr, type, member) container_of(ptr,type,member) |
554 | 636 | ||
555 | #define hlist_for_each(pos, head) \ | 637 | #define hlist_for_each(pos, head) \ |
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index 2486eb4edbf1..331e5f1c2d8e 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h | |||
@@ -89,6 +89,7 @@ struct lock_class { | |||
89 | 89 | ||
90 | struct lockdep_subclass_key *key; | 90 | struct lockdep_subclass_key *key; |
91 | unsigned int subclass; | 91 | unsigned int subclass; |
92 | unsigned int dep_gen_id; | ||
92 | 93 | ||
93 | /* | 94 | /* |
94 | * IRQ/softirq usage tracking bits: | 95 | * IRQ/softirq usage tracking bits: |
@@ -189,6 +190,14 @@ struct lock_chain { | |||
189 | u64 chain_key; | 190 | u64 chain_key; |
190 | }; | 191 | }; |
191 | 192 | ||
193 | #define MAX_LOCKDEP_KEYS_BITS 13 | ||
194 | /* | ||
195 | * Subtract one because we offset hlock->class_idx by 1 in order | ||
196 | * to make 0 mean no class. This avoids overflowing the class_idx | ||
197 | * bitfield and hitting the BUG in hlock_class(). | ||
198 | */ | ||
199 | #define MAX_LOCKDEP_KEYS ((1UL << MAX_LOCKDEP_KEYS_BITS) - 1) | ||
200 | |||
192 | struct held_lock { | 201 | struct held_lock { |
193 | /* | 202 | /* |
194 | * One-way hash of the dependency chain up to this point. We | 203 | * One-way hash of the dependency chain up to this point. We |
@@ -205,14 +214,14 @@ struct held_lock { | |||
205 | * with zero), here we store the previous hash value: | 214 | * with zero), here we store the previous hash value: |
206 | */ | 215 | */ |
207 | u64 prev_chain_key; | 216 | u64 prev_chain_key; |
208 | struct lock_class *class; | ||
209 | unsigned long acquire_ip; | 217 | unsigned long acquire_ip; |
210 | struct lockdep_map *instance; | 218 | struct lockdep_map *instance; |
211 | 219 | struct lockdep_map *nest_lock; | |
212 | #ifdef CONFIG_LOCK_STAT | 220 | #ifdef CONFIG_LOCK_STAT |
213 | u64 waittime_stamp; | 221 | u64 waittime_stamp; |
214 | u64 holdtime_stamp; | 222 | u64 holdtime_stamp; |
215 | #endif | 223 | #endif |
224 | unsigned int class_idx:MAX_LOCKDEP_KEYS_BITS; | ||
216 | /* | 225 | /* |
217 | * The lock-stack is unified in that the lock chains of interrupt | 226 | * The lock-stack is unified in that the lock chains of interrupt |
218 | * contexts nest ontop of process context chains, but we 'separate' | 227 | * contexts nest ontop of process context chains, but we 'separate' |
@@ -226,11 +235,11 @@ struct held_lock { | |||
226 | * The following field is used to detect when we cross into an | 235 | * The following field is used to detect when we cross into an |
227 | * interrupt context: | 236 | * interrupt context: |
228 | */ | 237 | */ |
229 | int irq_context; | 238 | unsigned int irq_context:2; /* bit 0 - soft, bit 1 - hard */ |
230 | int trylock; | 239 | unsigned int trylock:1; |
231 | int read; | 240 | unsigned int read:2; /* see lock_acquire() comment */ |
232 | int check; | 241 | unsigned int check:2; /* see lock_acquire() comment */ |
233 | int hardirqs_off; | 242 | unsigned int hardirqs_off:1; |
234 | }; | 243 | }; |
235 | 244 | ||
236 | /* | 245 | /* |
@@ -294,11 +303,15 @@ extern void lockdep_init_map(struct lockdep_map *lock, const char *name, | |||
294 | * 2: full validation | 303 | * 2: full validation |
295 | */ | 304 | */ |
296 | extern void lock_acquire(struct lockdep_map *lock, unsigned int subclass, | 305 | extern void lock_acquire(struct lockdep_map *lock, unsigned int subclass, |
297 | int trylock, int read, int check, unsigned long ip); | 306 | int trylock, int read, int check, |
307 | struct lockdep_map *nest_lock, unsigned long ip); | ||
298 | 308 | ||
299 | extern void lock_release(struct lockdep_map *lock, int nested, | 309 | extern void lock_release(struct lockdep_map *lock, int nested, |
300 | unsigned long ip); | 310 | unsigned long ip); |
301 | 311 | ||
312 | extern void lock_set_subclass(struct lockdep_map *lock, unsigned int subclass, | ||
313 | unsigned long ip); | ||
314 | |||
302 | # define INIT_LOCKDEP .lockdep_recursion = 0, | 315 | # define INIT_LOCKDEP .lockdep_recursion = 0, |
303 | 316 | ||
304 | #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) | 317 | #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) |
@@ -313,8 +326,9 @@ static inline void lockdep_on(void) | |||
313 | { | 326 | { |
314 | } | 327 | } |
315 | 328 | ||
316 | # define lock_acquire(l, s, t, r, c, i) do { } while (0) | 329 | # define lock_acquire(l, s, t, r, c, n, i) do { } while (0) |
317 | # define lock_release(l, n, i) do { } while (0) | 330 | # define lock_release(l, n, i) do { } while (0) |
331 | # define lock_set_subclass(l, s, i) do { } while (0) | ||
318 | # define lockdep_init() do { } while (0) | 332 | # define lockdep_init() do { } while (0) |
319 | # define lockdep_info() do { } while (0) | 333 | # define lockdep_info() do { } while (0) |
320 | # define lockdep_init_map(lock, name, key, sub) do { (void)(key); } while (0) | 334 | # define lockdep_init_map(lock, name, key, sub) do { (void)(key); } while (0) |
@@ -400,9 +414,11 @@ static inline void print_irqtrace_events(struct task_struct *curr) | |||
400 | 414 | ||
401 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 415 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
402 | # ifdef CONFIG_PROVE_LOCKING | 416 | # ifdef CONFIG_PROVE_LOCKING |
403 | # define spin_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, i) | 417 | # define spin_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, NULL, i) |
418 | # define spin_acquire_nest(l, s, t, n, i) lock_acquire(l, s, t, 0, 2, n, i) | ||
404 | # else | 419 | # else |
405 | # define spin_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, i) | 420 | # define spin_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, NULL, i) |
421 | # define spin_acquire_nest(l, s, t, n, i) lock_acquire(l, s, t, 0, 1, NULL, i) | ||
406 | # endif | 422 | # endif |
407 | # define spin_release(l, n, i) lock_release(l, n, i) | 423 | # define spin_release(l, n, i) lock_release(l, n, i) |
408 | #else | 424 | #else |
@@ -412,11 +428,11 @@ static inline void print_irqtrace_events(struct task_struct *curr) | |||
412 | 428 | ||
413 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 429 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
414 | # ifdef CONFIG_PROVE_LOCKING | 430 | # ifdef CONFIG_PROVE_LOCKING |
415 | # define rwlock_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, i) | 431 | # define rwlock_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, NULL, i) |
416 | # define rwlock_acquire_read(l, s, t, i) lock_acquire(l, s, t, 2, 2, i) | 432 | # define rwlock_acquire_read(l, s, t, i) lock_acquire(l, s, t, 2, 2, NULL, i) |
417 | # else | 433 | # else |
418 | # define rwlock_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, i) | 434 | # define rwlock_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, NULL, i) |
419 | # define rwlock_acquire_read(l, s, t, i) lock_acquire(l, s, t, 2, 1, i) | 435 | # define rwlock_acquire_read(l, s, t, i) lock_acquire(l, s, t, 2, 1, NULL, i) |
420 | # endif | 436 | # endif |
421 | # define rwlock_release(l, n, i) lock_release(l, n, i) | 437 | # define rwlock_release(l, n, i) lock_release(l, n, i) |
422 | #else | 438 | #else |
@@ -427,9 +443,9 @@ static inline void print_irqtrace_events(struct task_struct *curr) | |||
427 | 443 | ||
428 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 444 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
429 | # ifdef CONFIG_PROVE_LOCKING | 445 | # ifdef CONFIG_PROVE_LOCKING |
430 | # define mutex_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, i) | 446 | # define mutex_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, NULL, i) |
431 | # else | 447 | # else |
432 | # define mutex_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, i) | 448 | # define mutex_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, NULL, i) |
433 | # endif | 449 | # endif |
434 | # define mutex_release(l, n, i) lock_release(l, n, i) | 450 | # define mutex_release(l, n, i) lock_release(l, n, i) |
435 | #else | 451 | #else |
@@ -439,11 +455,11 @@ static inline void print_irqtrace_events(struct task_struct *curr) | |||
439 | 455 | ||
440 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 456 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
441 | # ifdef CONFIG_PROVE_LOCKING | 457 | # ifdef CONFIG_PROVE_LOCKING |
442 | # define rwsem_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, i) | 458 | # define rwsem_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, NULL, i) |
443 | # define rwsem_acquire_read(l, s, t, i) lock_acquire(l, s, t, 1, 2, i) | 459 | # define rwsem_acquire_read(l, s, t, i) lock_acquire(l, s, t, 1, 2, NULL, i) |
444 | # else | 460 | # else |
445 | # define rwsem_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, i) | 461 | # define rwsem_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, NULL, i) |
446 | # define rwsem_acquire_read(l, s, t, i) lock_acquire(l, s, t, 1, 1, i) | 462 | # define rwsem_acquire_read(l, s, t, i) lock_acquire(l, s, t, 1, 1, NULL, i) |
447 | # endif | 463 | # endif |
448 | # define rwsem_release(l, n, i) lock_release(l, n, i) | 464 | # define rwsem_release(l, n, i) lock_release(l, n, i) |
449 | #else | 465 | #else |
@@ -452,4 +468,16 @@ static inline void print_irqtrace_events(struct task_struct *curr) | |||
452 | # define rwsem_release(l, n, i) do { } while (0) | 468 | # define rwsem_release(l, n, i) do { } while (0) |
453 | #endif | 469 | #endif |
454 | 470 | ||
471 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
472 | # ifdef CONFIG_PROVE_LOCKING | ||
473 | # define lock_map_acquire(l) lock_acquire(l, 0, 0, 0, 2, NULL, _THIS_IP_) | ||
474 | # else | ||
475 | # define lock_map_acquire(l) lock_acquire(l, 0, 0, 0, 1, NULL, _THIS_IP_) | ||
476 | # endif | ||
477 | # define lock_map_release(l) lock_release(l, 1, _THIS_IP_) | ||
478 | #else | ||
479 | # define lock_map_acquire(l) do { } while (0) | ||
480 | # define lock_map_release(l) do { } while (0) | ||
481 | #endif | ||
482 | |||
455 | #endif /* __LINUX_LOCKDEP_H */ | 483 | #endif /* __LINUX_LOCKDEP_H */ |
diff --git a/include/linux/mISDNif.h b/include/linux/mISDNif.h index 5c948f337817..8f2d60da04e7 100644 --- a/include/linux/mISDNif.h +++ b/include/linux/mISDNif.h | |||
@@ -37,7 +37,7 @@ | |||
37 | */ | 37 | */ |
38 | #define MISDN_MAJOR_VERSION 1 | 38 | #define MISDN_MAJOR_VERSION 1 |
39 | #define MISDN_MINOR_VERSION 0 | 39 | #define MISDN_MINOR_VERSION 0 |
40 | #define MISDN_RELEASE 18 | 40 | #define MISDN_RELEASE 19 |
41 | 41 | ||
42 | /* primitives for information exchange | 42 | /* primitives for information exchange |
43 | * generell format | 43 | * generell format |
@@ -242,7 +242,8 @@ struct mISDNhead { | |||
242 | #define TEI_SAPI 63 | 242 | #define TEI_SAPI 63 |
243 | #define CTRL_SAPI 0 | 243 | #define CTRL_SAPI 0 |
244 | 244 | ||
245 | #define MISDN_CHMAP_SIZE 4 | 245 | #define MISDN_MAX_CHANNEL 127 |
246 | #define MISDN_CHMAP_SIZE ((MISDN_MAX_CHANNEL + 1) >> 3) | ||
246 | 247 | ||
247 | #define SOL_MISDN 0 | 248 | #define SOL_MISDN 0 |
248 | 249 | ||
@@ -275,11 +276,32 @@ struct mISDN_devinfo { | |||
275 | u_int Dprotocols; | 276 | u_int Dprotocols; |
276 | u_int Bprotocols; | 277 | u_int Bprotocols; |
277 | u_int protocol; | 278 | u_int protocol; |
278 | u_long channelmap[MISDN_CHMAP_SIZE]; | 279 | u_char channelmap[MISDN_CHMAP_SIZE]; |
279 | u_int nrbchan; | 280 | u_int nrbchan; |
280 | char name[MISDN_MAX_IDLEN]; | 281 | char name[MISDN_MAX_IDLEN]; |
281 | }; | 282 | }; |
282 | 283 | ||
284 | static inline int | ||
285 | test_channelmap(u_int nr, u_char *map) | ||
286 | { | ||
287 | if (nr <= MISDN_MAX_CHANNEL) | ||
288 | return map[nr >> 3] & (1 << (nr & 7)); | ||
289 | else | ||
290 | return 0; | ||
291 | } | ||
292 | |||
293 | static inline void | ||
294 | set_channelmap(u_int nr, u_char *map) | ||
295 | { | ||
296 | map[nr >> 3] |= (1 << (nr & 7)); | ||
297 | } | ||
298 | |||
299 | static inline void | ||
300 | clear_channelmap(u_int nr, u_char *map) | ||
301 | { | ||
302 | map[nr >> 3] &= ~(1 << (nr & 7)); | ||
303 | } | ||
304 | |||
283 | /* CONTROL_CHANNEL parameters */ | 305 | /* CONTROL_CHANNEL parameters */ |
284 | #define MISDN_CTRL_GETOP 0x0000 | 306 | #define MISDN_CTRL_GETOP 0x0000 |
285 | #define MISDN_CTRL_LOOP 0x0001 | 307 | #define MISDN_CTRL_LOOP 0x0001 |
@@ -405,7 +427,7 @@ struct mISDNdevice { | |||
405 | u_int Dprotocols; | 427 | u_int Dprotocols; |
406 | u_int Bprotocols; | 428 | u_int Bprotocols; |
407 | u_int nrbchan; | 429 | u_int nrbchan; |
408 | u_long channelmap[MISDN_CHMAP_SIZE]; | 430 | u_char channelmap[MISDN_CHMAP_SIZE]; |
409 | struct list_head bchannels; | 431 | struct list_head bchannels; |
410 | struct mISDNchannel *teimgr; | 432 | struct mISDNchannel *teimgr; |
411 | struct device dev; | 433 | struct device dev; |
@@ -430,7 +452,7 @@ struct mISDNstack { | |||
430 | #endif | 452 | #endif |
431 | }; | 453 | }; |
432 | 454 | ||
433 | /* global alloc/queue dunctions */ | 455 | /* global alloc/queue functions */ |
434 | 456 | ||
435 | static inline struct sk_buff * | 457 | static inline struct sk_buff * |
436 | mI_alloc_skb(unsigned int len, gfp_t gfp_mask) | 458 | mI_alloc_skb(unsigned int len, gfp_t gfp_mask) |
diff --git a/include/linux/maple.h b/include/linux/maple.h index 523a286bb477..c23d3f51ba40 100644 --- a/include/linux/maple.h +++ b/include/linux/maple.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define __LINUX_MAPLE_H | 2 | #define __LINUX_MAPLE_H |
3 | 3 | ||
4 | #include <linux/device.h> | 4 | #include <linux/device.h> |
5 | #include <mach/maple.h> | ||
5 | 6 | ||
6 | extern struct bus_type maple_bus_type; | 7 | extern struct bus_type maple_bus_type; |
7 | 8 | ||
@@ -33,6 +34,7 @@ struct mapleq { | |||
33 | void *sendbuf, *recvbuf, *recvbufdcsp; | 34 | void *sendbuf, *recvbuf, *recvbufdcsp; |
34 | unsigned char length; | 35 | unsigned char length; |
35 | enum maple_code command; | 36 | enum maple_code command; |
37 | struct mutex mutex; | ||
36 | }; | 38 | }; |
37 | 39 | ||
38 | struct maple_devinfo { | 40 | struct maple_devinfo { |
@@ -49,7 +51,6 @@ struct maple_devinfo { | |||
49 | struct maple_device { | 51 | struct maple_device { |
50 | struct maple_driver *driver; | 52 | struct maple_driver *driver; |
51 | struct mapleq *mq; | 53 | struct mapleq *mq; |
52 | void *private_data; | ||
53 | void (*callback) (struct mapleq * mq); | 54 | void (*callback) (struct mapleq * mq); |
54 | unsigned long when, interval, function; | 55 | unsigned long when, interval, function; |
55 | struct maple_devinfo devinfo; | 56 | struct maple_devinfo devinfo; |
@@ -68,10 +69,17 @@ void maple_getcond_callback(struct maple_device *dev, | |||
68 | void (*callback) (struct mapleq * mq), | 69 | void (*callback) (struct mapleq * mq), |
69 | unsigned long interval, | 70 | unsigned long interval, |
70 | unsigned long function); | 71 | unsigned long function); |
71 | int maple_driver_register(struct device_driver *drv); | 72 | int maple_driver_register(struct maple_driver *); |
72 | void maple_add_packet(struct mapleq *mq); | 73 | void maple_driver_unregister(struct maple_driver *); |
74 | |||
75 | int maple_add_packet_sleeps(struct maple_device *mdev, u32 function, | ||
76 | u32 command, u32 length, void *data); | ||
77 | void maple_clear_dev(struct maple_device *mdev); | ||
73 | 78 | ||
74 | #define to_maple_dev(n) container_of(n, struct maple_device, dev) | 79 | #define to_maple_dev(n) container_of(n, struct maple_device, dev) |
75 | #define to_maple_driver(n) container_of(n, struct maple_driver, drv) | 80 | #define to_maple_driver(n) container_of(n, struct maple_driver, drv) |
76 | 81 | ||
82 | #define maple_get_drvdata(d) dev_get_drvdata(&(d)->dev) | ||
83 | #define maple_set_drvdata(d,p) dev_set_drvdata(&(d)->dev, (p)) | ||
84 | |||
77 | #endif /* __LINUX_MAPLE_H */ | 85 | #endif /* __LINUX_MAPLE_H */ |
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/mlx4/cq.h b/include/linux/mlx4/cq.h index 071cf96cf01f..6f65b2c8bb89 100644 --- a/include/linux/mlx4/cq.h +++ b/include/linux/mlx4/cq.h | |||
@@ -39,17 +39,18 @@ | |||
39 | #include <linux/mlx4/doorbell.h> | 39 | #include <linux/mlx4/doorbell.h> |
40 | 40 | ||
41 | struct mlx4_cqe { | 41 | struct mlx4_cqe { |
42 | __be32 my_qpn; | 42 | __be32 vlan_my_qpn; |
43 | __be32 immed_rss_invalid; | 43 | __be32 immed_rss_invalid; |
44 | __be32 g_mlpath_rqpn; | 44 | __be32 g_mlpath_rqpn; |
45 | u8 sl; | 45 | __be16 sl_vid; |
46 | u8 reserved1; | ||
47 | __be16 rlid; | 46 | __be16 rlid; |
48 | __be32 ipoib_status; | 47 | __be16 status; |
48 | u8 ipv6_ext_mask; | ||
49 | u8 badfcs_enc; | ||
49 | __be32 byte_cnt; | 50 | __be32 byte_cnt; |
50 | __be16 wqe_index; | 51 | __be16 wqe_index; |
51 | __be16 checksum; | 52 | __be16 checksum; |
52 | u8 reserved2[3]; | 53 | u8 reserved[3]; |
53 | u8 owner_sr_opcode; | 54 | u8 owner_sr_opcode; |
54 | }; | 55 | }; |
55 | 56 | ||
@@ -64,6 +65,11 @@ struct mlx4_err_cqe { | |||
64 | }; | 65 | }; |
65 | 66 | ||
66 | enum { | 67 | enum { |
68 | MLX4_CQE_VLAN_PRESENT_MASK = 1 << 29, | ||
69 | MLX4_CQE_QPN_MASK = 0xffffff, | ||
70 | }; | ||
71 | |||
72 | enum { | ||
67 | MLX4_CQE_OWNER_MASK = 0x80, | 73 | MLX4_CQE_OWNER_MASK = 0x80, |
68 | MLX4_CQE_IS_SEND_MASK = 0x40, | 74 | MLX4_CQE_IS_SEND_MASK = 0x40, |
69 | MLX4_CQE_OPCODE_MASK = 0x1f | 75 | MLX4_CQE_OPCODE_MASK = 0x1f |
@@ -86,13 +92,19 @@ enum { | |||
86 | }; | 92 | }; |
87 | 93 | ||
88 | enum { | 94 | enum { |
89 | MLX4_CQE_IPOIB_STATUS_IPV4 = 1 << 22, | 95 | MLX4_CQE_STATUS_IPV4 = 1 << 6, |
90 | MLX4_CQE_IPOIB_STATUS_IPV4F = 1 << 23, | 96 | MLX4_CQE_STATUS_IPV4F = 1 << 7, |
91 | MLX4_CQE_IPOIB_STATUS_IPV6 = 1 << 24, | 97 | MLX4_CQE_STATUS_IPV6 = 1 << 8, |
92 | MLX4_CQE_IPOIB_STATUS_IPV4OPT = 1 << 25, | 98 | MLX4_CQE_STATUS_IPV4OPT = 1 << 9, |
93 | MLX4_CQE_IPOIB_STATUS_TCP = 1 << 26, | 99 | MLX4_CQE_STATUS_TCP = 1 << 10, |
94 | MLX4_CQE_IPOIB_STATUS_UDP = 1 << 27, | 100 | MLX4_CQE_STATUS_UDP = 1 << 11, |
95 | MLX4_CQE_IPOIB_STATUS_IPOK = 1 << 28, | 101 | MLX4_CQE_STATUS_IPOK = 1 << 12, |
102 | }; | ||
103 | |||
104 | enum { | ||
105 | MLX4_CQE_LLC = 1, | ||
106 | MLX4_CQE_SNAP = 1 << 1, | ||
107 | MLX4_CQE_BAD_FCS = 1 << 4, | ||
96 | }; | 108 | }; |
97 | 109 | ||
98 | static inline void mlx4_cq_arm(struct mlx4_cq *cq, u32 cmd, | 110 | static inline void mlx4_cq_arm(struct mlx4_cq *cq, u32 cmd, |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 866a3dbe5c75..72a15dc26bbf 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -73,7 +73,7 @@ extern unsigned int kobjsize(const void *objp); | |||
73 | #endif | 73 | #endif |
74 | 74 | ||
75 | /* | 75 | /* |
76 | * vm_flags.. | 76 | * vm_flags in vm_area_struct, see mm_types.h. |
77 | */ | 77 | */ |
78 | #define VM_READ 0x00000001 /* currently active flags */ | 78 | #define VM_READ 0x00000001 /* currently active flags */ |
79 | #define VM_WRITE 0x00000002 | 79 | #define VM_WRITE 0x00000002 |
@@ -744,6 +744,8 @@ struct zap_details { | |||
744 | struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, | 744 | struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, |
745 | pte_t pte); | 745 | pte_t pte); |
746 | 746 | ||
747 | int zap_vma_ptes(struct vm_area_struct *vma, unsigned long address, | ||
748 | unsigned long size); | ||
747 | unsigned long zap_page_range(struct vm_area_struct *vma, unsigned long address, | 749 | unsigned long zap_page_range(struct vm_area_struct *vma, unsigned long address, |
748 | unsigned long size, struct zap_details *); | 750 | unsigned long size, struct zap_details *); |
749 | unsigned long unmap_vmas(struct mmu_gather **tlb, | 751 | unsigned long unmap_vmas(struct mmu_gather **tlb, |
@@ -832,7 +834,6 @@ extern int mprotect_fixup(struct vm_area_struct *vma, | |||
832 | struct vm_area_struct **pprev, unsigned long start, | 834 | struct vm_area_struct **pprev, unsigned long start, |
833 | unsigned long end, unsigned long newflags); | 835 | unsigned long end, unsigned long newflags); |
834 | 836 | ||
835 | #ifdef CONFIG_HAVE_GET_USER_PAGES_FAST | ||
836 | /* | 837 | /* |
837 | * get_user_pages_fast provides equivalent functionality to get_user_pages, | 838 | * get_user_pages_fast provides equivalent functionality to get_user_pages, |
838 | * 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). |
@@ -846,25 +847,6 @@ extern int mprotect_fixup(struct vm_area_struct *vma, | |||
846 | 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, |
847 | struct page **pages); | 848 | struct page **pages); |
848 | 849 | ||
849 | #else | ||
850 | /* | ||
851 | * Should probably be moved to asm-generic, and architectures can include it if | ||
852 | * they don't implement their own get_user_pages_fast. | ||
853 | */ | ||
854 | #define get_user_pages_fast(start, nr_pages, write, pages) \ | ||
855 | ({ \ | ||
856 | struct mm_struct *mm = current->mm; \ | ||
857 | int ret; \ | ||
858 | \ | ||
859 | down_read(&mm->mmap_sem); \ | ||
860 | ret = get_user_pages(current, mm, start, nr_pages, \ | ||
861 | write, 0, pages, NULL); \ | ||
862 | up_read(&mm->mmap_sem); \ | ||
863 | \ | ||
864 | ret; \ | ||
865 | }) | ||
866 | #endif | ||
867 | |||
868 | /* | 850 | /* |
869 | * A callback you can register to apply pressure to ageable caches. | 851 | * A callback you can register to apply pressure to ageable caches. |
870 | * | 852 | * |
@@ -1041,7 +1023,6 @@ extern unsigned long absent_pages_in_range(unsigned long start_pfn, | |||
1041 | extern void get_pfn_range_for_nid(unsigned int nid, | 1023 | extern void get_pfn_range_for_nid(unsigned int nid, |
1042 | unsigned long *start_pfn, unsigned long *end_pfn); | 1024 | unsigned long *start_pfn, unsigned long *end_pfn); |
1043 | extern unsigned long find_min_pfn_with_active_regions(void); | 1025 | extern unsigned long find_min_pfn_with_active_regions(void); |
1044 | extern unsigned long find_max_pfn_with_active_regions(void); | ||
1045 | extern void free_bootmem_with_active_regions(int nid, | 1026 | extern void free_bootmem_with_active_regions(int nid, |
1046 | unsigned long max_low_pfn); | 1027 | unsigned long max_low_pfn); |
1047 | typedef int (*work_fn_t)(unsigned long, unsigned long, void *); | 1028 | typedef int (*work_fn_t)(unsigned long, unsigned long, void *); |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 386edbe2cb4e..bf334138c7c1 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -113,7 +113,7 @@ struct vm_area_struct { | |||
113 | struct vm_area_struct *vm_next; | 113 | struct vm_area_struct *vm_next; |
114 | 114 | ||
115 | pgprot_t vm_page_prot; /* Access permissions of this VMA. */ | 115 | pgprot_t vm_page_prot; /* Access permissions of this VMA. */ |
116 | unsigned long vm_flags; /* Flags, listed below. */ | 116 | unsigned long vm_flags; /* Flags, see mm.h. */ |
117 | 117 | ||
118 | struct rb_node vm_rb; | 118 | struct rb_node vm_rb; |
119 | 119 | ||
diff --git a/include/linux/mount.h b/include/linux/mount.h index b5efaa2132ab..30a1d63b6fb5 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h | |||
@@ -105,7 +105,8 @@ extern struct vfsmount *vfs_kern_mount(struct file_system_type *type, | |||
105 | 105 | ||
106 | struct nameidata; | 106 | struct nameidata; |
107 | 107 | ||
108 | extern int do_add_mount(struct vfsmount *newmnt, struct nameidata *nd, | 108 | struct path; |
109 | extern int do_add_mount(struct vfsmount *newmnt, struct path *path, | ||
109 | int mnt_flags, struct list_head *fslist); | 110 | int mnt_flags, struct list_head *fslist); |
110 | 111 | ||
111 | extern void mark_mounts_for_expiry(struct list_head *mounts); | 112 | extern void mark_mounts_for_expiry(struct list_head *mounts); |
diff --git a/include/linux/mroute.h b/include/linux/mroute.h index 07112ee9293a..8a455694d682 100644 --- a/include/linux/mroute.h +++ b/include/linux/mroute.h | |||
@@ -6,7 +6,6 @@ | |||
6 | #ifdef __KERNEL__ | 6 | #ifdef __KERNEL__ |
7 | #include <linux/in.h> | 7 | #include <linux/in.h> |
8 | #endif | 8 | #endif |
9 | #include <linux/pim.h> | ||
10 | 9 | ||
11 | /* | 10 | /* |
12 | * Based on the MROUTING 3.5 defines primarily to keep | 11 | * Based on the MROUTING 3.5 defines primarily to keep |
@@ -130,6 +129,7 @@ struct igmpmsg | |||
130 | */ | 129 | */ |
131 | 130 | ||
132 | #ifdef __KERNEL__ | 131 | #ifdef __KERNEL__ |
132 | #include <linux/pim.h> | ||
133 | #include <net/sock.h> | 133 | #include <net/sock.h> |
134 | 134 | ||
135 | #ifdef CONFIG_IP_MROUTE | 135 | #ifdef CONFIG_IP_MROUTE |
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h index 5cf50473a10f..6f4c180179e2 100644 --- a/include/linux/mroute6.h +++ b/include/linux/mroute6.h | |||
@@ -115,6 +115,7 @@ struct sioc_mif_req6 | |||
115 | 115 | ||
116 | #ifdef __KERNEL__ | 116 | #ifdef __KERNEL__ |
117 | 117 | ||
118 | #include <linux/pim.h> | ||
118 | #include <linux/skbuff.h> /* for struct sk_buff_head */ | 119 | #include <linux/skbuff.h> /* for struct sk_buff_head */ |
119 | 120 | ||
120 | #ifdef CONFIG_IPV6_MROUTE | 121 | #ifdef CONFIG_IPV6_MROUTE |
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 4ed40caff4e5..922636548558 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
@@ -272,7 +272,11 @@ static inline void mtd_erase_callback(struct erase_info *instr) | |||
272 | printk(KERN_INFO args); \ | 272 | printk(KERN_INFO args); \ |
273 | } while(0) | 273 | } while(0) |
274 | #else /* CONFIG_MTD_DEBUG */ | 274 | #else /* CONFIG_MTD_DEBUG */ |
275 | #define DEBUG(n, args...) do { } while(0) | 275 | #define DEBUG(n, args...) \ |
276 | do { \ | ||
277 | if (0) \ | ||
278 | printk(KERN_INFO args); \ | ||
279 | } while(0) | ||
276 | 280 | ||
277 | #endif /* CONFIG_MTD_DEBUG */ | 281 | #endif /* CONFIG_MTD_DEBUG */ |
278 | 282 | ||
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 83f678702dff..81774e5facf4 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -177,7 +177,9 @@ typedef enum { | |||
177 | #define NAND_MUST_PAD(chip) (!(chip->options & NAND_NO_PADDING)) | 177 | #define NAND_MUST_PAD(chip) (!(chip->options & NAND_NO_PADDING)) |
178 | #define NAND_HAS_CACHEPROG(chip) ((chip->options & NAND_CACHEPRG)) | 178 | #define NAND_HAS_CACHEPROG(chip) ((chip->options & NAND_CACHEPRG)) |
179 | #define NAND_HAS_COPYBACK(chip) ((chip->options & NAND_COPYBACK)) | 179 | #define NAND_HAS_COPYBACK(chip) ((chip->options & NAND_COPYBACK)) |
180 | #define NAND_SUBPAGE_READ(chip) ((chip->ecc.mode == NAND_ECC_SOFT)) | 180 | /* Large page NAND with SOFT_ECC should support subpage reads */ |
181 | #define NAND_SUBPAGE_READ(chip) ((chip->ecc.mode == NAND_ECC_SOFT) \ | ||
182 | && (chip->page_shift > 9)) | ||
181 | 183 | ||
182 | /* Mask to zero out the chip options, which come from the id table */ | 184 | /* Mask to zero out the chip options, which come from the id table */ |
183 | #define NAND_CHIPOPTIONS_MSK (0x0000ffff & ~NAND_NO_AUTOINCR) | 185 | #define NAND_CHIPOPTIONS_MSK (0x0000ffff & ~NAND_NO_AUTOINCR) |
diff --git a/include/linux/net.h b/include/linux/net.h index 4a9a30f2d68f..6dc14a240042 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -18,16 +18,9 @@ | |||
18 | #ifndef _LINUX_NET_H | 18 | #ifndef _LINUX_NET_H |
19 | #define _LINUX_NET_H | 19 | #define _LINUX_NET_H |
20 | 20 | ||
21 | #include <linux/wait.h> | ||
22 | #include <linux/socket.h> | 21 | #include <linux/socket.h> |
23 | #include <linux/fcntl.h> /* For O_CLOEXEC and O_NONBLOCK */ | ||
24 | #include <asm/socket.h> | 22 | #include <asm/socket.h> |
25 | 23 | ||
26 | struct poll_table_struct; | ||
27 | struct pipe_inode_info; | ||
28 | struct inode; | ||
29 | struct net; | ||
30 | |||
31 | #define NPROTO AF_MAX | 24 | #define NPROTO AF_MAX |
32 | 25 | ||
33 | #define SYS_SOCKET 1 /* sys_socket(2) */ | 26 | #define SYS_SOCKET 1 /* sys_socket(2) */ |
@@ -62,6 +55,13 @@ typedef enum { | |||
62 | #ifdef __KERNEL__ | 55 | #ifdef __KERNEL__ |
63 | #include <linux/stringify.h> | 56 | #include <linux/stringify.h> |
64 | #include <linux/random.h> | 57 | #include <linux/random.h> |
58 | #include <linux/wait.h> | ||
59 | #include <linux/fcntl.h> /* For O_CLOEXEC and O_NONBLOCK */ | ||
60 | |||
61 | struct poll_table_struct; | ||
62 | struct pipe_inode_info; | ||
63 | struct inode; | ||
64 | struct net; | ||
65 | 65 | ||
66 | #define SOCK_ASYNC_NOSPACE 0 | 66 | #define SOCK_ASYNC_NOSPACE 0 |
67 | #define SOCK_ASYNC_WAITDATA 1 | 67 | #define SOCK_ASYNC_WAITDATA 1 |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index b4d056ceab96..488c56e649b5 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -61,9 +61,7 @@ struct wireless_dev; | |||
61 | #define NET_XMIT_DROP 1 /* skb dropped */ | 61 | #define NET_XMIT_DROP 1 /* skb dropped */ |
62 | #define NET_XMIT_CN 2 /* congestion notification */ | 62 | #define NET_XMIT_CN 2 /* congestion notification */ |
63 | #define NET_XMIT_POLICED 3 /* skb is shot by police */ | 63 | #define NET_XMIT_POLICED 3 /* skb is shot by police */ |
64 | #define NET_XMIT_BYPASS 4 /* packet does not leave via dequeue; | 64 | #define NET_XMIT_MASK 0xFFFF /* qdisc flags in net/sch_generic.h */ |
65 | (TC use only - dev_queue_xmit | ||
66 | returns this as NET_XMIT_SUCCESS) */ | ||
67 | 65 | ||
68 | /* Backlog congestion levels */ | 66 | /* Backlog congestion levels */ |
69 | #define NET_RX_SUCCESS 0 /* keep 'em coming, baby */ | 67 | #define NET_RX_SUCCESS 0 /* keep 'em coming, baby */ |
@@ -440,6 +438,7 @@ static inline void napi_synchronize(const struct napi_struct *n) | |||
440 | enum netdev_queue_state_t | 438 | enum netdev_queue_state_t |
441 | { | 439 | { |
442 | __QUEUE_STATE_XOFF, | 440 | __QUEUE_STATE_XOFF, |
441 | __QUEUE_STATE_FROZEN, | ||
443 | }; | 442 | }; |
444 | 443 | ||
445 | struct netdev_queue { | 444 | struct netdev_queue { |
@@ -636,7 +635,7 @@ struct net_device | |||
636 | unsigned int real_num_tx_queues; | 635 | unsigned int real_num_tx_queues; |
637 | 636 | ||
638 | unsigned long tx_queue_len; /* Max frames per queue allowed */ | 637 | unsigned long tx_queue_len; /* Max frames per queue allowed */ |
639 | 638 | spinlock_t tx_global_lock; | |
640 | /* | 639 | /* |
641 | * One part is mostly used on xmit path (device) | 640 | * One part is mostly used on xmit path (device) |
642 | */ | 641 | */ |
@@ -1099,6 +1098,11 @@ static inline int netif_queue_stopped(const struct net_device *dev) | |||
1099 | return netif_tx_queue_stopped(netdev_get_tx_queue(dev, 0)); | 1098 | return netif_tx_queue_stopped(netdev_get_tx_queue(dev, 0)); |
1100 | } | 1099 | } |
1101 | 1100 | ||
1101 | static inline int netif_tx_queue_frozen(const struct netdev_queue *dev_queue) | ||
1102 | { | ||
1103 | return test_bit(__QUEUE_STATE_FROZEN, &dev_queue->state); | ||
1104 | } | ||
1105 | |||
1102 | /** | 1106 | /** |
1103 | * netif_running - test if up | 1107 | * netif_running - test if up |
1104 | * @dev: network device | 1108 | * @dev: network device |
@@ -1475,6 +1479,26 @@ static inline void __netif_tx_lock_bh(struct netdev_queue *txq) | |||
1475 | txq->xmit_lock_owner = smp_processor_id(); | 1479 | txq->xmit_lock_owner = smp_processor_id(); |
1476 | } | 1480 | } |
1477 | 1481 | ||
1482 | static inline int __netif_tx_trylock(struct netdev_queue *txq) | ||
1483 | { | ||
1484 | int ok = spin_trylock(&txq->_xmit_lock); | ||
1485 | if (likely(ok)) | ||
1486 | txq->xmit_lock_owner = smp_processor_id(); | ||
1487 | return ok; | ||
1488 | } | ||
1489 | |||
1490 | static inline void __netif_tx_unlock(struct netdev_queue *txq) | ||
1491 | { | ||
1492 | txq->xmit_lock_owner = -1; | ||
1493 | spin_unlock(&txq->_xmit_lock); | ||
1494 | } | ||
1495 | |||
1496 | static inline void __netif_tx_unlock_bh(struct netdev_queue *txq) | ||
1497 | { | ||
1498 | txq->xmit_lock_owner = -1; | ||
1499 | spin_unlock_bh(&txq->_xmit_lock); | ||
1500 | } | ||
1501 | |||
1478 | /** | 1502 | /** |
1479 | * netif_tx_lock - grab network device transmit lock | 1503 | * netif_tx_lock - grab network device transmit lock |
1480 | * @dev: network device | 1504 | * @dev: network device |
@@ -1484,12 +1508,23 @@ static inline void __netif_tx_lock_bh(struct netdev_queue *txq) | |||
1484 | */ | 1508 | */ |
1485 | static inline void netif_tx_lock(struct net_device *dev) | 1509 | static inline void netif_tx_lock(struct net_device *dev) |
1486 | { | 1510 | { |
1487 | int cpu = smp_processor_id(); | ||
1488 | unsigned int i; | 1511 | unsigned int i; |
1512 | int cpu; | ||
1489 | 1513 | ||
1514 | spin_lock(&dev->tx_global_lock); | ||
1515 | cpu = smp_processor_id(); | ||
1490 | for (i = 0; i < dev->num_tx_queues; i++) { | 1516 | for (i = 0; i < dev->num_tx_queues; i++) { |
1491 | struct netdev_queue *txq = netdev_get_tx_queue(dev, i); | 1517 | struct netdev_queue *txq = netdev_get_tx_queue(dev, i); |
1518 | |||
1519 | /* We are the only thread of execution doing a | ||
1520 | * freeze, but we have to grab the _xmit_lock in | ||
1521 | * order to synchronize with threads which are in | ||
1522 | * the ->hard_start_xmit() handler and already | ||
1523 | * checked the frozen bit. | ||
1524 | */ | ||
1492 | __netif_tx_lock(txq, cpu); | 1525 | __netif_tx_lock(txq, cpu); |
1526 | set_bit(__QUEUE_STATE_FROZEN, &txq->state); | ||
1527 | __netif_tx_unlock(txq); | ||
1493 | } | 1528 | } |
1494 | } | 1529 | } |
1495 | 1530 | ||
@@ -1499,40 +1534,22 @@ static inline void netif_tx_lock_bh(struct net_device *dev) | |||
1499 | netif_tx_lock(dev); | 1534 | netif_tx_lock(dev); |
1500 | } | 1535 | } |
1501 | 1536 | ||
1502 | static inline int __netif_tx_trylock(struct netdev_queue *txq) | ||
1503 | { | ||
1504 | int ok = spin_trylock(&txq->_xmit_lock); | ||
1505 | if (likely(ok)) | ||
1506 | txq->xmit_lock_owner = smp_processor_id(); | ||
1507 | return ok; | ||
1508 | } | ||
1509 | |||
1510 | static inline int netif_tx_trylock(struct net_device *dev) | ||
1511 | { | ||
1512 | return __netif_tx_trylock(netdev_get_tx_queue(dev, 0)); | ||
1513 | } | ||
1514 | |||
1515 | static inline void __netif_tx_unlock(struct netdev_queue *txq) | ||
1516 | { | ||
1517 | txq->xmit_lock_owner = -1; | ||
1518 | spin_unlock(&txq->_xmit_lock); | ||
1519 | } | ||
1520 | |||
1521 | static inline void __netif_tx_unlock_bh(struct netdev_queue *txq) | ||
1522 | { | ||
1523 | txq->xmit_lock_owner = -1; | ||
1524 | spin_unlock_bh(&txq->_xmit_lock); | ||
1525 | } | ||
1526 | |||
1527 | static inline void netif_tx_unlock(struct net_device *dev) | 1537 | static inline void netif_tx_unlock(struct net_device *dev) |
1528 | { | 1538 | { |
1529 | unsigned int i; | 1539 | unsigned int i; |
1530 | 1540 | ||
1531 | for (i = 0; i < dev->num_tx_queues; i++) { | 1541 | for (i = 0; i < dev->num_tx_queues; i++) { |
1532 | struct netdev_queue *txq = netdev_get_tx_queue(dev, i); | 1542 | struct netdev_queue *txq = netdev_get_tx_queue(dev, i); |
1533 | __netif_tx_unlock(txq); | ||
1534 | } | ||
1535 | 1543 | ||
1544 | /* No need to grab the _xmit_lock here. If the | ||
1545 | * queue is not stopped for another reason, we | ||
1546 | * force a schedule. | ||
1547 | */ | ||
1548 | clear_bit(__QUEUE_STATE_FROZEN, &txq->state); | ||
1549 | if (!test_bit(__QUEUE_STATE_XOFF, &txq->state)) | ||
1550 | __netif_schedule(txq->qdisc); | ||
1551 | } | ||
1552 | spin_unlock(&dev->tx_global_lock); | ||
1536 | } | 1553 | } |
1537 | 1554 | ||
1538 | static inline void netif_tx_unlock_bh(struct net_device *dev) | 1555 | static inline void netif_tx_unlock_bh(struct net_device *dev) |
@@ -1556,13 +1573,18 @@ static inline void netif_tx_unlock_bh(struct net_device *dev) | |||
1556 | static inline void netif_tx_disable(struct net_device *dev) | 1573 | static inline void netif_tx_disable(struct net_device *dev) |
1557 | { | 1574 | { |
1558 | unsigned int i; | 1575 | unsigned int i; |
1576 | int cpu; | ||
1559 | 1577 | ||
1560 | netif_tx_lock_bh(dev); | 1578 | local_bh_disable(); |
1579 | cpu = smp_processor_id(); | ||
1561 | for (i = 0; i < dev->num_tx_queues; i++) { | 1580 | for (i = 0; i < dev->num_tx_queues; i++) { |
1562 | struct netdev_queue *txq = netdev_get_tx_queue(dev, i); | 1581 | struct netdev_queue *txq = netdev_get_tx_queue(dev, i); |
1582 | |||
1583 | __netif_tx_lock(txq, cpu); | ||
1563 | netif_tx_stop_queue(txq); | 1584 | netif_tx_stop_queue(txq); |
1585 | __netif_tx_unlock(txq); | ||
1564 | } | 1586 | } |
1565 | netif_tx_unlock_bh(dev); | 1587 | local_bh_enable(); |
1566 | } | 1588 | } |
1567 | 1589 | ||
1568 | static inline void netif_addr_lock(struct net_device *dev) | 1590 | static inline void netif_addr_lock(struct net_device *dev) |
diff --git a/include/linux/netfilter/nf_conntrack_tcp.h b/include/linux/netfilter/nf_conntrack_tcp.h index 22ce29995f13..a049df4f2236 100644 --- a/include/linux/netfilter/nf_conntrack_tcp.h +++ b/include/linux/netfilter/nf_conntrack_tcp.h | |||
@@ -30,6 +30,9 @@ enum tcp_conntrack { | |||
30 | /* Be liberal in window checking */ | 30 | /* Be liberal in window checking */ |
31 | #define IP_CT_TCP_FLAG_BE_LIBERAL 0x08 | 31 | #define IP_CT_TCP_FLAG_BE_LIBERAL 0x08 |
32 | 32 | ||
33 | /* Has unacknowledged data */ | ||
34 | #define IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED 0x10 | ||
35 | |||
33 | struct nf_ct_tcp_flags { | 36 | struct nf_ct_tcp_flags { |
34 | u_int8_t flags; | 37 | u_int8_t flags; |
35 | u_int8_t mask; | 38 | u_int8_t mask; |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 54590a9a103e..c74d3e875314 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -163,7 +163,7 @@ static inline int Page##uname(struct page *page) \ | |||
163 | 163 | ||
164 | struct page; /* forward declaration */ | 164 | struct page; /* forward declaration */ |
165 | 165 | ||
166 | PAGEFLAG(Locked, locked) TESTSCFLAG(Locked, locked) | 166 | TESTPAGEFLAG(Locked, locked) |
167 | PAGEFLAG(Error, error) | 167 | PAGEFLAG(Error, error) |
168 | PAGEFLAG(Referenced, referenced) TESTCLEARFLAG(Referenced, referenced) | 168 | PAGEFLAG(Referenced, referenced) TESTCLEARFLAG(Referenced, referenced) |
169 | PAGEFLAG(Dirty, dirty) TESTSCFLAG(Dirty, dirty) __CLEARPAGEFLAG(Dirty, dirty) | 169 | PAGEFLAG(Dirty, dirty) TESTSCFLAG(Dirty, dirty) __CLEARPAGEFLAG(Dirty, dirty) |
@@ -239,9 +239,6 @@ static inline void __SetPageUptodate(struct page *page) | |||
239 | { | 239 | { |
240 | smp_wmb(); | 240 | smp_wmb(); |
241 | __set_bit(PG_uptodate, &(page)->flags); | 241 | __set_bit(PG_uptodate, &(page)->flags); |
242 | #ifdef CONFIG_S390 | ||
243 | page_clear_dirty(page); | ||
244 | #endif | ||
245 | } | 242 | } |
246 | 243 | ||
247 | static inline void SetPageUptodate(struct page *page) | 244 | static inline void SetPageUptodate(struct page *page) |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index a39b38ccdc97..5da31c12101c 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -143,6 +143,29 @@ static inline int page_cache_get_speculative(struct page *page) | |||
143 | return 1; | 143 | return 1; |
144 | } | 144 | } |
145 | 145 | ||
146 | /* | ||
147 | * Same as above, but add instead of inc (could just be merged) | ||
148 | */ | ||
149 | static inline int page_cache_add_speculative(struct page *page, int count) | ||
150 | { | ||
151 | VM_BUG_ON(in_interrupt()); | ||
152 | |||
153 | #if !defined(CONFIG_SMP) && defined(CONFIG_CLASSIC_RCU) | ||
154 | # ifdef CONFIG_PREEMPT | ||
155 | VM_BUG_ON(!in_atomic()); | ||
156 | # endif | ||
157 | VM_BUG_ON(page_count(page) == 0); | ||
158 | atomic_add(count, &page->_count); | ||
159 | |||
160 | #else | ||
161 | if (unlikely(!atomic_add_unless(&page->_count, count, 0))) | ||
162 | return 0; | ||
163 | #endif | ||
164 | VM_BUG_ON(PageCompound(page) && page != compound_head(page)); | ||
165 | |||
166 | return 1; | ||
167 | } | ||
168 | |||
146 | static inline int page_freeze_refs(struct page *page, int count) | 169 | static inline int page_freeze_refs(struct page *page, int count) |
147 | { | 170 | { |
148 | return likely(atomic_cmpxchg(&page->_count, count, 0) == count); | 171 | return likely(atomic_cmpxchg(&page->_count, count, 0) == count); |
@@ -227,29 +250,6 @@ static inline struct page *read_mapping_page(struct address_space *mapping, | |||
227 | return read_cache_page(mapping, index, filler, data); | 250 | return read_cache_page(mapping, index, filler, data); |
228 | } | 251 | } |
229 | 252 | ||
230 | int add_to_page_cache_locked(struct page *page, struct address_space *mapping, | ||
231 | pgoff_t index, gfp_t gfp_mask); | ||
232 | int add_to_page_cache_lru(struct page *page, struct address_space *mapping, | ||
233 | pgoff_t index, gfp_t gfp_mask); | ||
234 | extern void remove_from_page_cache(struct page *page); | ||
235 | extern void __remove_from_page_cache(struct page *page); | ||
236 | |||
237 | /* | ||
238 | * Like add_to_page_cache_locked, but used to add newly allocated pages: | ||
239 | * the page is new, so we can just run SetPageLocked() against it. | ||
240 | */ | ||
241 | static inline int add_to_page_cache(struct page *page, | ||
242 | struct address_space *mapping, pgoff_t offset, gfp_t gfp_mask) | ||
243 | { | ||
244 | int error; | ||
245 | |||
246 | SetPageLocked(page); | ||
247 | error = add_to_page_cache_locked(page, mapping, offset, gfp_mask); | ||
248 | if (unlikely(error)) | ||
249 | ClearPageLocked(page); | ||
250 | return error; | ||
251 | } | ||
252 | |||
253 | /* | 253 | /* |
254 | * Return byte-offset into filesystem object for page. | 254 | * Return byte-offset into filesystem object for page. |
255 | */ | 255 | */ |
@@ -271,13 +271,28 @@ extern int __lock_page_killable(struct page *page); | |||
271 | extern void __lock_page_nosync(struct page *page); | 271 | extern void __lock_page_nosync(struct page *page); |
272 | extern void unlock_page(struct page *page); | 272 | extern void unlock_page(struct page *page); |
273 | 273 | ||
274 | static inline void set_page_locked(struct page *page) | ||
275 | { | ||
276 | set_bit(PG_locked, &page->flags); | ||
277 | } | ||
278 | |||
279 | static inline void clear_page_locked(struct page *page) | ||
280 | { | ||
281 | clear_bit(PG_locked, &page->flags); | ||
282 | } | ||
283 | |||
284 | static inline int trylock_page(struct page *page) | ||
285 | { | ||
286 | return !test_and_set_bit(PG_locked, &page->flags); | ||
287 | } | ||
288 | |||
274 | /* | 289 | /* |
275 | * lock_page may only be called if we have the page's inode pinned. | 290 | * lock_page may only be called if we have the page's inode pinned. |
276 | */ | 291 | */ |
277 | static inline void lock_page(struct page *page) | 292 | static inline void lock_page(struct page *page) |
278 | { | 293 | { |
279 | might_sleep(); | 294 | might_sleep(); |
280 | if (TestSetPageLocked(page)) | 295 | if (!trylock_page(page)) |
281 | __lock_page(page); | 296 | __lock_page(page); |
282 | } | 297 | } |
283 | 298 | ||
@@ -289,7 +304,7 @@ static inline void lock_page(struct page *page) | |||
289 | static inline int lock_page_killable(struct page *page) | 304 | static inline int lock_page_killable(struct page *page) |
290 | { | 305 | { |
291 | might_sleep(); | 306 | might_sleep(); |
292 | if (TestSetPageLocked(page)) | 307 | if (!trylock_page(page)) |
293 | return __lock_page_killable(page); | 308 | return __lock_page_killable(page); |
294 | return 0; | 309 | return 0; |
295 | } | 310 | } |
@@ -301,7 +316,7 @@ static inline int lock_page_killable(struct page *page) | |||
301 | static inline void lock_page_nosync(struct page *page) | 316 | static inline void lock_page_nosync(struct page *page) |
302 | { | 317 | { |
303 | might_sleep(); | 318 | might_sleep(); |
304 | if (TestSetPageLocked(page)) | 319 | if (!trylock_page(page)) |
305 | __lock_page_nosync(page); | 320 | __lock_page_nosync(page); |
306 | } | 321 | } |
307 | 322 | ||
@@ -386,4 +401,27 @@ static inline int fault_in_pages_readable(const char __user *uaddr, int size) | |||
386 | return ret; | 401 | return ret; |
387 | } | 402 | } |
388 | 403 | ||
404 | int add_to_page_cache_locked(struct page *page, struct address_space *mapping, | ||
405 | pgoff_t index, gfp_t gfp_mask); | ||
406 | int add_to_page_cache_lru(struct page *page, struct address_space *mapping, | ||
407 | pgoff_t index, gfp_t gfp_mask); | ||
408 | extern void remove_from_page_cache(struct page *page); | ||
409 | extern void __remove_from_page_cache(struct page *page); | ||
410 | |||
411 | /* | ||
412 | * Like add_to_page_cache_locked, but used to add newly allocated pages: | ||
413 | * the page is new, so we can just run set_page_locked() against it. | ||
414 | */ | ||
415 | static inline int add_to_page_cache(struct page *page, | ||
416 | struct address_space *mapping, pgoff_t offset, gfp_t gfp_mask) | ||
417 | { | ||
418 | int error; | ||
419 | |||
420 | set_page_locked(page); | ||
421 | error = add_to_page_cache_locked(page, mapping, offset, gfp_mask); | ||
422 | if (unlikely(error)) | ||
423 | clear_page_locked(page); | ||
424 | return error; | ||
425 | } | ||
426 | |||
389 | #endif /* _LINUX_PAGEMAP_H */ | 427 | #endif /* _LINUX_PAGEMAP_H */ |
diff --git a/include/linux/parser.h b/include/linux/parser.h index cc554ca8bc78..7dcd05075756 100644 --- a/include/linux/parser.h +++ b/include/linux/parser.h | |||
@@ -14,7 +14,7 @@ struct match_token { | |||
14 | const char *pattern; | 14 | const char *pattern; |
15 | }; | 15 | }; |
16 | 16 | ||
17 | typedef const struct match_token match_table_t[]; | 17 | typedef struct match_token match_table_t[]; |
18 | 18 | ||
19 | /* Maximum number of arguments that match_token will find in a pattern */ | 19 | /* Maximum number of arguments that match_token will find in a pattern */ |
20 | enum {MAX_OPT_ARGS = 3}; | 20 | enum {MAX_OPT_ARGS = 3}; |
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h index 3ba25065fa96..8837928fbf33 100644 --- a/include/linux/pci-acpi.h +++ b/include/linux/pci-acpi.h | |||
@@ -57,6 +57,15 @@ static inline acpi_status pcie_osc_support_set(u32 flags) | |||
57 | { | 57 | { |
58 | return __pci_osc_support_set(flags, PCI_EXPRESS_ROOT_HID_STRING); | 58 | return __pci_osc_support_set(flags, PCI_EXPRESS_ROOT_HID_STRING); |
59 | } | 59 | } |
60 | static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) | ||
61 | { | ||
62 | /* Find root host bridge */ | ||
63 | while (pdev->bus->self) | ||
64 | pdev = pdev->bus->self; | ||
65 | |||
66 | return acpi_get_pci_rootbridge_handle(pci_domain_nr(pdev->bus), | ||
67 | pdev->bus->number); | ||
68 | } | ||
60 | #else | 69 | #else |
61 | #if !defined(AE_ERROR) | 70 | #if !defined(AE_ERROR) |
62 | typedef u32 acpi_status; | 71 | typedef u32 acpi_status; |
@@ -66,6 +75,8 @@ static inline acpi_status pci_osc_control_set(acpi_handle handle, u32 flags) | |||
66 | {return AE_ERROR;} | 75 | {return AE_ERROR;} |
67 | static inline acpi_status pci_osc_support_set(u32 flags) {return AE_ERROR;} | 76 | static inline acpi_status pci_osc_support_set(u32 flags) {return AE_ERROR;} |
68 | static inline acpi_status pcie_osc_support_set(u32 flags) {return AE_ERROR;} | 77 | static inline acpi_status pcie_osc_support_set(u32 flags) {return AE_ERROR;} |
78 | static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) | ||
79 | { return NULL; } | ||
69 | #endif | 80 | #endif |
70 | 81 | ||
71 | #endif /* _PCI_ACPI_H_ */ | 82 | #endif /* _PCI_ACPI_H_ */ |
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..f1624b396754 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 | ||
@@ -2430,6 +2428,9 @@ | |||
2430 | #define PCI_DEVICE_ID_INTEL_ICH10_3 0x3a1a | 2428 | #define PCI_DEVICE_ID_INTEL_ICH10_3 0x3a1a |
2431 | #define PCI_DEVICE_ID_INTEL_ICH10_4 0x3a30 | 2429 | #define PCI_DEVICE_ID_INTEL_ICH10_4 0x3a30 |
2432 | #define PCI_DEVICE_ID_INTEL_ICH10_5 0x3a60 | 2430 | #define PCI_DEVICE_ID_INTEL_ICH10_5 0x3a60 |
2431 | #define PCI_DEVICE_ID_INTEL_PCH_0 0x3b10 | ||
2432 | #define PCI_DEVICE_ID_INTEL_PCH_1 0x3b11 | ||
2433 | #define PCI_DEVICE_ID_INTEL_PCH_2 0x3b30 | ||
2433 | #define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f | 2434 | #define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f |
2434 | #define PCI_DEVICE_ID_INTEL_5100_16 0x65f0 | 2435 | #define PCI_DEVICE_ID_INTEL_5100_16 0x65f0 |
2435 | #define PCI_DEVICE_ID_INTEL_5100_21 0x65f5 | 2436 | #define PCI_DEVICE_ID_INTEL_5100_21 0x65f5 |
diff --git a/include/linux/pid.h b/include/linux/pid.h index 22921ac4cfd9..d7e98ff8021e 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h | |||
@@ -161,4 +161,13 @@ pid_t pid_vnr(struct pid *pid); | |||
161 | } \ | 161 | } \ |
162 | } while (0) | 162 | } while (0) |
163 | 163 | ||
164 | #define do_each_pid_thread(pid, type, task) \ | ||
165 | do_each_pid_task(pid, type, task) { \ | ||
166 | struct task_struct *tg___ = task; \ | ||
167 | do { | ||
168 | |||
169 | #define while_each_pid_thread(pid, type, task) \ | ||
170 | } while_each_thread(tg___, task); \ | ||
171 | task = tg___; \ | ||
172 | } while_each_pid_task(pid, type, task) | ||
164 | #endif /* _LINUX_PID_H */ | 173 | #endif /* _LINUX_PID_H */ |
diff --git a/include/linux/pim.h b/include/linux/pim.h index 236ffd317394..1ba0661561a4 100644 --- a/include/linux/pim.h +++ b/include/linux/pim.h | |||
@@ -3,22 +3,6 @@ | |||
3 | 3 | ||
4 | #include <asm/byteorder.h> | 4 | #include <asm/byteorder.h> |
5 | 5 | ||
6 | #ifndef __KERNEL__ | ||
7 | struct pim { | ||
8 | #if defined(__LITTLE_ENDIAN_BITFIELD) | ||
9 | __u8 pim_type:4, /* PIM message type */ | ||
10 | pim_ver:4; /* PIM version */ | ||
11 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
12 | __u8 pim_ver:4; /* PIM version */ | ||
13 | pim_type:4; /* PIM message type */ | ||
14 | #endif | ||
15 | __u8 pim_rsv; /* Reserved */ | ||
16 | __be16 pim_cksum; /* Checksum */ | ||
17 | }; | ||
18 | |||
19 | #define PIM_MINLEN 8 | ||
20 | #endif | ||
21 | |||
22 | /* Message types - V1 */ | 6 | /* Message types - V1 */ |
23 | #define PIM_V1_VERSION __constant_htonl(0x10000000) | 7 | #define PIM_V1_VERSION __constant_htonl(0x10000000) |
24 | #define PIM_V1_REGISTER 1 | 8 | #define PIM_V1_REGISTER 1 |
@@ -27,7 +11,6 @@ struct pim { | |||
27 | #define PIM_VERSION 2 | 11 | #define PIM_VERSION 2 |
28 | #define PIM_REGISTER 1 | 12 | #define PIM_REGISTER 1 |
29 | 13 | ||
30 | #if defined(__KERNEL__) | ||
31 | #define PIM_NULL_REGISTER __constant_htonl(0x40000000) | 14 | #define PIM_NULL_REGISTER __constant_htonl(0x40000000) |
32 | 15 | ||
33 | /* PIMv2 register message header layout (ietf-draft-idmr-pimvsm-v2-00.ps */ | 16 | /* PIMv2 register message header layout (ietf-draft-idmr-pimvsm-v2-00.ps */ |
@@ -42,4 +25,3 @@ struct pimreghdr | |||
42 | struct sk_buff; | 25 | struct sk_buff; |
43 | extern int pim_rcv_v1(struct sk_buff *); | 26 | extern int pim_rcv_v1(struct sk_buff *); |
44 | #endif | 27 | #endif |
45 | #endif | ||
diff --git a/include/linux/pm_qos_params.h b/include/linux/pm_qos_params.h index 2e4e97bd19f7..d74f75ed1e47 100644 --- a/include/linux/pm_qos_params.h +++ b/include/linux/pm_qos_params.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* interface for the pm_qos_power infrastructure of the linux kernel. | 1 | /* interface for the pm_qos_power infrastructure of the linux kernel. |
2 | * | 2 | * |
3 | * Mark Gross | 3 | * Mark Gross <mgross@linux.intel.com> |
4 | */ | 4 | */ |
5 | #include <linux/list.h> | 5 | #include <linux/list.h> |
6 | #include <linux/notifier.h> | 6 | #include <linux/notifier.h> |
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 68ed19ccf1f7..ea96ead1d39d 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h | |||
@@ -78,6 +78,7 @@ enum power_supply_property { | |||
78 | POWER_SUPPLY_PROP_CHARGE_EMPTY, | 78 | POWER_SUPPLY_PROP_CHARGE_EMPTY, |
79 | POWER_SUPPLY_PROP_CHARGE_NOW, | 79 | POWER_SUPPLY_PROP_CHARGE_NOW, |
80 | POWER_SUPPLY_PROP_CHARGE_AVG, | 80 | POWER_SUPPLY_PROP_CHARGE_AVG, |
81 | POWER_SUPPLY_PROP_CHARGE_COUNTER, | ||
81 | POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN, | 82 | POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN, |
82 | POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN, | 83 | POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN, |
83 | POWER_SUPPLY_PROP_ENERGY_FULL, | 84 | POWER_SUPPLY_PROP_ENERGY_FULL, |
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index fd31756e1a00..ea7416c901d1 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
@@ -172,7 +172,7 @@ static inline void ptrace_init_task(struct task_struct *child, bool ptrace) | |||
172 | child->ptrace = 0; | 172 | child->ptrace = 0; |
173 | if (unlikely(ptrace)) { | 173 | if (unlikely(ptrace)) { |
174 | child->ptrace = current->ptrace; | 174 | child->ptrace = current->ptrace; |
175 | __ptrace_link(child, current->parent); | 175 | ptrace_link(child, current->parent); |
176 | } | 176 | } |
177 | } | 177 | } |
178 | 178 | ||
diff --git a/include/linux/quicklist.h b/include/linux/quicklist.h index 39b66713a0bb..bd466439c588 100644 --- a/include/linux/quicklist.h +++ b/include/linux/quicklist.h | |||
@@ -80,6 +80,13 @@ void quicklist_trim(int nr, void (*dtor)(void *), | |||
80 | 80 | ||
81 | unsigned long quicklist_total_size(void); | 81 | unsigned long quicklist_total_size(void); |
82 | 82 | ||
83 | #else | ||
84 | |||
85 | static inline unsigned long quicklist_total_size(void) | ||
86 | { | ||
87 | return 0; | ||
88 | } | ||
89 | |||
83 | #endif | 90 | #endif |
84 | 91 | ||
85 | #endif /* LINUX_QUICKLIST_H */ | 92 | #endif /* LINUX_QUICKLIST_H */ |
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index 742187f7a05c..ca6b9b5c8d52 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h | |||
@@ -43,6 +43,8 @@ int dquot_mark_dquot_dirty(struct dquot *dquot); | |||
43 | 43 | ||
44 | int vfs_quota_on(struct super_block *sb, int type, int format_id, | 44 | int vfs_quota_on(struct super_block *sb, int type, int format_id, |
45 | char *path, int remount); | 45 | char *path, int remount); |
46 | int vfs_quota_on_path(struct super_block *sb, int type, int format_id, | ||
47 | struct path *path); | ||
46 | int vfs_quota_on_mount(struct super_block *sb, char *qf_name, | 48 | int vfs_quota_on_mount(struct super_block *sb, char *qf_name, |
47 | int format_id, int type); | 49 | int format_id, int type); |
48 | int vfs_quota_off(struct super_block *sb, int type, int remount); | 50 | int vfs_quota_off(struct super_block *sb, int type, int remount); |
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index 9f2549ac0e2d..c200b9a34aff 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h | |||
@@ -128,6 +128,7 @@ struct mddev_s | |||
128 | #define MD_CHANGE_DEVS 0 /* Some device status has changed */ | 128 | #define MD_CHANGE_DEVS 0 /* Some device status has changed */ |
129 | #define MD_CHANGE_CLEAN 1 /* transition to or from 'clean' */ | 129 | #define MD_CHANGE_CLEAN 1 /* transition to or from 'clean' */ |
130 | #define MD_CHANGE_PENDING 2 /* superblock update in progress */ | 130 | #define MD_CHANGE_PENDING 2 /* superblock update in progress */ |
131 | #define MD_NOTIFY_ARRAY_STATE 3 /* atomic context wants to notify userspace */ | ||
131 | 132 | ||
132 | int ro; | 133 | int ro; |
133 | 134 | ||
diff --git a/include/linux/rcuclassic.h b/include/linux/rcuclassic.h index 8c774905dcfe..4ab843622727 100644 --- a/include/linux/rcuclassic.h +++ b/include/linux/rcuclassic.h | |||
@@ -117,7 +117,7 @@ extern int rcu_needs_cpu(int cpu); | |||
117 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 117 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
118 | extern struct lockdep_map rcu_lock_map; | 118 | extern struct lockdep_map rcu_lock_map; |
119 | # define rcu_read_acquire() \ | 119 | # define rcu_read_acquire() \ |
120 | lock_acquire(&rcu_lock_map, 0, 0, 2, 1, _THIS_IP_) | 120 | lock_acquire(&rcu_lock_map, 0, 0, 2, 1, NULL, _THIS_IP_) |
121 | # define rcu_read_release() lock_release(&rcu_lock_map, 1, _THIS_IP_) | 121 | # define rcu_read_release() lock_release(&rcu_lock_map, 1, _THIS_IP_) |
122 | #else | 122 | #else |
123 | # define rcu_read_acquire() do { } while (0) | 123 | # define rcu_read_acquire() do { } while (0) |
diff --git a/include/linux/reboot.h b/include/linux/reboot.h index b93b541cf111..988e55fe649b 100644 --- a/include/linux/reboot.h +++ b/include/linux/reboot.h | |||
@@ -59,6 +59,7 @@ extern void machine_crash_shutdown(struct pt_regs *); | |||
59 | * Architecture independent implemenations of sys_reboot commands. | 59 | * Architecture independent implemenations of sys_reboot commands. |
60 | */ | 60 | */ |
61 | 61 | ||
62 | extern void kernel_restart_prepare(char *cmd); | ||
62 | extern void kernel_restart(char *cmd); | 63 | extern void kernel_restart(char *cmd); |
63 | extern void kernel_halt(void); | 64 | extern void kernel_halt(void); |
64 | extern void kernel_power_off(void); | 65 | extern void kernel_power_off(void); |
diff --git a/include/linux/regulator/bq24022.h b/include/linux/regulator/bq24022.h new file mode 100644 index 000000000000..e84b0a9feda5 --- /dev/null +++ b/include/linux/regulator/bq24022.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * Support for TI bq24022 (bqTINY-II) Dual Input (USB/AC Adpater) | ||
3 | * 1-Cell Li-Ion Charger connected via GPIOs. | ||
4 | * | ||
5 | * Copyright (c) 2008 Philipp Zabel | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | */ | ||
12 | |||
13 | /** | ||
14 | * bq24022_mach_info - platform data for bq24022 | ||
15 | * @gpio_nce: GPIO line connected to the nCE pin, used to enable / disable charging | ||
16 | * @gpio_iset2: GPIO line connected to the ISET2 pin, used to limit charging current to 100 mA / 500 mA | ||
17 | */ | ||
18 | struct bq24022_mach_info { | ||
19 | int gpio_nce; | ||
20 | int gpio_iset2; | ||
21 | }; | ||
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h new file mode 100644 index 000000000000..afdc4558bb94 --- /dev/null +++ b/include/linux/regulator/consumer.h | |||
@@ -0,0 +1,284 @@ | |||
1 | /* | ||
2 | * consumer.h -- SoC Regulator consumer support. | ||
3 | * | ||
4 | * Copyright (C) 2007, 2008 Wolfson Microelectronics PLC. | ||
5 | * | ||
6 | * Author: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | * Regulator Consumer Interface. | ||
13 | * | ||
14 | * A Power Management Regulator framework for SoC based devices. | ||
15 | * Features:- | ||
16 | * o Voltage and current level control. | ||
17 | * o Operating mode control. | ||
18 | * o Regulator status. | ||
19 | * o sysfs entries for showing client devices and status | ||
20 | * | ||
21 | * EXPERIMENTAL FEATURES: | ||
22 | * Dynamic Regulator operating Mode Switching (DRMS) - allows regulators | ||
23 | * to use most efficient operating mode depending upon voltage and load and | ||
24 | * is transparent to client drivers. | ||
25 | * | ||
26 | * e.g. Devices x,y,z share regulator r. Device x and y draw 20mA each during | ||
27 | * IO and 1mA at idle. Device z draws 100mA when under load and 5mA when | ||
28 | * idling. Regulator r has > 90% efficiency in NORMAL mode at loads > 100mA | ||
29 | * but this drops rapidly to 60% when below 100mA. Regulator r has > 90% | ||
30 | * efficiency in IDLE mode at loads < 10mA. Thus regulator r will operate | ||
31 | * in normal mode for loads > 10mA and in IDLE mode for load <= 10mA. | ||
32 | * | ||
33 | */ | ||
34 | |||
35 | #ifndef __LINUX_REGULATOR_CONSUMER_H_ | ||
36 | #define __LINUX_REGULATOR_CONSUMER_H_ | ||
37 | |||
38 | /* | ||
39 | * Regulator operating modes. | ||
40 | * | ||
41 | * Regulators can run in a variety of different operating modes depending on | ||
42 | * output load. This allows further system power savings by selecting the | ||
43 | * best (and most efficient) regulator mode for a desired load. | ||
44 | * | ||
45 | * Most drivers will only care about NORMAL. The modes below are generic and | ||
46 | * will probably not match the naming convention of your regulator data sheet | ||
47 | * but should match the use cases in the datasheet. | ||
48 | * | ||
49 | * In order of power efficiency (least efficient at top). | ||
50 | * | ||
51 | * Mode Description | ||
52 | * FAST Regulator can handle fast changes in it's load. | ||
53 | * e.g. useful in CPU voltage & frequency scaling where | ||
54 | * load can quickly increase with CPU frequency increases. | ||
55 | * | ||
56 | * NORMAL Normal regulator power supply mode. Most drivers will | ||
57 | * use this mode. | ||
58 | * | ||
59 | * IDLE Regulator runs in a more efficient mode for light | ||
60 | * loads. Can be used for devices that have a low power | ||
61 | * requirement during periods of inactivity. This mode | ||
62 | * may be more noisy than NORMAL and may not be able | ||
63 | * to handle fast load switching. | ||
64 | * | ||
65 | * STANDBY Regulator runs in the most efficient mode for very | ||
66 | * light loads. Can be used by devices when they are | ||
67 | * in a sleep/standby state. This mode is likely to be | ||
68 | * the most noisy and may not be able to handle fast load | ||
69 | * switching. | ||
70 | * | ||
71 | * NOTE: Most regulators will only support a subset of these modes. Some | ||
72 | * will only just support NORMAL. | ||
73 | * | ||
74 | * These modes can be OR'ed together to make up a mask of valid register modes. | ||
75 | */ | ||
76 | |||
77 | #define REGULATOR_MODE_FAST 0x1 | ||
78 | #define REGULATOR_MODE_NORMAL 0x2 | ||
79 | #define REGULATOR_MODE_IDLE 0x4 | ||
80 | #define REGULATOR_MODE_STANDBY 0x8 | ||
81 | |||
82 | /* | ||
83 | * Regulator notifier events. | ||
84 | * | ||
85 | * UNDER_VOLTAGE Regulator output is under voltage. | ||
86 | * OVER_CURRENT Regulator output current is too high. | ||
87 | * REGULATION_OUT Regulator output is out of regulation. | ||
88 | * FAIL Regulator output has failed. | ||
89 | * OVER_TEMP Regulator over temp. | ||
90 | * FORCE_DISABLE Regulator shut down by software. | ||
91 | * | ||
92 | * NOTE: These events can be OR'ed together when passed into handler. | ||
93 | */ | ||
94 | |||
95 | #define REGULATOR_EVENT_UNDER_VOLTAGE 0x01 | ||
96 | #define REGULATOR_EVENT_OVER_CURRENT 0x02 | ||
97 | #define REGULATOR_EVENT_REGULATION_OUT 0x04 | ||
98 | #define REGULATOR_EVENT_FAIL 0x08 | ||
99 | #define REGULATOR_EVENT_OVER_TEMP 0x10 | ||
100 | #define REGULATOR_EVENT_FORCE_DISABLE 0x20 | ||
101 | |||
102 | struct regulator; | ||
103 | |||
104 | /** | ||
105 | * struct regulator_bulk_data - Data used for bulk regulator operations. | ||
106 | * | ||
107 | * @supply The name of the supply. Initialised by the user before | ||
108 | * using the bulk regulator APIs. | ||
109 | * @consumer The regulator consumer for the supply. This will be managed | ||
110 | * by the bulk API. | ||
111 | * | ||
112 | * The regulator APIs provide a series of regulator_bulk_() API calls as | ||
113 | * a convenience to consumers which require multiple supplies. This | ||
114 | * structure is used to manage data for these calls. | ||
115 | */ | ||
116 | struct regulator_bulk_data { | ||
117 | const char *supply; | ||
118 | struct regulator *consumer; | ||
119 | }; | ||
120 | |||
121 | #if defined(CONFIG_REGULATOR) | ||
122 | |||
123 | /* regulator get and put */ | ||
124 | struct regulator *__must_check regulator_get(struct device *dev, | ||
125 | const char *id); | ||
126 | void regulator_put(struct regulator *regulator); | ||
127 | |||
128 | /* regulator output control and status */ | ||
129 | int regulator_enable(struct regulator *regulator); | ||
130 | int regulator_disable(struct regulator *regulator); | ||
131 | int regulator_force_disable(struct regulator *regulator); | ||
132 | int regulator_is_enabled(struct regulator *regulator); | ||
133 | |||
134 | int regulator_bulk_get(struct device *dev, int num_consumers, | ||
135 | struct regulator_bulk_data *consumers); | ||
136 | int regulator_bulk_enable(int num_consumers, | ||
137 | struct regulator_bulk_data *consumers); | ||
138 | int regulator_bulk_disable(int num_consumers, | ||
139 | struct regulator_bulk_data *consumers); | ||
140 | void regulator_bulk_free(int num_consumers, | ||
141 | struct regulator_bulk_data *consumers); | ||
142 | |||
143 | int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV); | ||
144 | int regulator_get_voltage(struct regulator *regulator); | ||
145 | int regulator_set_current_limit(struct regulator *regulator, | ||
146 | int min_uA, int max_uA); | ||
147 | int regulator_get_current_limit(struct regulator *regulator); | ||
148 | |||
149 | int regulator_set_mode(struct regulator *regulator, unsigned int mode); | ||
150 | unsigned int regulator_get_mode(struct regulator *regulator); | ||
151 | int regulator_set_optimum_mode(struct regulator *regulator, int load_uA); | ||
152 | |||
153 | /* regulator notifier block */ | ||
154 | int regulator_register_notifier(struct regulator *regulator, | ||
155 | struct notifier_block *nb); | ||
156 | int regulator_unregister_notifier(struct regulator *regulator, | ||
157 | struct notifier_block *nb); | ||
158 | |||
159 | /* driver data - core doesn't touch */ | ||
160 | void *regulator_get_drvdata(struct regulator *regulator); | ||
161 | void regulator_set_drvdata(struct regulator *regulator, void *data); | ||
162 | |||
163 | #else | ||
164 | |||
165 | /* | ||
166 | * Make sure client drivers will still build on systems with no software | ||
167 | * controllable voltage or current regulators. | ||
168 | */ | ||
169 | static inline struct regulator *__must_check regulator_get(struct device *dev, | ||
170 | const char *id) | ||
171 | { | ||
172 | /* Nothing except the stubbed out regulator API should be | ||
173 | * looking at the value except to check if it is an error | ||
174 | * value so the actual return value doesn't matter. | ||
175 | */ | ||
176 | return (struct regulator *)id; | ||
177 | } | ||
178 | static inline void regulator_put(struct regulator *regulator) | ||
179 | { | ||
180 | } | ||
181 | |||
182 | static inline int regulator_enable(struct regulator *regulator) | ||
183 | { | ||
184 | return 0; | ||
185 | } | ||
186 | |||
187 | static inline int regulator_disable(struct regulator *regulator) | ||
188 | { | ||
189 | return 0; | ||
190 | } | ||
191 | |||
192 | static inline int regulator_is_enabled(struct regulator *regulator) | ||
193 | { | ||
194 | return 1; | ||
195 | } | ||
196 | |||
197 | static inline int regulator_bulk_get(struct device *dev, | ||
198 | int num_consumers, | ||
199 | struct regulator_bulk_data *consumers) | ||
200 | { | ||
201 | return 0; | ||
202 | } | ||
203 | |||
204 | static inline int regulator_bulk_enable(int num_consumers, | ||
205 | struct regulator_bulk_data *consumers) | ||
206 | { | ||
207 | return 0; | ||
208 | } | ||
209 | |||
210 | static inline int regulator_bulk_disable(int num_consumers, | ||
211 | struct regulator_bulk_data *consumers) | ||
212 | { | ||
213 | return 0; | ||
214 | } | ||
215 | |||
216 | static inline void regulator_bulk_free(int num_consumers, | ||
217 | struct regulator_bulk_data *consumers) | ||
218 | { | ||
219 | } | ||
220 | |||
221 | static inline int regulator_set_voltage(struct regulator *regulator, | ||
222 | int min_uV, int max_uV) | ||
223 | { | ||
224 | return 0; | ||
225 | } | ||
226 | |||
227 | static inline int regulator_get_voltage(struct regulator *regulator) | ||
228 | { | ||
229 | return 0; | ||
230 | } | ||
231 | |||
232 | static inline int regulator_set_current_limit(struct regulator *regulator, | ||
233 | int min_uA, int max_uA) | ||
234 | { | ||
235 | return 0; | ||
236 | } | ||
237 | |||
238 | static inline int regulator_get_current_limit(struct regulator *regulator) | ||
239 | { | ||
240 | return 0; | ||
241 | } | ||
242 | |||
243 | static inline int regulator_set_mode(struct regulator *regulator, | ||
244 | unsigned int mode) | ||
245 | { | ||
246 | return 0; | ||
247 | } | ||
248 | |||
249 | static inline unsigned int regulator_get_mode(struct regulator *regulator) | ||
250 | { | ||
251 | return REGULATOR_MODE_NORMAL; | ||
252 | } | ||
253 | |||
254 | static inline int regulator_set_optimum_mode(struct regulator *regulator, | ||
255 | int load_uA) | ||
256 | { | ||
257 | return REGULATOR_MODE_NORMAL; | ||
258 | } | ||
259 | |||
260 | static inline int regulator_register_notifier(struct regulator *regulator, | ||
261 | struct notifier_block *nb) | ||
262 | { | ||
263 | return 0; | ||
264 | } | ||
265 | |||
266 | static inline int regulator_unregister_notifier(struct regulator *regulator, | ||
267 | struct notifier_block *nb) | ||
268 | { | ||
269 | return 0; | ||
270 | } | ||
271 | |||
272 | static inline void *regulator_get_drvdata(struct regulator *regulator) | ||
273 | { | ||
274 | return NULL; | ||
275 | } | ||
276 | |||
277 | static inline void regulator_set_drvdata(struct regulator *regulator, | ||
278 | void *data) | ||
279 | { | ||
280 | } | ||
281 | |||
282 | #endif | ||
283 | |||
284 | #endif | ||
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h new file mode 100644 index 000000000000..1d712c7172a2 --- /dev/null +++ b/include/linux/regulator/driver.h | |||
@@ -0,0 +1,99 @@ | |||
1 | /* | ||
2 | * driver.h -- SoC Regulator driver support. | ||
3 | * | ||
4 | * Copyright (C) 2007, 2008 Wolfson Microelectronics PLC. | ||
5 | * | ||
6 | * Author: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | * Regulator Driver Interface. | ||
13 | */ | ||
14 | |||
15 | #ifndef __LINUX_REGULATOR_DRIVER_H_ | ||
16 | #define __LINUX_REGULATOR_DRIVER_H_ | ||
17 | |||
18 | #include <linux/device.h> | ||
19 | #include <linux/regulator/consumer.h> | ||
20 | |||
21 | struct regulator_constraints; | ||
22 | struct regulator_dev; | ||
23 | |||
24 | /** | ||
25 | * struct regulator_ops - regulator operations. | ||
26 | * | ||
27 | * This struct describes regulator operations. | ||
28 | */ | ||
29 | struct regulator_ops { | ||
30 | |||
31 | /* get/set regulator voltage */ | ||
32 | int (*set_voltage) (struct regulator_dev *, int min_uV, int max_uV); | ||
33 | int (*get_voltage) (struct regulator_dev *); | ||
34 | |||
35 | /* get/set regulator current */ | ||
36 | int (*set_current_limit) (struct regulator_dev *, | ||
37 | int min_uA, int max_uA); | ||
38 | int (*get_current_limit) (struct regulator_dev *); | ||
39 | |||
40 | /* enable/disable regulator */ | ||
41 | int (*enable) (struct regulator_dev *); | ||
42 | int (*disable) (struct regulator_dev *); | ||
43 | int (*is_enabled) (struct regulator_dev *); | ||
44 | |||
45 | /* get/set regulator operating mode (defined in regulator.h) */ | ||
46 | int (*set_mode) (struct regulator_dev *, unsigned int mode); | ||
47 | unsigned int (*get_mode) (struct regulator_dev *); | ||
48 | |||
49 | /* get most efficient regulator operating mode for load */ | ||
50 | unsigned int (*get_optimum_mode) (struct regulator_dev *, int input_uV, | ||
51 | int output_uV, int load_uA); | ||
52 | |||
53 | /* the operations below are for configuration of regulator state when | ||
54 | * it's parent PMIC enters a global STANBY/HIBERNATE state */ | ||
55 | |||
56 | /* set regulator suspend voltage */ | ||
57 | int (*set_suspend_voltage) (struct regulator_dev *, int uV); | ||
58 | |||
59 | /* enable/disable regulator in suspend state */ | ||
60 | int (*set_suspend_enable) (struct regulator_dev *); | ||
61 | int (*set_suspend_disable) (struct regulator_dev *); | ||
62 | |||
63 | /* set regulator suspend operating mode (defined in regulator.h) */ | ||
64 | int (*set_suspend_mode) (struct regulator_dev *, unsigned int mode); | ||
65 | }; | ||
66 | |||
67 | /* | ||
68 | * Regulators can either control voltage or current. | ||
69 | */ | ||
70 | enum regulator_type { | ||
71 | REGULATOR_VOLTAGE, | ||
72 | REGULATOR_CURRENT, | ||
73 | }; | ||
74 | |||
75 | /** | ||
76 | * struct regulator_desc - Regulator descriptor | ||
77 | * | ||
78 | */ | ||
79 | struct regulator_desc { | ||
80 | const char *name; | ||
81 | int id; | ||
82 | struct regulator_ops *ops; | ||
83 | int irq; | ||
84 | enum regulator_type type; | ||
85 | struct module *owner; | ||
86 | }; | ||
87 | |||
88 | |||
89 | struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, | ||
90 | void *reg_data); | ||
91 | void regulator_unregister(struct regulator_dev *rdev); | ||
92 | |||
93 | int regulator_notifier_call_chain(struct regulator_dev *rdev, | ||
94 | unsigned long event, void *data); | ||
95 | |||
96 | void *rdev_get_drvdata(struct regulator_dev *rdev); | ||
97 | int rdev_get_id(struct regulator_dev *rdev); | ||
98 | |||
99 | #endif | ||
diff --git a/include/linux/regulator/fixed.h b/include/linux/regulator/fixed.h new file mode 100644 index 000000000000..1387a5d2190e --- /dev/null +++ b/include/linux/regulator/fixed.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * fixed.h | ||
3 | * | ||
4 | * Copyright 2008 Wolfson Microelectronics PLC. | ||
5 | * | ||
6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License as | ||
10 | * published by the Free Software Foundation; either version 2 of the | ||
11 | * License, or (at your option) any later version. | ||
12 | */ | ||
13 | |||
14 | #ifndef __REGULATOR_FIXED_H | ||
15 | #define __REGULATOR_FIXED_H | ||
16 | |||
17 | struct fixed_voltage_config { | ||
18 | const char *supply_name; | ||
19 | int microvolts; | ||
20 | }; | ||
21 | |||
22 | #endif | ||
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h new file mode 100644 index 000000000000..11e737dbfcf2 --- /dev/null +++ b/include/linux/regulator/machine.h | |||
@@ -0,0 +1,104 @@ | |||
1 | /* | ||
2 | * machine.h -- SoC Regulator support, machine/board driver API. | ||
3 | * | ||
4 | * Copyright (C) 2007, 2008 Wolfson Microelectronics PLC. | ||
5 | * | ||
6 | * Author: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | * Regulator Machine/Board Interface. | ||
13 | */ | ||
14 | |||
15 | #ifndef __LINUX_REGULATOR_MACHINE_H_ | ||
16 | #define __LINUX_REGULATOR_MACHINE_H_ | ||
17 | |||
18 | #include <linux/regulator/consumer.h> | ||
19 | #include <linux/suspend.h> | ||
20 | |||
21 | struct regulator; | ||
22 | |||
23 | /* | ||
24 | * Regulator operation constraint flags. These flags are used to enable | ||
25 | * certain regulator operations and can be OR'ed together. | ||
26 | * | ||
27 | * VOLTAGE: Regulator output voltage can be changed by software on this | ||
28 | * board/machine. | ||
29 | * CURRENT: Regulator output current can be changed by software on this | ||
30 | * board/machine. | ||
31 | * MODE: Regulator operating mode can be changed by software on this | ||
32 | * board/machine. | ||
33 | * STATUS: Regulator can be enabled and disabled. | ||
34 | * DRMS: Dynamic Regulator Mode Switching is enabled for this regulator. | ||
35 | */ | ||
36 | |||
37 | #define REGULATOR_CHANGE_VOLTAGE 0x1 | ||
38 | #define REGULATOR_CHANGE_CURRENT 0x2 | ||
39 | #define REGULATOR_CHANGE_MODE 0x4 | ||
40 | #define REGULATOR_CHANGE_STATUS 0x8 | ||
41 | #define REGULATOR_CHANGE_DRMS 0x10 | ||
42 | |||
43 | /** | ||
44 | * struct regulator_state - regulator state during low power syatem states | ||
45 | * | ||
46 | * This describes a regulators state during a system wide low power state. | ||
47 | */ | ||
48 | struct regulator_state { | ||
49 | int uV; /* suspend voltage */ | ||
50 | unsigned int mode; /* suspend regulator operating mode */ | ||
51 | int enabled; /* is regulator enabled in this suspend state */ | ||
52 | }; | ||
53 | |||
54 | /** | ||
55 | * struct regulation_constraints - regulator operating constraints. | ||
56 | * | ||
57 | * This struct describes regulator and board/machine specific constraints. | ||
58 | */ | ||
59 | struct regulation_constraints { | ||
60 | |||
61 | char *name; | ||
62 | |||
63 | /* voltage output range (inclusive) - for voltage control */ | ||
64 | int min_uV; | ||
65 | int max_uV; | ||
66 | |||
67 | /* current output range (inclusive) - for current control */ | ||
68 | int min_uA; | ||
69 | int max_uA; | ||
70 | |||
71 | /* valid regulator operating modes for this machine */ | ||
72 | unsigned int valid_modes_mask; | ||
73 | |||
74 | /* valid operations for regulator on this machine */ | ||
75 | unsigned int valid_ops_mask; | ||
76 | |||
77 | /* regulator input voltage - only if supply is another regulator */ | ||
78 | int input_uV; | ||
79 | |||
80 | /* regulator suspend states for global PMIC STANDBY/HIBERNATE */ | ||
81 | struct regulator_state state_disk; | ||
82 | struct regulator_state state_mem; | ||
83 | struct regulator_state state_standby; | ||
84 | suspend_state_t initial_state; /* suspend state to set at init */ | ||
85 | |||
86 | /* constriant flags */ | ||
87 | unsigned always_on:1; /* regulator never off when system is on */ | ||
88 | unsigned boot_on:1; /* bootloader/firmware enabled regulator */ | ||
89 | unsigned apply_uV:1; /* apply uV constraint iff min == max */ | ||
90 | }; | ||
91 | |||
92 | int regulator_set_supply(const char *regulator, const char *regulator_supply); | ||
93 | |||
94 | const char *regulator_get_supply(const char *regulator); | ||
95 | |||
96 | int regulator_set_machine_constraints(const char *regulator, | ||
97 | struct regulation_constraints *constraints); | ||
98 | |||
99 | int regulator_set_device_supply(const char *regulator, struct device *dev, | ||
100 | const char *supply); | ||
101 | |||
102 | int regulator_suspend_prepare(suspend_state_t state); | ||
103 | |||
104 | #endif | ||
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h index fdeadd9740dc..271c1c2c9f6f 100644 --- a/include/linux/res_counter.h +++ b/include/linux/res_counter.h | |||
@@ -166,7 +166,7 @@ static inline int res_counter_set_limit(struct res_counter *cnt, | |||
166 | int ret = -EBUSY; | 166 | int ret = -EBUSY; |
167 | 167 | ||
168 | spin_lock_irqsave(&cnt->lock, flags); | 168 | spin_lock_irqsave(&cnt->lock, flags); |
169 | if (cnt->usage < limit) { | 169 | if (cnt->usage <= limit) { |
170 | cnt->limit = limit; | 170 | cnt->limit = limit; |
171 | ret = 0; | 171 | ret = 0; |
172 | } | 172 | } |
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h index c5f6e54ec6ae..741d1a62cc3f 100644 --- a/include/linux/rfkill.h +++ b/include/linux/rfkill.h | |||
@@ -68,7 +68,8 @@ enum rfkill_state { | |||
68 | * @user_claim_unsupported: Whether the hardware supports exclusive | 68 | * @user_claim_unsupported: Whether the hardware supports exclusive |
69 | * RF-kill control by userspace. Set this before registering. | 69 | * RF-kill control by userspace. Set this before registering. |
70 | * @user_claim: Set when the switch is controlled exlusively by userspace. | 70 | * @user_claim: Set when the switch is controlled exlusively by userspace. |
71 | * @mutex: Guards switch state transitions | 71 | * @mutex: Guards switch state transitions. It serializes callbacks |
72 | * and also protects the state. | ||
72 | * @data: Pointer to the RF button drivers private data which will be | 73 | * @data: Pointer to the RF button drivers private data which will be |
73 | * passed along when toggling radio state. | 74 | * passed along when toggling radio state. |
74 | * @toggle_radio(): Mandatory handler to control state of the radio. | 75 | * @toggle_radio(): Mandatory handler to control state of the radio. |
@@ -89,12 +90,13 @@ struct rfkill { | |||
89 | const char *name; | 90 | const char *name; |
90 | enum rfkill_type type; | 91 | enum rfkill_type type; |
91 | 92 | ||
92 | enum rfkill_state state; | ||
93 | bool user_claim_unsupported; | 93 | bool user_claim_unsupported; |
94 | bool user_claim; | 94 | bool user_claim; |
95 | 95 | ||
96 | /* the mutex serializes callbacks and also protects | ||
97 | * the state */ | ||
96 | struct mutex mutex; | 98 | struct mutex mutex; |
97 | 99 | enum rfkill_state state; | |
98 | void *data; | 100 | void *data; |
99 | int (*toggle_radio)(void *data, enum rfkill_state state); | 101 | int (*toggle_radio)(void *data, enum rfkill_state state); |
100 | int (*get_state)(void *data, enum rfkill_state *state); | 102 | int (*get_state)(void *data, enum rfkill_state *state); |
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 69407f85e10b..fed6f5e0b411 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -102,7 +102,7 @@ int try_to_unmap(struct page *, int ignore_refs); | |||
102 | * Called from mm/filemap_xip.c to unmap empty zero page | 102 | * Called from mm/filemap_xip.c to unmap empty zero page |
103 | */ | 103 | */ |
104 | pte_t *page_check_address(struct page *, struct mm_struct *, | 104 | pte_t *page_check_address(struct page *, struct mm_struct *, |
105 | unsigned long, spinlock_t **); | 105 | unsigned long, spinlock_t **, int); |
106 | 106 | ||
107 | /* | 107 | /* |
108 | * Used by swapoff to help locate where page is expected in vma. | 108 | * Used by swapoff to help locate where page is expected in vma. |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 5270d449ff9d..3d9120c5ad15 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -87,6 +87,7 @@ struct sched_param { | |||
87 | #include <linux/task_io_accounting.h> | 87 | #include <linux/task_io_accounting.h> |
88 | #include <linux/kobject.h> | 88 | #include <linux/kobject.h> |
89 | #include <linux/latencytop.h> | 89 | #include <linux/latencytop.h> |
90 | #include <linux/cred.h> | ||
90 | 91 | ||
91 | #include <asm/processor.h> | 92 | #include <asm/processor.h> |
92 | 93 | ||
@@ -1474,6 +1475,10 @@ static inline void put_task_struct(struct task_struct *t) | |||
1474 | __put_task_struct(t); | 1475 | __put_task_struct(t); |
1475 | } | 1476 | } |
1476 | 1477 | ||
1478 | extern cputime_t task_utime(struct task_struct *p); | ||
1479 | extern cputime_t task_stime(struct task_struct *p); | ||
1480 | extern cputime_t task_gtime(struct task_struct *p); | ||
1481 | |||
1477 | /* | 1482 | /* |
1478 | * Per process flags | 1483 | * Per process flags |
1479 | */ | 1484 | */ |
@@ -1551,16 +1556,10 @@ static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask) | |||
1551 | 1556 | ||
1552 | extern unsigned long long sched_clock(void); | 1557 | extern unsigned long long sched_clock(void); |
1553 | 1558 | ||
1554 | #ifndef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK | 1559 | extern void sched_clock_init(void); |
1555 | static inline void sched_clock_init(void) | 1560 | 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 | 1561 | ||
1562 | #ifndef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK | ||
1564 | static inline void sched_clock_tick(void) | 1563 | static inline void sched_clock_tick(void) |
1565 | { | 1564 | { |
1566 | } | 1565 | } |
@@ -1572,28 +1571,11 @@ static inline void sched_clock_idle_sleep_event(void) | |||
1572 | static inline void sched_clock_idle_wakeup_event(u64 delta_ns) | 1571 | static inline void sched_clock_idle_wakeup_event(u64 delta_ns) |
1573 | { | 1572 | { |
1574 | } | 1573 | } |
1575 | 1574 | #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); | 1575 | extern void sched_clock_tick(void); |
1590 | extern void sched_clock_idle_sleep_event(void); | 1576 | extern void sched_clock_idle_sleep_event(void); |
1591 | extern void sched_clock_idle_wakeup_event(u64 delta_ns); | 1577 | 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 | 1578 | #endif |
1596 | #endif /* CONFIG_HAVE_UNSTABLE_SCHED_CLOCK */ | ||
1597 | 1579 | ||
1598 | /* | 1580 | /* |
1599 | * For kernel-internal use: high-speed (but slightly incorrect) per-cpu | 1581 | * For kernel-internal use: high-speed (but slightly incorrect) per-cpu |
diff --git a/include/linux/security.h b/include/linux/security.h index fd96e7f8a6f9..80c4d002864c 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -46,8 +46,8 @@ struct audit_krule; | |||
46 | */ | 46 | */ |
47 | extern int cap_capable(struct task_struct *tsk, int cap); | 47 | extern int cap_capable(struct task_struct *tsk, int cap); |
48 | extern int cap_settime(struct timespec *ts, struct timezone *tz); | 48 | extern int cap_settime(struct timespec *ts, struct timezone *tz); |
49 | extern int cap_ptrace(struct task_struct *parent, struct task_struct *child, | 49 | extern int cap_ptrace_may_access(struct task_struct *child, unsigned int mode); |
50 | unsigned int mode); | 50 | extern int cap_ptrace_traceme(struct task_struct *parent); |
51 | extern int cap_capget(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted); | 51 | extern int cap_capget(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted); |
52 | extern int cap_capset_check(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted); | 52 | extern int cap_capset_check(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted); |
53 | extern void cap_capset_set(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted); | 53 | extern void cap_capset_set(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted); |
@@ -1157,17 +1157,24 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
1157 | * @alter contains the flag indicating whether changes are to be made. | 1157 | * @alter contains the flag indicating whether changes are to be made. |
1158 | * Return 0 if permission is granted. | 1158 | * Return 0 if permission is granted. |
1159 | * | 1159 | * |
1160 | * @ptrace: | 1160 | * @ptrace_may_access: |
1161 | * Check permission before allowing the @parent process to trace the | 1161 | * Check permission before allowing the current process to trace the |
1162 | * @child process. | 1162 | * @child process. |
1163 | * Security modules may also want to perform a process tracing check | 1163 | * Security modules may also want to perform a process tracing check |
1164 | * during an execve in the set_security or apply_creds hooks of | 1164 | * during an execve in the set_security or apply_creds hooks of |
1165 | * binprm_security_ops if the process is being traced and its security | 1165 | * binprm_security_ops if the process is being traced and its security |
1166 | * attributes would be changed by the execve. | 1166 | * attributes would be changed by the execve. |
1167 | * @parent contains the task_struct structure for parent process. | 1167 | * @child contains the task_struct structure for the target process. |
1168 | * @child contains the task_struct structure for child process. | ||
1169 | * @mode contains the PTRACE_MODE flags indicating the form of access. | 1168 | * @mode contains the PTRACE_MODE flags indicating the form of access. |
1170 | * Return 0 if permission is granted. | 1169 | * Return 0 if permission is granted. |
1170 | * @ptrace_traceme: | ||
1171 | * Check that the @parent process has sufficient permission to trace the | ||
1172 | * current process before allowing the current process to present itself | ||
1173 | * to the @parent process for tracing. | ||
1174 | * The parent process will still have to undergo the ptrace_may_access | ||
1175 | * checks before it is allowed to trace this one. | ||
1176 | * @parent contains the task_struct structure for debugger process. | ||
1177 | * Return 0 if permission is granted. | ||
1171 | * @capget: | 1178 | * @capget: |
1172 | * Get the @effective, @inheritable, and @permitted capability sets for | 1179 | * Get the @effective, @inheritable, and @permitted capability sets for |
1173 | * the @target process. The hook may also perform permission checking to | 1180 | * the @target process. The hook may also perform permission checking to |
@@ -1287,8 +1294,8 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
1287 | struct security_operations { | 1294 | struct security_operations { |
1288 | char name[SECURITY_NAME_MAX + 1]; | 1295 | char name[SECURITY_NAME_MAX + 1]; |
1289 | 1296 | ||
1290 | int (*ptrace) (struct task_struct *parent, struct task_struct *child, | 1297 | int (*ptrace_may_access) (struct task_struct *child, unsigned int mode); |
1291 | unsigned int mode); | 1298 | int (*ptrace_traceme) (struct task_struct *parent); |
1292 | int (*capget) (struct task_struct *target, | 1299 | int (*capget) (struct task_struct *target, |
1293 | kernel_cap_t *effective, | 1300 | kernel_cap_t *effective, |
1294 | kernel_cap_t *inheritable, kernel_cap_t *permitted); | 1301 | kernel_cap_t *inheritable, kernel_cap_t *permitted); |
@@ -1560,8 +1567,8 @@ extern struct dentry *securityfs_create_dir(const char *name, struct dentry *par | |||
1560 | extern void securityfs_remove(struct dentry *dentry); | 1567 | extern void securityfs_remove(struct dentry *dentry); |
1561 | 1568 | ||
1562 | /* Security operations */ | 1569 | /* Security operations */ |
1563 | int security_ptrace(struct task_struct *parent, struct task_struct *child, | 1570 | int security_ptrace_may_access(struct task_struct *child, unsigned int mode); |
1564 | unsigned int mode); | 1571 | int security_ptrace_traceme(struct task_struct *parent); |
1565 | int security_capget(struct task_struct *target, | 1572 | int security_capget(struct task_struct *target, |
1566 | kernel_cap_t *effective, | 1573 | kernel_cap_t *effective, |
1567 | kernel_cap_t *inheritable, | 1574 | kernel_cap_t *inheritable, |
@@ -1742,11 +1749,15 @@ static inline int security_init(void) | |||
1742 | return 0; | 1749 | return 0; |
1743 | } | 1750 | } |
1744 | 1751 | ||
1745 | static inline int security_ptrace(struct task_struct *parent, | 1752 | static inline int security_ptrace_may_access(struct task_struct *child, |
1746 | struct task_struct *child, | 1753 | unsigned int mode) |
1747 | unsigned int mode) | 1754 | { |
1755 | return cap_ptrace_may_access(child, mode); | ||
1756 | } | ||
1757 | |||
1758 | static inline int security_ptrace_traceme(struct task_struct *parent) | ||
1748 | { | 1759 | { |
1749 | return cap_ptrace(parent, child, mode); | 1760 | return cap_ptrace_traceme(parent); |
1750 | } | 1761 | } |
1751 | 1762 | ||
1752 | static inline int security_capget(struct task_struct *target, | 1763 | static inline int security_capget(struct task_struct *target, |
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/skbuff.h b/include/linux/skbuff.h index 7ea44f6621f2..909923717830 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -243,6 +243,7 @@ typedef unsigned char *sk_buff_data_t; | |||
243 | * @tc_index: Traffic control index | 243 | * @tc_index: Traffic control index |
244 | * @tc_verd: traffic control verdict | 244 | * @tc_verd: traffic control verdict |
245 | * @ndisc_nodetype: router type (from link layer) | 245 | * @ndisc_nodetype: router type (from link layer) |
246 | * @do_not_encrypt: set to prevent encryption of this frame | ||
246 | * @dma_cookie: a cookie to one of several possible DMA operations | 247 | * @dma_cookie: a cookie to one of several possible DMA operations |
247 | * done by skb DMA functions | 248 | * done by skb DMA functions |
248 | * @secmark: security marking | 249 | * @secmark: security marking |
@@ -316,7 +317,10 @@ struct sk_buff { | |||
316 | #ifdef CONFIG_IPV6_NDISC_NODETYPE | 317 | #ifdef CONFIG_IPV6_NDISC_NODETYPE |
317 | __u8 ndisc_nodetype:2; | 318 | __u8 ndisc_nodetype:2; |
318 | #endif | 319 | #endif |
319 | /* 14 bit hole */ | 320 | #if defined(CONFIG_MAC80211) || defined(CONFIG_MAC80211_MODULE) |
321 | __u8 do_not_encrypt:1; | ||
322 | #endif | ||
323 | /* 0/13/14 bit hole */ | ||
320 | 324 | ||
321 | #ifdef CONFIG_NET_DMA | 325 | #ifdef CONFIG_NET_DMA |
322 | dma_cookie_t dma_cookie; | 326 | dma_cookie_t dma_cookie; |
@@ -897,7 +901,7 @@ extern unsigned char *__pskb_pull_tail(struct sk_buff *skb, int delta); | |||
897 | static inline unsigned char *__pskb_pull(struct sk_buff *skb, unsigned int len) | 901 | static inline unsigned char *__pskb_pull(struct sk_buff *skb, unsigned int len) |
898 | { | 902 | { |
899 | if (len > skb_headlen(skb) && | 903 | if (len > skb_headlen(skb) && |
900 | !__pskb_pull_tail(skb, len-skb_headlen(skb))) | 904 | !__pskb_pull_tail(skb, len - skb_headlen(skb))) |
901 | return NULL; | 905 | return NULL; |
902 | skb->len -= len; | 906 | skb->len -= len; |
903 | return skb->data += len; | 907 | return skb->data += len; |
@@ -914,7 +918,7 @@ static inline int pskb_may_pull(struct sk_buff *skb, unsigned int len) | |||
914 | return 1; | 918 | return 1; |
915 | if (unlikely(len > skb->len)) | 919 | if (unlikely(len > skb->len)) |
916 | return 0; | 920 | return 0; |
917 | return __pskb_pull_tail(skb, len-skb_headlen(skb)) != NULL; | 921 | return __pskb_pull_tail(skb, len - skb_headlen(skb)) != NULL; |
918 | } | 922 | } |
919 | 923 | ||
920 | /** | 924 | /** |
@@ -1317,7 +1321,7 @@ static inline int skb_padto(struct sk_buff *skb, unsigned int len) | |||
1317 | unsigned int size = skb->len; | 1321 | unsigned int size = skb->len; |
1318 | if (likely(size >= len)) | 1322 | if (likely(size >= len)) |
1319 | return 0; | 1323 | return 0; |
1320 | return skb_pad(skb, len-size); | 1324 | return skb_pad(skb, len - size); |
1321 | } | 1325 | } |
1322 | 1326 | ||
1323 | static inline int skb_add_data(struct sk_buff *skb, | 1327 | static inline int skb_add_data(struct sk_buff *skb, |
@@ -1448,6 +1452,10 @@ extern int skb_copy_datagram_iovec(const struct sk_buff *from, | |||
1448 | extern int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb, | 1452 | extern int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb, |
1449 | int hlen, | 1453 | int hlen, |
1450 | struct iovec *iov); | 1454 | struct iovec *iov); |
1455 | extern int skb_copy_datagram_from_iovec(struct sk_buff *skb, | ||
1456 | int offset, | ||
1457 | struct iovec *from, | ||
1458 | int len); | ||
1451 | extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); | 1459 | extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); |
1452 | extern int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, | 1460 | extern int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, |
1453 | unsigned int flags); | 1461 | unsigned int flags); |
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/snmp.h b/include/linux/snmp.h index 5df62ef1280c..7a6e6bba4a71 100644 --- a/include/linux/snmp.h +++ b/include/linux/snmp.h | |||
@@ -214,6 +214,8 @@ enum | |||
214 | LINUX_MIB_TCPDSACKIGNOREDOLD, /* TCPSACKIgnoredOld */ | 214 | LINUX_MIB_TCPDSACKIGNOREDOLD, /* TCPSACKIgnoredOld */ |
215 | LINUX_MIB_TCPDSACKIGNOREDNOUNDO, /* TCPSACKIgnoredNoUndo */ | 215 | LINUX_MIB_TCPDSACKIGNOREDNOUNDO, /* TCPSACKIgnoredNoUndo */ |
216 | LINUX_MIB_TCPSPURIOUSRTOS, /* TCPSpuriousRTOs */ | 216 | LINUX_MIB_TCPSPURIOUSRTOS, /* TCPSpuriousRTOs */ |
217 | LINUX_MIB_TCPMD5NOTFOUND, /* TCPMD5NotFound */ | ||
218 | LINUX_MIB_TCPMD5UNEXPECTED, /* TCPMD5Unexpected */ | ||
217 | __LINUX_MIB_MAX | 219 | __LINUX_MIB_MAX |
218 | }; | 220 | }; |
219 | 221 | ||
diff --git a/include/linux/spi/orion_spi.h b/include/linux/spi/orion_spi.h new file mode 100644 index 000000000000..b4d9fa6f797c --- /dev/null +++ b/include/linux/spi/orion_spi.h | |||
@@ -0,0 +1,17 @@ | |||
1 | /* | ||
2 | * orion_spi.h | ||
3 | * | ||
4 | * This file is licensed under the terms of the GNU General Public | ||
5 | * License version 2. This program is licensed "as is" without any | ||
6 | * warranty of any kind, whether express or implied. | ||
7 | */ | ||
8 | |||
9 | #ifndef __LINUX_SPI_ORION_SPI_H | ||
10 | #define __LINUX_SPI_ORION_SPI_H | ||
11 | |||
12 | struct orion_spi_info { | ||
13 | u32 tclk; /* no <linux/clk.h> support yet */ | ||
14 | }; | ||
15 | |||
16 | |||
17 | #endif | ||
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 61e5610ad165..e0c0fccced46 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
@@ -183,8 +183,14 @@ do { \ | |||
183 | 183 | ||
184 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 184 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
185 | # define spin_lock_nested(lock, subclass) _spin_lock_nested(lock, subclass) | 185 | # define spin_lock_nested(lock, subclass) _spin_lock_nested(lock, subclass) |
186 | # define spin_lock_nest_lock(lock, nest_lock) \ | ||
187 | do { \ | ||
188 | typecheck(struct lockdep_map *, &(nest_lock)->dep_map);\ | ||
189 | _spin_lock_nest_lock(lock, &(nest_lock)->dep_map); \ | ||
190 | } while (0) | ||
186 | #else | 191 | #else |
187 | # define spin_lock_nested(lock, subclass) _spin_lock(lock) | 192 | # define spin_lock_nested(lock, subclass) _spin_lock(lock) |
193 | # define spin_lock_nest_lock(lock, nest_lock) _spin_lock(lock) | ||
188 | #endif | 194 | #endif |
189 | 195 | ||
190 | #define write_lock(lock) _write_lock(lock) | 196 | #define write_lock(lock) _write_lock(lock) |
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h index 8a2307ce7296..d79845d034b5 100644 --- a/include/linux/spinlock_api_smp.h +++ b/include/linux/spinlock_api_smp.h | |||
@@ -22,6 +22,8 @@ int in_lock_functions(unsigned long addr); | |||
22 | void __lockfunc _spin_lock(spinlock_t *lock) __acquires(lock); | 22 | void __lockfunc _spin_lock(spinlock_t *lock) __acquires(lock); |
23 | void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass) | 23 | void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass) |
24 | __acquires(lock); | 24 | __acquires(lock); |
25 | void __lockfunc _spin_lock_nest_lock(spinlock_t *lock, struct lockdep_map *map) | ||
26 | __acquires(lock); | ||
25 | void __lockfunc _read_lock(rwlock_t *lock) __acquires(lock); | 27 | void __lockfunc _read_lock(rwlock_t *lock) __acquires(lock); |
26 | void __lockfunc _write_lock(rwlock_t *lock) __acquires(lock); | 28 | void __lockfunc _write_lock(rwlock_t *lock) __acquires(lock); |
27 | void __lockfunc _spin_lock_bh(spinlock_t *lock) __acquires(lock); | 29 | void __lockfunc _spin_lock_bh(spinlock_t *lock) __acquires(lock); |
diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h index f1cb0ba6d715..faf1519b5adc 100644 --- a/include/linux/stop_machine.h +++ b/include/linux/stop_machine.h | |||
@@ -3,16 +3,13 @@ | |||
3 | /* "Bogolock": stop the entire machine, disable interrupts. This is a | 3 | /* "Bogolock": stop the entire machine, disable interrupts. This is a |
4 | very heavy lock, which is equivalent to grabbing every spinlock | 4 | very heavy lock, which is equivalent to grabbing every spinlock |
5 | (and more). So the "read" side to such a lock is anything which | 5 | (and more). So the "read" side to such a lock is anything which |
6 | diables preeempt. */ | 6 | disables preeempt. */ |
7 | #include <linux/cpu.h> | 7 | #include <linux/cpu.h> |
8 | #include <linux/cpumask.h> | 8 | #include <linux/cpumask.h> |
9 | #include <asm/system.h> | 9 | #include <asm/system.h> |
10 | 10 | ||
11 | #if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP) | 11 | #if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP) |
12 | 12 | ||
13 | /* Deprecated, but useful for transition. */ | ||
14 | #define ALL_CPUS ~0U | ||
15 | |||
16 | /** | 13 | /** |
17 | * stop_machine: freeze the machine on all CPUs and run this function | 14 | * stop_machine: freeze the machine on all CPUs and run this function |
18 | * @fn: the function to run | 15 | * @fn: the function to run |
@@ -50,18 +47,4 @@ static inline int stop_machine(int (*fn)(void *), void *data, | |||
50 | return ret; | 47 | return ret; |
51 | } | 48 | } |
52 | #endif /* CONFIG_SMP */ | 49 | #endif /* CONFIG_SMP */ |
53 | |||
54 | static inline int __deprecated stop_machine_run(int (*fn)(void *), void *data, | ||
55 | unsigned int cpu) | ||
56 | { | ||
57 | /* If they don't care which cpu fn runs on, just pick one. */ | ||
58 | if (cpu == NR_CPUS) | ||
59 | return stop_machine(fn, data, NULL); | ||
60 | else if (cpu == ~0U) | ||
61 | return stop_machine(fn, data, &cpu_possible_map); | ||
62 | else { | ||
63 | cpumask_t cpus = cpumask_of_cpu(cpu); | ||
64 | return stop_machine(fn, data, &cpus); | ||
65 | } | ||
66 | } | ||
67 | #endif /* _LINUX_STOP_MACHINE */ | 50 | #endif /* _LINUX_STOP_MACHINE */ |
diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h index ef2e3a20bf3b..dc05b54bd3a3 100644 --- a/include/linux/sunrpc/svc_rdma.h +++ b/include/linux/sunrpc/svc_rdma.h | |||
@@ -143,7 +143,6 @@ struct svcxprt_rdma { | |||
143 | unsigned long sc_flags; | 143 | unsigned long sc_flags; |
144 | struct list_head sc_dto_q; /* DTO tasklet I/O pending Q */ | 144 | struct list_head sc_dto_q; /* DTO tasklet I/O pending Q */ |
145 | struct list_head sc_read_complete_q; | 145 | struct list_head sc_read_complete_q; |
146 | spinlock_t sc_read_complete_lock; | ||
147 | struct work_struct sc_work; | 146 | struct work_struct sc_work; |
148 | }; | 147 | }; |
149 | /* sc_flags */ | 148 | /* sc_flags */ |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index c63435095970..2ce8207686e2 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -217,11 +217,11 @@ struct platform_hibernation_ops { | |||
217 | #ifdef CONFIG_HIBERNATION | 217 | #ifdef CONFIG_HIBERNATION |
218 | /* kernel/power/snapshot.c */ | 218 | /* kernel/power/snapshot.c */ |
219 | extern void __register_nosave_region(unsigned long b, unsigned long e, int km); | 219 | extern void __register_nosave_region(unsigned long b, unsigned long e, int km); |
220 | static inline void register_nosave_region(unsigned long b, unsigned long e) | 220 | static inline void __init register_nosave_region(unsigned long b, unsigned long e) |
221 | { | 221 | { |
222 | __register_nosave_region(b, e, 0); | 222 | __register_nosave_region(b, e, 0); |
223 | } | 223 | } |
224 | static inline void register_nosave_region_late(unsigned long b, unsigned long e) | 224 | static inline void __init register_nosave_region_late(unsigned long b, unsigned long e) |
225 | { | 225 | { |
226 | __register_nosave_region(b, e, 1); | 226 | __register_nosave_region(b, e, 1); |
227 | } | 227 | } |
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 */ | ||
diff --git a/include/linux/tick.h b/include/linux/tick.h index d3c02695dc5d..8cf8cfe2cc97 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h | |||
@@ -74,10 +74,13 @@ extern struct tick_device *tick_get_device(int cpu); | |||
74 | extern int tick_init_highres(void); | 74 | extern int tick_init_highres(void); |
75 | extern int tick_program_event(ktime_t expires, int force); | 75 | extern int tick_program_event(ktime_t expires, int force); |
76 | extern void tick_setup_sched_timer(void); | 76 | extern void tick_setup_sched_timer(void); |
77 | # endif | ||
78 | |||
79 | # if defined CONFIG_NO_HZ || defined CONFIG_HIGH_RES_TIMERS | ||
77 | extern void tick_cancel_sched_timer(int cpu); | 80 | extern void tick_cancel_sched_timer(int cpu); |
78 | # else | 81 | # else |
79 | static inline void tick_cancel_sched_timer(int cpu) { } | 82 | static inline void tick_cancel_sched_timer(int cpu) { } |
80 | # endif /* HIGHRES */ | 83 | # endif |
81 | 84 | ||
82 | # ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST | 85 | # ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST |
83 | extern struct tick_device *tick_get_broadcast_device(void); | 86 | extern struct tick_device *tick_get_broadcast_device(void); |
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h index b1875582c1a1..6186a789d6c7 100644 --- a/include/linux/tracehook.h +++ b/include/linux/tracehook.h | |||
@@ -272,7 +272,7 @@ static inline void tracehook_finish_clone(struct task_struct *child, | |||
272 | * tracehook_report_clone_complete(). This must prevent the child from | 272 | * tracehook_report_clone_complete(). This must prevent the child from |
273 | * self-reaping if tracehook_report_clone_complete() uses the @child | 273 | * self-reaping if tracehook_report_clone_complete() uses the @child |
274 | * pointer; otherwise it might have died and been released by the time | 274 | * pointer; otherwise it might have died and been released by the time |
275 | * tracehook_report_report_clone_complete() is called. | 275 | * tracehook_report_clone_complete() is called. |
276 | * | 276 | * |
277 | * Called with no locks held, but the child cannot run until this returns. | 277 | * Called with no locks held, but the child cannot run until this returns. |
278 | */ | 278 | */ |
@@ -280,7 +280,7 @@ static inline void tracehook_report_clone(int trace, struct pt_regs *regs, | |||
280 | unsigned long clone_flags, | 280 | unsigned long clone_flags, |
281 | pid_t pid, struct task_struct *child) | 281 | pid_t pid, struct task_struct *child) |
282 | { | 282 | { |
283 | if (unlikely(trace)) { | 283 | if (unlikely(trace) || unlikely(clone_flags & CLONE_PTRACE)) { |
284 | /* | 284 | /* |
285 | * The child starts up with an immediate SIGSTOP. | 285 | * The child starts up with an immediate SIGSTOP. |
286 | */ | 286 | */ |
@@ -487,14 +487,20 @@ static inline int tracehook_notify_jctl(int notify, int why) | |||
487 | return notify || (current->ptrace & PT_PTRACED); | 487 | return notify || (current->ptrace & PT_PTRACED); |
488 | } | 488 | } |
489 | 489 | ||
490 | #define DEATH_REAP -1 | ||
491 | #define DEATH_DELAYED_GROUP_LEADER -2 | ||
492 | |||
490 | /** | 493 | /** |
491 | * tracehook_notify_death - task is dead, ready to notify parent | 494 | * tracehook_notify_death - task is dead, ready to notify parent |
492 | * @task: @current task now exiting | 495 | * @task: @current task now exiting |
493 | * @death_cookie: value to pass to tracehook_report_death() | 496 | * @death_cookie: value to pass to tracehook_report_death() |
494 | * @group_dead: nonzero if this was the last thread in the group to die | 497 | * @group_dead: nonzero if this was the last thread in the group to die |
495 | * | 498 | * |
496 | * Return the signal number to send our parent with do_notify_parent(), or | 499 | * A return value >= 0 means call do_notify_parent() with that signal |
497 | * zero to send no signal and leave a zombie, or -1 to self-reap right now. | 500 | * number. Negative return value can be %DEATH_REAP to self-reap right |
501 | * now, or %DEATH_DELAYED_GROUP_LEADER to a zombie without notifying our | ||
502 | * parent. Note that a return value of 0 means a do_notify_parent() call | ||
503 | * that sends no signal, but still wakes up a parent blocked in wait*(). | ||
498 | * | 504 | * |
499 | * Called with write_lock_irq(&tasklist_lock) held. | 505 | * Called with write_lock_irq(&tasklist_lock) held. |
500 | */ | 506 | */ |
@@ -502,7 +508,7 @@ static inline int tracehook_notify_death(struct task_struct *task, | |||
502 | void **death_cookie, int group_dead) | 508 | void **death_cookie, int group_dead) |
503 | { | 509 | { |
504 | if (task->exit_signal == -1) | 510 | if (task->exit_signal == -1) |
505 | return task->ptrace ? SIGCHLD : -1; | 511 | return task->ptrace ? SIGCHLD : DEATH_REAP; |
506 | 512 | ||
507 | /* | 513 | /* |
508 | * If something other than our normal parent is ptracing us, then | 514 | * If something other than our normal parent is ptracing us, then |
@@ -512,21 +518,21 @@ static inline int tracehook_notify_death(struct task_struct *task, | |||
512 | if (thread_group_empty(task) && !ptrace_reparented(task)) | 518 | if (thread_group_empty(task) && !ptrace_reparented(task)) |
513 | return task->exit_signal; | 519 | return task->exit_signal; |
514 | 520 | ||
515 | return task->ptrace ? SIGCHLD : 0; | 521 | return task->ptrace ? SIGCHLD : DEATH_DELAYED_GROUP_LEADER; |
516 | } | 522 | } |
517 | 523 | ||
518 | /** | 524 | /** |
519 | * tracehook_report_death - task is dead and ready to be reaped | 525 | * tracehook_report_death - task is dead and ready to be reaped |
520 | * @task: @current task now exiting | 526 | * @task: @current task now exiting |
521 | * @signal: signal number sent to parent, or 0 or -1 | 527 | * @signal: return value from tracheook_notify_death() |
522 | * @death_cookie: value passed back from tracehook_notify_death() | 528 | * @death_cookie: value passed back from tracehook_notify_death() |
523 | * @group_dead: nonzero if this was the last thread in the group to die | 529 | * @group_dead: nonzero if this was the last thread in the group to die |
524 | * | 530 | * |
525 | * Thread has just become a zombie or is about to self-reap. If positive, | 531 | * Thread has just become a zombie or is about to self-reap. If positive, |
526 | * @signal is the signal number just sent to the parent (usually %SIGCHLD). | 532 | * @signal is the signal number just sent to the parent (usually %SIGCHLD). |
527 | * If @signal is -1, this thread will self-reap. If @signal is 0, this is | 533 | * If @signal is %DEATH_REAP, this thread will self-reap. If @signal is |
528 | * a delayed_group_leader() zombie. The @death_cookie was passed back by | 534 | * %DEATH_DELAYED_GROUP_LEADER, this is a delayed_group_leader() zombie. |
529 | * tracehook_notify_death(). | 535 | * The @death_cookie was passed back by tracehook_notify_death(). |
530 | * | 536 | * |
531 | * If normal reaping is not inhibited, @task->exit_state might be changing | 537 | * If normal reaping is not inhibited, @task->exit_state might be changing |
532 | * in parallel. | 538 | * in parallel. |
diff --git a/include/linux/tty.h b/include/linux/tty.h index e3579cb086e0..0cbec74ec086 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -331,6 +331,8 @@ extern int tty_write_room(struct tty_struct *tty); | |||
331 | extern void tty_driver_flush_buffer(struct tty_struct *tty); | 331 | extern void tty_driver_flush_buffer(struct tty_struct *tty); |
332 | extern void tty_throttle(struct tty_struct *tty); | 332 | extern void tty_throttle(struct tty_struct *tty); |
333 | extern void tty_unthrottle(struct tty_struct *tty); | 333 | extern void tty_unthrottle(struct tty_struct *tty); |
334 | extern int tty_do_resize(struct tty_struct *tty, struct tty_struct *real_tty, | ||
335 | struct winsize *ws); | ||
334 | 336 | ||
335 | extern int is_current_pgrp_orphaned(void); | 337 | extern int is_current_pgrp_orphaned(void); |
336 | extern struct pid *tty_get_pgrp(struct tty_struct *tty); | 338 | extern struct pid *tty_get_pgrp(struct tty_struct *tty); |
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index e1065ac0d922..16d27944c321 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h | |||
@@ -168,6 +168,18 @@ | |||
168 | * | 168 | * |
169 | * Optional: If not provided then the write method is called under | 169 | * Optional: If not provided then the write method is called under |
170 | * the atomic write lock to keep it serialized with the ldisc. | 170 | * the atomic write lock to keep it serialized with the ldisc. |
171 | * | ||
172 | * int (*resize)(struct tty_struct *tty, struct tty_struct *real_tty, | ||
173 | * unsigned int rows, unsigned int cols); | ||
174 | * | ||
175 | * Called when a termios request is issued which changes the | ||
176 | * requested terminal geometry. | ||
177 | * | ||
178 | * Optional: the default action is to update the termios structure | ||
179 | * without error. This is usually the correct behaviour. Drivers should | ||
180 | * not force errors here if they are not resizable objects (eg a serial | ||
181 | * line). See tty_do_resize() if you need to wrap the standard method | ||
182 | * in your own logic - the usual case. | ||
171 | */ | 183 | */ |
172 | 184 | ||
173 | #include <linux/fs.h> | 185 | #include <linux/fs.h> |
@@ -206,6 +218,8 @@ struct tty_operations { | |||
206 | int (*tiocmget)(struct tty_struct *tty, struct file *file); | 218 | int (*tiocmget)(struct tty_struct *tty, struct file *file); |
207 | int (*tiocmset)(struct tty_struct *tty, struct file *file, | 219 | int (*tiocmset)(struct tty_struct *tty, struct file *file, |
208 | unsigned int set, unsigned int clear); | 220 | unsigned int set, unsigned int clear); |
221 | int (*resize)(struct tty_struct *tty, struct tty_struct *real_tty, | ||
222 | struct winsize *ws); | ||
209 | #ifdef CONFIG_CONSOLE_POLL | 223 | #ifdef CONFIG_CONSOLE_POLL |
210 | int (*poll_init)(struct tty_driver *driver, int line, char *options); | 224 | int (*poll_init)(struct tty_driver *driver, int line, char *options); |
211 | int (*poll_get_char)(struct tty_driver *driver, int line); | 225 | int (*poll_get_char)(struct tty_driver *driver, int line); |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 5811c5da69f9..94ac74aba6b6 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -110,6 +110,10 @@ enum usb_interface_condition { | |||
110 | * @sysfs_files_created: sysfs attributes exist | 110 | * @sysfs_files_created: sysfs attributes exist |
111 | * @needs_remote_wakeup: flag set when the driver requires remote-wakeup | 111 | * @needs_remote_wakeup: flag set when the driver requires remote-wakeup |
112 | * capability during autosuspend. | 112 | * capability during autosuspend. |
113 | * @needs_altsetting0: flag set when a set-interface request for altsetting 0 | ||
114 | * has been deferred. | ||
115 | * @needs_binding: flag set when the driver should be re-probed or unbound | ||
116 | * following a reset or suspend operation it doesn't support. | ||
113 | * @dev: driver model's view of this device | 117 | * @dev: driver model's view of this device |
114 | * @usb_dev: if an interface is bound to the USB major, this will point | 118 | * @usb_dev: if an interface is bound to the USB major, this will point |
115 | * to the sysfs representation for that device. | 119 | * to the sysfs representation for that device. |
@@ -160,6 +164,7 @@ struct usb_interface { | |||
160 | unsigned is_active:1; /* the interface is not suspended */ | 164 | unsigned is_active:1; /* the interface is not suspended */ |
161 | unsigned sysfs_files_created:1; /* the sysfs attributes exist */ | 165 | unsigned sysfs_files_created:1; /* the sysfs attributes exist */ |
162 | unsigned needs_remote_wakeup:1; /* driver requires remote wakeup */ | 166 | unsigned needs_remote_wakeup:1; /* driver requires remote wakeup */ |
167 | unsigned needs_altsetting0:1; /* switch to altsetting 0 is pending */ | ||
163 | unsigned needs_binding:1; /* needs delayed unbind/rebind */ | 168 | unsigned needs_binding:1; /* needs delayed unbind/rebind */ |
164 | 169 | ||
165 | struct device dev; /* interface specific device info */ | 170 | struct device dev; /* interface specific device info */ |
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h new file mode 100644 index 000000000000..630962c04ca4 --- /dev/null +++ b/include/linux/usb/musb.h | |||
@@ -0,0 +1,98 @@ | |||
1 | /* | ||
2 | * This is used to for host and peripheral modes of the driver for | ||
3 | * Inventra (Multidrop) Highspeed Dual-Role Controllers: (M)HDRC. | ||
4 | * | ||
5 | * Board initialization should put one of these into dev->platform_data, | ||
6 | * probably on some platform_device named "musb_hdrc". It encapsulates | ||
7 | * key configuration differences between boards. | ||
8 | */ | ||
9 | |||
10 | /* The USB role is defined by the connector used on the board, so long as | ||
11 | * standards are being followed. (Developer boards sometimes won't.) | ||
12 | */ | ||
13 | enum musb_mode { | ||
14 | MUSB_UNDEFINED = 0, | ||
15 | MUSB_HOST, /* A or Mini-A connector */ | ||
16 | MUSB_PERIPHERAL, /* B or Mini-B connector */ | ||
17 | MUSB_OTG /* Mini-AB connector */ | ||
18 | }; | ||
19 | |||
20 | struct clk; | ||
21 | |||
22 | struct musb_hdrc_eps_bits { | ||
23 | const char name[16]; | ||
24 | u8 bits; | ||
25 | }; | ||
26 | |||
27 | struct musb_hdrc_config { | ||
28 | /* MUSB configuration-specific details */ | ||
29 | unsigned multipoint:1; /* multipoint device */ | ||
30 | unsigned dyn_fifo:1; /* supports dynamic fifo sizing */ | ||
31 | unsigned soft_con:1; /* soft connect required */ | ||
32 | unsigned utm_16:1; /* utm data witdh is 16 bits */ | ||
33 | unsigned big_endian:1; /* true if CPU uses big-endian */ | ||
34 | unsigned mult_bulk_tx:1; /* Tx ep required for multbulk pkts */ | ||
35 | unsigned mult_bulk_rx:1; /* Rx ep required for multbulk pkts */ | ||
36 | unsigned high_iso_tx:1; /* Tx ep required for HB iso */ | ||
37 | unsigned high_iso_rx:1; /* Rx ep required for HD iso */ | ||
38 | unsigned dma:1; /* supports DMA */ | ||
39 | unsigned vendor_req:1; /* vendor registers required */ | ||
40 | |||
41 | u8 num_eps; /* number of endpoints _with_ ep0 */ | ||
42 | u8 dma_channels; /* number of dma channels */ | ||
43 | u8 dyn_fifo_size; /* dynamic size in bytes */ | ||
44 | u8 vendor_ctrl; /* vendor control reg width */ | ||
45 | u8 vendor_stat; /* vendor status reg witdh */ | ||
46 | u8 dma_req_chan; /* bitmask for required dma channels */ | ||
47 | u8 ram_bits; /* ram address size */ | ||
48 | |||
49 | struct musb_hdrc_eps_bits *eps_bits; | ||
50 | }; | ||
51 | |||
52 | struct musb_hdrc_platform_data { | ||
53 | /* MUSB_HOST, MUSB_PERIPHERAL, or MUSB_OTG */ | ||
54 | u8 mode; | ||
55 | |||
56 | /* for clk_get() */ | ||
57 | const char *clock; | ||
58 | |||
59 | /* (HOST or OTG) switch VBUS on/off */ | ||
60 | int (*set_vbus)(struct device *dev, int is_on); | ||
61 | |||
62 | /* (HOST or OTG) mA/2 power supplied on (default = 8mA) */ | ||
63 | u8 power; | ||
64 | |||
65 | /* (PERIPHERAL) mA/2 max power consumed (default = 100mA) */ | ||
66 | u8 min_power; | ||
67 | |||
68 | /* (HOST or OTG) msec/2 after VBUS on till power good */ | ||
69 | u8 potpgt; | ||
70 | |||
71 | /* Power the device on or off */ | ||
72 | int (*set_power)(int state); | ||
73 | |||
74 | /* Turn device clock on or off */ | ||
75 | int (*set_clock)(struct clk *clock, int is_on); | ||
76 | |||
77 | /* MUSB configuration-specific details */ | ||
78 | struct musb_hdrc_config *config; | ||
79 | }; | ||
80 | |||
81 | |||
82 | /* TUSB 6010 support */ | ||
83 | |||
84 | #define TUSB6010_OSCCLK_60 16667 /* psec/clk @ 60.0 MHz */ | ||
85 | #define TUSB6010_REFCLK_24 41667 /* psec/clk @ 24.0 MHz XI */ | ||
86 | #define TUSB6010_REFCLK_19 52083 /* psec/clk @ 19.2 MHz CLKIN */ | ||
87 | |||
88 | #ifdef CONFIG_ARCH_OMAP2 | ||
89 | |||
90 | extern int __init tusb6010_setup_interface( | ||
91 | struct musb_hdrc_platform_data *data, | ||
92 | unsigned ps_refclk, unsigned waitpin, | ||
93 | unsigned async_cs, unsigned sync_cs, | ||
94 | unsigned irq, unsigned dmachan); | ||
95 | |||
96 | extern int tusb6010_platform_retime(unsigned is_refclk); | ||
97 | |||
98 | #endif /* OMAP2 */ | ||
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 09a3e6a7518f..655341d0f534 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -17,7 +17,8 @@ | |||
17 | #include <linux/mutex.h> | 17 | #include <linux/mutex.h> |
18 | 18 | ||
19 | #define SERIAL_TTY_MAJOR 188 /* Nice legal number now */ | 19 | #define SERIAL_TTY_MAJOR 188 /* Nice legal number now */ |
20 | #define SERIAL_TTY_MINORS 255 /* loads of devices :) */ | 20 | #define SERIAL_TTY_MINORS 254 /* loads of devices :) */ |
21 | #define SERIAL_TTY_NO_MINOR 255 /* No minor was assigned */ | ||
21 | 22 | ||
22 | /* The maximum number of ports one device can grab at once */ | 23 | /* The maximum number of ports one device can grab at once */ |
23 | #define MAX_NUM_PORTS 8 | 24 | #define MAX_NUM_PORTS 8 |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index e466bd54a50e..303d93ffd6b2 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -55,13 +55,13 @@ | |||
55 | */ | 55 | */ |
56 | #ifndef __LINUX_VIDEODEV2_H | 56 | #ifndef __LINUX_VIDEODEV2_H |
57 | #define __LINUX_VIDEODEV2_H | 57 | #define __LINUX_VIDEODEV2_H |
58 | |||
58 | #ifdef __KERNEL__ | 59 | #ifdef __KERNEL__ |
59 | #include <linux/time.h> /* need struct timeval */ | 60 | #include <linux/time.h> /* need struct timeval */ |
60 | #include <linux/compiler.h> /* need __user */ | ||
61 | #else | 61 | #else |
62 | #define __user | ||
63 | #include <sys/time.h> | 62 | #include <sys/time.h> |
64 | #endif | 63 | #endif |
64 | #include <linux/compiler.h> | ||
65 | #include <linux/ioctl.h> | 65 | #include <linux/ioctl.h> |
66 | #include <linux/types.h> | 66 | #include <linux/types.h> |
67 | 67 | ||
@@ -334,6 +334,8 @@ struct v4l2_pix_format { | |||
334 | #define V4L2_PIX_FMT_SPCA508 v4l2_fourcc('S', '5', '0', '8') /* YUVY per line */ | 334 | #define V4L2_PIX_FMT_SPCA508 v4l2_fourcc('S', '5', '0', '8') /* YUVY per line */ |
335 | #define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */ | 335 | #define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */ |
336 | #define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */ | 336 | #define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */ |
337 | #define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ | ||
338 | #define V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */ | ||
337 | 339 | ||
338 | /* | 340 | /* |
339 | * F O R M A T E N U M E R A T I O N | 341 | * F O R M A T E N U M E R A T I O N |
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 364789aae9f3..328eb4022727 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
@@ -4,9 +4,9 @@ | |||
4 | #include <linux/spinlock.h> | 4 | #include <linux/spinlock.h> |
5 | #include <asm/page.h> /* pgprot_t */ | 5 | #include <asm/page.h> /* pgprot_t */ |
6 | 6 | ||
7 | struct vm_area_struct; | 7 | struct vm_area_struct; /* vma defining user mapping in mm_types.h */ |
8 | 8 | ||
9 | /* bits in vm_struct->flags */ | 9 | /* bits in flags of vmalloc's vm_struct below */ |
10 | #define VM_IOREMAP 0x00000001 /* ioremap() and friends */ | 10 | #define VM_IOREMAP 0x00000001 /* ioremap() and friends */ |
11 | #define VM_ALLOC 0x00000002 /* vmalloc() */ | 11 | #define VM_ALLOC 0x00000002 /* vmalloc() */ |
12 | #define VM_MAP 0x00000004 /* vmap()ed pages */ | 12 | #define VM_MAP 0x00000004 /* vmap()ed pages */ |
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index 14c0e91be9b5..1cbd0a7db4e6 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h | |||
@@ -35,7 +35,6 @@ extern int fg_console, last_console, want_console; | |||
35 | int vc_allocate(unsigned int console); | 35 | int vc_allocate(unsigned int console); |
36 | int vc_cons_allocated(unsigned int console); | 36 | int vc_cons_allocated(unsigned int console); |
37 | int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines); | 37 | int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines); |
38 | int vc_lock_resize(struct vc_data *vc, unsigned int cols, unsigned int lines); | ||
39 | void vc_deallocate(unsigned int console); | 38 | void vc_deallocate(unsigned int console); |
40 | void reset_palette(struct vc_data *vc); | 39 | void reset_palette(struct vc_data *vc); |
41 | void do_blank_screen(int entering_gfx); | 40 | void do_blank_screen(int entering_gfx); |
@@ -74,7 +73,7 @@ void con_protect_unimap(struct vc_data *vc, int rdonly); | |||
74 | int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc); | 73 | int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc); |
75 | 74 | ||
76 | #define vc_translate(vc, c) ((vc)->vc_translate[(c) | \ | 75 | #define vc_translate(vc, c) ((vc)->vc_translate[(c) | \ |
77 | (vc)->vc_toggle_meta ? 0x80 : 0]) | 76 | ((vc)->vc_toggle_meta ? 0x80 : 0)]) |
78 | #else | 77 | #else |
79 | #define con_set_trans_old(arg) (0) | 78 | #define con_set_trans_old(arg) (0) |
80 | #define con_get_trans_old(arg) (-EINVAL) | 79 | #define con_get_trans_old(arg) (-EINVAL) |
@@ -86,6 +85,7 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc); | |||
86 | #define con_copy_unimap(d, s) (0) | 85 | #define con_copy_unimap(d, s) (0) |
87 | #define con_get_unimap(vc, ct, uct, list) (-EINVAL) | 86 | #define con_get_unimap(vc, ct, uct, list) (-EINVAL) |
88 | #define con_free_unimap(vc) do { ; } while (0) | 87 | #define con_free_unimap(vc) do { ; } while (0) |
88 | #define con_protect_unimap(vc, rdonly) do { ; } while (0) | ||
89 | 89 | ||
90 | #define vc_translate(vc, c) (c) | 90 | #define vc_translate(vc, c) (c) |
91 | #endif | 91 | #endif |