diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-07-03 10:25:08 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-07-03 10:25:08 -0400 |
commit | 0a1340c185734a57fbf4775927966ad4a1347b02 (patch) | |
tree | d9ed8f0dd809a7c542a3356601125ea5b5aaa804 /include/linux | |
parent | af18ddb8864b096e3ed4732e2d4b21c956dcfe3a (diff) | |
parent | 29454dde27d8e340bb1987bad9aa504af7081eba (diff) |
Merge rsync://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
include/linux/kernel.h
Diffstat (limited to 'include/linux')
296 files changed, 5284 insertions, 2580 deletions
diff --git a/include/linux/ac97_codec.h b/include/linux/ac97_codec.h index c35833824e11..2ed2fd855133 100644 --- a/include/linux/ac97_codec.h +++ b/include/linux/ac97_codec.h | |||
@@ -259,7 +259,7 @@ struct ac97_codec { | |||
259 | int type; | 259 | int type; |
260 | u32 model; | 260 | u32 model; |
261 | 261 | ||
262 | int modem:1; | 262 | unsigned int modem:1; |
263 | 263 | ||
264 | struct ac97_ops *codec_ops; | 264 | struct ac97_ops *codec_ops; |
265 | 265 | ||
diff --git a/include/linux/acct.h b/include/linux/acct.h index 9a66401073fc..e86bae7324d2 100644 --- a/include/linux/acct.h +++ b/include/linux/acct.h | |||
@@ -16,7 +16,6 @@ | |||
16 | #define _LINUX_ACCT_H | 16 | #define _LINUX_ACCT_H |
17 | 17 | ||
18 | #include <linux/types.h> | 18 | #include <linux/types.h> |
19 | #include <linux/jiffies.h> | ||
20 | 19 | ||
21 | #include <asm/param.h> | 20 | #include <asm/param.h> |
22 | #include <asm/byteorder.h> | 21 | #include <asm/byteorder.h> |
@@ -116,20 +115,23 @@ struct acct_v3 | |||
116 | 115 | ||
117 | #ifdef __KERNEL__ | 116 | #ifdef __KERNEL__ |
118 | 117 | ||
119 | #include <linux/config.h> | ||
120 | 118 | ||
121 | #ifdef CONFIG_BSD_PROCESS_ACCT | 119 | #ifdef CONFIG_BSD_PROCESS_ACCT |
122 | struct vfsmount; | 120 | struct vfsmount; |
123 | struct super_block; | 121 | struct super_block; |
124 | extern void acct_auto_close_mnt(struct vfsmount *m); | 122 | extern void acct_auto_close_mnt(struct vfsmount *m); |
125 | extern void acct_auto_close(struct super_block *sb); | 123 | extern void acct_auto_close(struct super_block *sb); |
126 | extern void acct_process(long exitcode); | 124 | extern void acct_init_pacct(struct pacct_struct *pacct); |
125 | extern void acct_collect(long exitcode, int group_dead); | ||
126 | extern void acct_process(void); | ||
127 | extern void acct_update_integrals(struct task_struct *tsk); | 127 | extern void acct_update_integrals(struct task_struct *tsk); |
128 | extern void acct_clear_integrals(struct task_struct *tsk); | 128 | extern void acct_clear_integrals(struct task_struct *tsk); |
129 | #else | 129 | #else |
130 | #define acct_auto_close_mnt(x) do { } while (0) | 130 | #define acct_auto_close_mnt(x) do { } while (0) |
131 | #define acct_auto_close(x) do { } while (0) | 131 | #define acct_auto_close(x) do { } while (0) |
132 | #define acct_process(x) do { } while (0) | 132 | #define acct_init_pacct(x) do { } while (0) |
133 | #define acct_collect(x,y) do { } while (0) | ||
134 | #define acct_process() do { } while (0) | ||
133 | #define acct_update_integrals(x) do { } while (0) | 135 | #define acct_update_integrals(x) do { } while (0) |
134 | #define acct_clear_integrals(task) do { } while (0) | 136 | #define acct_clear_integrals(task) do { } while (0) |
135 | #endif | 137 | #endif |
@@ -165,6 +167,7 @@ typedef struct acct acct_t; | |||
165 | #endif /* __KERNEL */ | 167 | #endif /* __KERNEL */ |
166 | 168 | ||
167 | #ifdef __KERNEL__ | 169 | #ifdef __KERNEL__ |
170 | #include <linux/jiffies.h> | ||
168 | /* | 171 | /* |
169 | * Yet another set of HZ to *HZ helper functions. | 172 | * Yet another set of HZ to *HZ helper functions. |
170 | * See <linux/jiffies.h> for the original. | 173 | * See <linux/jiffies.h> for the original. |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index d3bc25e6d27d..88b5dfd8ee12 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -25,7 +25,6 @@ | |||
25 | #ifndef _LINUX_ACPI_H | 25 | #ifndef _LINUX_ACPI_H |
26 | #define _LINUX_ACPI_H | 26 | #define _LINUX_ACPI_H |
27 | 27 | ||
28 | #include <linux/config.h> | ||
29 | 28 | ||
30 | #ifdef CONFIG_ACPI | 29 | #ifdef CONFIG_ACPI |
31 | 30 | ||
@@ -38,6 +37,7 @@ | |||
38 | #include <acpi/acpi.h> | 37 | #include <acpi/acpi.h> |
39 | #include <acpi/acpi_bus.h> | 38 | #include <acpi/acpi_bus.h> |
40 | #include <acpi/acpi_drivers.h> | 39 | #include <acpi/acpi_drivers.h> |
40 | #include <acpi/acpi_numa.h> | ||
41 | #include <asm/acpi.h> | 41 | #include <asm/acpi.h> |
42 | 42 | ||
43 | 43 | ||
@@ -408,10 +408,18 @@ void acpi_table_print_madt_entry (acpi_table_entry_header *madt); | |||
408 | void acpi_table_print_srat_entry (acpi_table_entry_header *srat); | 408 | void acpi_table_print_srat_entry (acpi_table_entry_header *srat); |
409 | 409 | ||
410 | /* the following four functions are architecture-dependent */ | 410 | /* the following four functions are architecture-dependent */ |
411 | #ifdef CONFIG_HAVE_ARCH_PARSE_SRAT | ||
412 | #define NR_NODE_MEMBLKS MAX_NUMNODES | ||
413 | #define acpi_numa_slit_init(slit) do {} while (0) | ||
414 | #define acpi_numa_processor_affinity_init(pa) do {} while (0) | ||
415 | #define acpi_numa_memory_affinity_init(ma) do {} while (0) | ||
416 | #define acpi_numa_arch_fixup() do {} while (0) | ||
417 | #else | ||
411 | void acpi_numa_slit_init (struct acpi_table_slit *slit); | 418 | void acpi_numa_slit_init (struct acpi_table_slit *slit); |
412 | void acpi_numa_processor_affinity_init (struct acpi_table_processor_affinity *pa); | 419 | void acpi_numa_processor_affinity_init (struct acpi_table_processor_affinity *pa); |
413 | void acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma); | 420 | void acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma); |
414 | void acpi_numa_arch_fixup(void); | 421 | void acpi_numa_arch_fixup(void); |
422 | #endif | ||
415 | 423 | ||
416 | #ifdef CONFIG_ACPI_HOTPLUG_CPU | 424 | #ifdef CONFIG_ACPI_HOTPLUG_CPU |
417 | /* Arch dependent functions for cpu hotplug support */ | 425 | /* Arch dependent functions for cpu hotplug support */ |
@@ -520,12 +528,18 @@ static inline void acpi_set_cstate_limit(unsigned int new_limit) { return; } | |||
520 | 528 | ||
521 | #ifdef CONFIG_ACPI_NUMA | 529 | #ifdef CONFIG_ACPI_NUMA |
522 | int acpi_get_pxm(acpi_handle handle); | 530 | int acpi_get_pxm(acpi_handle handle); |
531 | int acpi_get_node(acpi_handle *handle); | ||
523 | #else | 532 | #else |
524 | static inline int acpi_get_pxm(acpi_handle handle) | 533 | static inline int acpi_get_pxm(acpi_handle handle) |
525 | { | 534 | { |
526 | return 0; | 535 | return 0; |
527 | } | 536 | } |
537 | static inline int acpi_get_node(acpi_handle *handle) | ||
538 | { | ||
539 | return 0; | ||
540 | } | ||
528 | #endif | 541 | #endif |
542 | extern int acpi_paddr_to_node(u64 start_addr, u64 size); | ||
529 | 543 | ||
530 | extern int pnpacpi_disabled; | 544 | extern int pnpacpi_disabled; |
531 | 545 | ||
diff --git a/include/linux/affs_hardblocks.h b/include/linux/affs_hardblocks.h index 3fb869939d82..f1b948c1f592 100644 --- a/include/linux/affs_hardblocks.h +++ b/include/linux/affs_hardblocks.h | |||
@@ -1,45 +1,47 @@ | |||
1 | #ifndef AFFS_HARDBLOCKS_H | 1 | #ifndef AFFS_HARDBLOCKS_H |
2 | #define AFFS_HARDBLOCKS_H | 2 | #define AFFS_HARDBLOCKS_H |
3 | 3 | ||
4 | #include <linux/types.h> | ||
5 | |||
4 | /* Just the needed definitions for the RDB of an Amiga HD. */ | 6 | /* Just the needed definitions for the RDB of an Amiga HD. */ |
5 | 7 | ||
6 | struct RigidDiskBlock { | 8 | struct RigidDiskBlock { |
7 | u32 rdb_ID; | 9 | __u32 rdb_ID; |
8 | __be32 rdb_SummedLongs; | 10 | __be32 rdb_SummedLongs; |
9 | s32 rdb_ChkSum; | 11 | __s32 rdb_ChkSum; |
10 | u32 rdb_HostID; | 12 | __u32 rdb_HostID; |
11 | __be32 rdb_BlockBytes; | 13 | __be32 rdb_BlockBytes; |
12 | u32 rdb_Flags; | 14 | __u32 rdb_Flags; |
13 | u32 rdb_BadBlockList; | 15 | __u32 rdb_BadBlockList; |
14 | __be32 rdb_PartitionList; | 16 | __be32 rdb_PartitionList; |
15 | u32 rdb_FileSysHeaderList; | 17 | __u32 rdb_FileSysHeaderList; |
16 | u32 rdb_DriveInit; | 18 | __u32 rdb_DriveInit; |
17 | u32 rdb_Reserved1[6]; | 19 | __u32 rdb_Reserved1[6]; |
18 | u32 rdb_Cylinders; | 20 | __u32 rdb_Cylinders; |
19 | u32 rdb_Sectors; | 21 | __u32 rdb_Sectors; |
20 | u32 rdb_Heads; | 22 | __u32 rdb_Heads; |
21 | u32 rdb_Interleave; | 23 | __u32 rdb_Interleave; |
22 | u32 rdb_Park; | 24 | __u32 rdb_Park; |
23 | u32 rdb_Reserved2[3]; | 25 | __u32 rdb_Reserved2[3]; |
24 | u32 rdb_WritePreComp; | 26 | __u32 rdb_WritePreComp; |
25 | u32 rdb_ReducedWrite; | 27 | __u32 rdb_ReducedWrite; |
26 | u32 rdb_StepRate; | 28 | __u32 rdb_StepRate; |
27 | u32 rdb_Reserved3[5]; | 29 | __u32 rdb_Reserved3[5]; |
28 | u32 rdb_RDBBlocksLo; | 30 | __u32 rdb_RDBBlocksLo; |
29 | u32 rdb_RDBBlocksHi; | 31 | __u32 rdb_RDBBlocksHi; |
30 | u32 rdb_LoCylinder; | 32 | __u32 rdb_LoCylinder; |
31 | u32 rdb_HiCylinder; | 33 | __u32 rdb_HiCylinder; |
32 | u32 rdb_CylBlocks; | 34 | __u32 rdb_CylBlocks; |
33 | u32 rdb_AutoParkSeconds; | 35 | __u32 rdb_AutoParkSeconds; |
34 | u32 rdb_HighRDSKBlock; | 36 | __u32 rdb_HighRDSKBlock; |
35 | u32 rdb_Reserved4; | 37 | __u32 rdb_Reserved4; |
36 | char rdb_DiskVendor[8]; | 38 | char rdb_DiskVendor[8]; |
37 | char rdb_DiskProduct[16]; | 39 | char rdb_DiskProduct[16]; |
38 | char rdb_DiskRevision[4]; | 40 | char rdb_DiskRevision[4]; |
39 | char rdb_ControllerVendor[8]; | 41 | char rdb_ControllerVendor[8]; |
40 | char rdb_ControllerProduct[16]; | 42 | char rdb_ControllerProduct[16]; |
41 | char rdb_ControllerRevision[4]; | 43 | char rdb_ControllerRevision[4]; |
42 | u32 rdb_Reserved5[10]; | 44 | __u32 rdb_Reserved5[10]; |
43 | }; | 45 | }; |
44 | 46 | ||
45 | #define IDNAME_RIGIDDISK 0x5244534B /* "RDSK" */ | 47 | #define IDNAME_RIGIDDISK 0x5244534B /* "RDSK" */ |
@@ -47,16 +49,16 @@ struct RigidDiskBlock { | |||
47 | struct PartitionBlock { | 49 | struct PartitionBlock { |
48 | __be32 pb_ID; | 50 | __be32 pb_ID; |
49 | __be32 pb_SummedLongs; | 51 | __be32 pb_SummedLongs; |
50 | s32 pb_ChkSum; | 52 | __s32 pb_ChkSum; |
51 | u32 pb_HostID; | 53 | __u32 pb_HostID; |
52 | __be32 pb_Next; | 54 | __be32 pb_Next; |
53 | u32 pb_Flags; | 55 | __u32 pb_Flags; |
54 | u32 pb_Reserved1[2]; | 56 | __u32 pb_Reserved1[2]; |
55 | u32 pb_DevFlags; | 57 | __u32 pb_DevFlags; |
56 | u8 pb_DriveName[32]; | 58 | __u8 pb_DriveName[32]; |
57 | u32 pb_Reserved2[15]; | 59 | __u32 pb_Reserved2[15]; |
58 | __be32 pb_Environment[17]; | 60 | __be32 pb_Environment[17]; |
59 | u32 pb_EReserved[15]; | 61 | __u32 pb_EReserved[15]; |
60 | }; | 62 | }; |
61 | 63 | ||
62 | #define IDNAME_PARTITION 0x50415254 /* "PART" */ | 64 | #define IDNAME_PARTITION 0x50415254 /* "PART" */ |
diff --git a/include/linux/agpgart.h b/include/linux/agpgart.h index 6d59c8efe3be..bfb8ec791b7b 100644 --- a/include/linux/agpgart.h +++ b/include/linux/agpgart.h | |||
@@ -27,8 +27,6 @@ | |||
27 | #ifndef _AGP_H | 27 | #ifndef _AGP_H |
28 | #define _AGP_H 1 | 28 | #define _AGP_H 1 |
29 | 29 | ||
30 | #include <linux/agp_backend.h> | ||
31 | |||
32 | #define AGPIOC_BASE 'A' | 30 | #define AGPIOC_BASE 'A' |
33 | #define AGPIOC_INFO _IOR (AGPIOC_BASE, 0, struct agp_info*) | 31 | #define AGPIOC_INFO _IOR (AGPIOC_BASE, 0, struct agp_info*) |
34 | #define AGPIOC_ACQUIRE _IO (AGPIOC_BASE, 1) | 32 | #define AGPIOC_ACQUIRE _IO (AGPIOC_BASE, 1) |
@@ -112,6 +110,7 @@ typedef struct _agp_unbind { | |||
112 | 110 | ||
113 | #else /* __KERNEL__ */ | 111 | #else /* __KERNEL__ */ |
114 | #include <linux/mutex.h> | 112 | #include <linux/mutex.h> |
113 | #include <linux/agp_backend.h> | ||
115 | 114 | ||
116 | #define AGPGART_MINOR 175 | 115 | #define AGPGART_MINOR 175 |
117 | 116 | ||
diff --git a/include/linux/amba/clcd.h b/include/linux/amba/clcd.h index 9cf64b1b688b..29c0448265cf 100644 --- a/include/linux/amba/clcd.h +++ b/include/linux/amba/clcd.h | |||
@@ -9,7 +9,6 @@ | |||
9 | * License. See the file COPYING in the main directory of this archive | 9 | * License. See the file COPYING in the main directory of this archive |
10 | * for more details. | 10 | * for more details. |
11 | */ | 11 | */ |
12 | #include <linux/config.h> | ||
13 | #include <linux/fb.h> | 12 | #include <linux/fb.h> |
14 | 13 | ||
15 | /* | 14 | /* |
diff --git a/include/linux/ata.h b/include/linux/ata.h index 312a2c0c64e6..3671af869696 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -97,6 +97,9 @@ enum { | |||
97 | ATA_DRQ = (1 << 3), /* data request i/o */ | 97 | ATA_DRQ = (1 << 3), /* data request i/o */ |
98 | ATA_ERR = (1 << 0), /* have an error */ | 98 | ATA_ERR = (1 << 0), /* have an error */ |
99 | ATA_SRST = (1 << 2), /* software reset */ | 99 | ATA_SRST = (1 << 2), /* software reset */ |
100 | ATA_ICRC = (1 << 7), /* interface CRC error */ | ||
101 | ATA_UNC = (1 << 6), /* uncorrectable media error */ | ||
102 | ATA_IDNF = (1 << 4), /* ID not found */ | ||
100 | ATA_ABORTED = (1 << 2), /* command aborted */ | 103 | ATA_ABORTED = (1 << 2), /* command aborted */ |
101 | 104 | ||
102 | /* ATA command block registers */ | 105 | /* ATA command block registers */ |
@@ -130,6 +133,8 @@ enum { | |||
130 | ATA_CMD_WRITE = 0xCA, | 133 | ATA_CMD_WRITE = 0xCA, |
131 | ATA_CMD_WRITE_EXT = 0x35, | 134 | ATA_CMD_WRITE_EXT = 0x35, |
132 | ATA_CMD_WRITE_FUA_EXT = 0x3D, | 135 | ATA_CMD_WRITE_FUA_EXT = 0x3D, |
136 | ATA_CMD_FPDMA_READ = 0x60, | ||
137 | ATA_CMD_FPDMA_WRITE = 0x61, | ||
133 | ATA_CMD_PIO_READ = 0x20, | 138 | ATA_CMD_PIO_READ = 0x20, |
134 | ATA_CMD_PIO_READ_EXT = 0x24, | 139 | ATA_CMD_PIO_READ_EXT = 0x24, |
135 | ATA_CMD_PIO_WRITE = 0x30, | 140 | ATA_CMD_PIO_WRITE = 0x30, |
@@ -148,6 +153,10 @@ enum { | |||
148 | ATA_CMD_INIT_DEV_PARAMS = 0x91, | 153 | ATA_CMD_INIT_DEV_PARAMS = 0x91, |
149 | ATA_CMD_READ_NATIVE_MAX = 0xF8, | 154 | ATA_CMD_READ_NATIVE_MAX = 0xF8, |
150 | ATA_CMD_READ_NATIVE_MAX_EXT = 0x27, | 155 | ATA_CMD_READ_NATIVE_MAX_EXT = 0x27, |
156 | ATA_CMD_READ_LOG_EXT = 0x2f, | ||
157 | |||
158 | /* READ_LOG_EXT pages */ | ||
159 | ATA_LOG_SATA_NCQ = 0x10, | ||
151 | 160 | ||
152 | /* SETFEATURES stuff */ | 161 | /* SETFEATURES stuff */ |
153 | SETFEATURES_XFER = 0x03, | 162 | SETFEATURES_XFER = 0x03, |
@@ -172,6 +181,9 @@ enum { | |||
172 | XFER_PIO_0 = 0x08, | 181 | XFER_PIO_0 = 0x08, |
173 | XFER_PIO_SLOW = 0x00, | 182 | XFER_PIO_SLOW = 0x00, |
174 | 183 | ||
184 | SETFEATURES_WC_ON = 0x02, /* Enable write cache */ | ||
185 | SETFEATURES_WC_OFF = 0x82, /* Disable write cache */ | ||
186 | |||
175 | /* ATAPI stuff */ | 187 | /* ATAPI stuff */ |
176 | ATAPI_PKT_DMA = (1 << 0), | 188 | ATAPI_PKT_DMA = (1 << 0), |
177 | ATAPI_DMADIR = (1 << 2), /* ATAPI data dir: | 189 | ATAPI_DMADIR = (1 << 2), /* ATAPI data dir: |
@@ -192,6 +204,16 @@ enum { | |||
192 | SCR_ACTIVE = 3, | 204 | SCR_ACTIVE = 3, |
193 | SCR_NOTIFICATION = 4, | 205 | SCR_NOTIFICATION = 4, |
194 | 206 | ||
207 | /* SError bits */ | ||
208 | SERR_DATA_RECOVERED = (1 << 0), /* recovered data error */ | ||
209 | SERR_COMM_RECOVERED = (1 << 1), /* recovered comm failure */ | ||
210 | SERR_DATA = (1 << 8), /* unrecovered data error */ | ||
211 | SERR_PERSISTENT = (1 << 9), /* persistent data/comm error */ | ||
212 | SERR_PROTOCOL = (1 << 10), /* protocol violation */ | ||
213 | SERR_INTERNAL = (1 << 11), /* host internal error */ | ||
214 | SERR_PHYRDY_CHG = (1 << 16), /* PHY RDY changed */ | ||
215 | SERR_DEV_XCHG = (1 << 26), /* device exchanged */ | ||
216 | |||
195 | /* struct ata_taskfile flags */ | 217 | /* struct ata_taskfile flags */ |
196 | ATA_TFLAG_LBA48 = (1 << 0), /* enable 48-bit LBA and "HOB" */ | 218 | ATA_TFLAG_LBA48 = (1 << 0), /* enable 48-bit LBA and "HOB" */ |
197 | ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */ | 219 | ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */ |
@@ -199,6 +221,7 @@ enum { | |||
199 | ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */ | 221 | ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */ |
200 | ATA_TFLAG_LBA = (1 << 4), /* enable LBA */ | 222 | ATA_TFLAG_LBA = (1 << 4), /* enable LBA */ |
201 | ATA_TFLAG_FUA = (1 << 5), /* enable FUA */ | 223 | ATA_TFLAG_FUA = (1 << 5), /* enable FUA */ |
224 | ATA_TFLAG_POLLING = (1 << 6), /* set nIEN to 1 and use polling */ | ||
202 | }; | 225 | }; |
203 | 226 | ||
204 | enum ata_tf_protocols { | 227 | enum ata_tf_protocols { |
@@ -207,6 +230,7 @@ enum ata_tf_protocols { | |||
207 | ATA_PROT_NODATA, /* no data */ | 230 | ATA_PROT_NODATA, /* no data */ |
208 | ATA_PROT_PIO, /* PIO single sector */ | 231 | ATA_PROT_PIO, /* PIO single sector */ |
209 | ATA_PROT_DMA, /* DMA */ | 232 | ATA_PROT_DMA, /* DMA */ |
233 | ATA_PROT_NCQ, /* NCQ */ | ||
210 | ATA_PROT_ATAPI, /* packet command, PIO data xfer*/ | 234 | ATA_PROT_ATAPI, /* packet command, PIO data xfer*/ |
211 | ATA_PROT_ATAPI_NODATA, /* packet command, no data */ | 235 | ATA_PROT_ATAPI_NODATA, /* packet command, no data */ |
212 | ATA_PROT_ATAPI_DMA, /* packet command with special DMA sauce */ | 236 | ATA_PROT_ATAPI_DMA, /* packet command with special DMA sauce */ |
@@ -262,6 +286,8 @@ struct ata_taskfile { | |||
262 | #define ata_id_has_pm(id) ((id)[82] & (1 << 3)) | 286 | #define ata_id_has_pm(id) ((id)[82] & (1 << 3)) |
263 | #define ata_id_has_lba(id) ((id)[49] & (1 << 9)) | 287 | #define ata_id_has_lba(id) ((id)[49] & (1 << 9)) |
264 | #define ata_id_has_dma(id) ((id)[49] & (1 << 8)) | 288 | #define ata_id_has_dma(id) ((id)[49] & (1 << 8)) |
289 | #define ata_id_has_ncq(id) ((id)[76] & (1 << 8)) | ||
290 | #define ata_id_queue_depth(id) (((id)[75] & 0x1f) + 1) | ||
265 | #define ata_id_removeable(id) ((id)[0] & (1 << 7)) | 291 | #define ata_id_removeable(id) ((id)[0] & (1 << 7)) |
266 | #define ata_id_has_dword_io(id) ((id)[50] & (1 << 0)) | 292 | #define ata_id_has_dword_io(id) ((id)[50] & (1 << 0)) |
267 | #define ata_id_u32(id,n) \ | 293 | #define ata_id_u32(id,n) \ |
@@ -272,6 +298,8 @@ struct ata_taskfile { | |||
272 | ((u64) (id)[(n) + 1] << 16) | \ | 298 | ((u64) (id)[(n) + 1] << 16) | \ |
273 | ((u64) (id)[(n) + 0]) ) | 299 | ((u64) (id)[(n) + 0]) ) |
274 | 300 | ||
301 | #define ata_id_cdb_intr(id) (((id)[0] & 0x60) == 0x20) | ||
302 | |||
275 | static inline unsigned int ata_id_major_version(const u16 *id) | 303 | static inline unsigned int ata_id_major_version(const u16 *id) |
276 | { | 304 | { |
277 | unsigned int mver; | 305 | unsigned int mver; |
@@ -311,6 +339,15 @@ static inline int is_atapi_taskfile(const struct ata_taskfile *tf) | |||
311 | (tf->protocol == ATA_PROT_ATAPI_DMA); | 339 | (tf->protocol == ATA_PROT_ATAPI_DMA); |
312 | } | 340 | } |
313 | 341 | ||
342 | static inline int is_multi_taskfile(struct ata_taskfile *tf) | ||
343 | { | ||
344 | return (tf->command == ATA_CMD_READ_MULTI) || | ||
345 | (tf->command == ATA_CMD_WRITE_MULTI) || | ||
346 | (tf->command == ATA_CMD_READ_MULTI_EXT) || | ||
347 | (tf->command == ATA_CMD_WRITE_MULTI_EXT) || | ||
348 | (tf->command == ATA_CMD_WRITE_MULTI_FUA_EXT); | ||
349 | } | ||
350 | |||
314 | static inline int ata_ok(u8 status) | 351 | static inline int ata_ok(u8 status) |
315 | { | 352 | { |
316 | return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR)) | 353 | return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR)) |
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h index b203ea82a0a8..41788a31c438 100644 --- a/include/linux/atmdev.h +++ b/include/linux/atmdev.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #define LINUX_ATMDEV_H | 7 | #define LINUX_ATMDEV_H |
8 | 8 | ||
9 | 9 | ||
10 | #include <linux/device.h> | ||
10 | #include <linux/atmapi.h> | 11 | #include <linux/atmapi.h> |
11 | #include <linux/atm.h> | 12 | #include <linux/atm.h> |
12 | #include <linux/atmioc.h> | 13 | #include <linux/atmioc.h> |
@@ -209,7 +210,6 @@ struct atm_cirange { | |||
209 | 210 | ||
210 | #ifdef __KERNEL__ | 211 | #ifdef __KERNEL__ |
211 | 212 | ||
212 | #include <linux/config.h> | ||
213 | #include <linux/wait.h> /* wait_queue_head_t */ | 213 | #include <linux/wait.h> /* wait_queue_head_t */ |
214 | #include <linux/time.h> /* struct timeval */ | 214 | #include <linux/time.h> /* struct timeval */ |
215 | #include <linux/net.h> | 215 | #include <linux/net.h> |
@@ -359,6 +359,7 @@ struct atm_dev { | |||
359 | struct proc_dir_entry *proc_entry; /* proc entry */ | 359 | struct proc_dir_entry *proc_entry; /* proc entry */ |
360 | char *proc_name; /* proc entry name */ | 360 | char *proc_name; /* proc entry name */ |
361 | #endif | 361 | #endif |
362 | struct class_device class_dev; /* sysfs class device */ | ||
362 | struct list_head dev_list; /* linkage */ | 363 | struct list_head dev_list; /* linkage */ |
363 | }; | 364 | }; |
364 | 365 | ||
@@ -460,7 +461,7 @@ static inline void atm_dev_put(struct atm_dev *dev) | |||
460 | BUG_ON(!test_bit(ATM_DF_REMOVED, &dev->flags)); | 461 | BUG_ON(!test_bit(ATM_DF_REMOVED, &dev->flags)); |
461 | if (dev->ops->dev_close) | 462 | if (dev->ops->dev_close) |
462 | dev->ops->dev_close(dev); | 463 | dev->ops->dev_close(dev); |
463 | kfree(dev); | 464 | class_device_put(&dev->class_dev); |
464 | } | 465 | } |
465 | } | 466 | } |
466 | 467 | ||
diff --git a/include/linux/audit.h b/include/linux/audit.h index b74c148f14e3..b27d7debc5a1 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -24,8 +24,7 @@ | |||
24 | #ifndef _LINUX_AUDIT_H_ | 24 | #ifndef _LINUX_AUDIT_H_ |
25 | #define _LINUX_AUDIT_H_ | 25 | #define _LINUX_AUDIT_H_ |
26 | 26 | ||
27 | #include <linux/sched.h> | 27 | #include <linux/elf-em.h> |
28 | #include <linux/elf.h> | ||
29 | 28 | ||
30 | /* The netlink messages for the audit system is divided into blocks: | 29 | /* The netlink messages for the audit system is divided into blocks: |
31 | * 1000 - 1099 are for commanding the audit system | 30 | * 1000 - 1099 are for commanding the audit system |
@@ -83,7 +82,12 @@ | |||
83 | #define AUDIT_CONFIG_CHANGE 1305 /* Audit system configuration change */ | 82 | #define AUDIT_CONFIG_CHANGE 1305 /* Audit system configuration change */ |
84 | #define AUDIT_SOCKADDR 1306 /* sockaddr copied as syscall arg */ | 83 | #define AUDIT_SOCKADDR 1306 /* sockaddr copied as syscall arg */ |
85 | #define AUDIT_CWD 1307 /* Current working directory */ | 84 | #define AUDIT_CWD 1307 /* Current working directory */ |
85 | #define AUDIT_EXECVE 1309 /* execve arguments */ | ||
86 | #define AUDIT_IPC_SET_PERM 1311 /* IPC new permissions record type */ | 86 | #define AUDIT_IPC_SET_PERM 1311 /* IPC new permissions record type */ |
87 | #define AUDIT_MQ_OPEN 1312 /* POSIX MQ open record type */ | ||
88 | #define AUDIT_MQ_SENDRECV 1313 /* POSIX MQ send/receive record type */ | ||
89 | #define AUDIT_MQ_NOTIFY 1314 /* POSIX MQ notify record type */ | ||
90 | #define AUDIT_MQ_GETSETATTR 1315 /* POSIX MQ get/set attribute record type */ | ||
87 | 91 | ||
88 | #define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ | 92 | #define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ |
89 | #define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ | 93 | #define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ |
@@ -118,10 +122,17 @@ | |||
118 | /* Rule structure sizes -- if these change, different AUDIT_ADD and | 122 | /* Rule structure sizes -- if these change, different AUDIT_ADD and |
119 | * AUDIT_LIST commands must be implemented. */ | 123 | * AUDIT_LIST commands must be implemented. */ |
120 | #define AUDIT_MAX_FIELDS 64 | 124 | #define AUDIT_MAX_FIELDS 64 |
125 | #define AUDIT_MAX_KEY_LEN 32 | ||
121 | #define AUDIT_BITMASK_SIZE 64 | 126 | #define AUDIT_BITMASK_SIZE 64 |
122 | #define AUDIT_WORD(nr) ((__u32)((nr)/32)) | 127 | #define AUDIT_WORD(nr) ((__u32)((nr)/32)) |
123 | #define AUDIT_BIT(nr) (1 << ((nr) - AUDIT_WORD(nr)*32)) | 128 | #define AUDIT_BIT(nr) (1 << ((nr) - AUDIT_WORD(nr)*32)) |
124 | 129 | ||
130 | #define AUDIT_SYSCALL_CLASSES 16 | ||
131 | #define AUDIT_CLASS_DIR_WRITE 0 | ||
132 | #define AUDIT_CLASS_DIR_WRITE_32 1 | ||
133 | #define AUDIT_CLASS_CHATTR 2 | ||
134 | #define AUDIT_CLASS_CHATTR_32 3 | ||
135 | |||
125 | /* This bitmask is used to validate user input. It represents all bits that | 136 | /* This bitmask is used to validate user input. It represents all bits that |
126 | * are currently used in an audit field constant understood by the kernel. | 137 | * are currently used in an audit field constant understood by the kernel. |
127 | * If you are adding a new #define AUDIT_<whatever>, please ensure that | 138 | * If you are adding a new #define AUDIT_<whatever>, please ensure that |
@@ -146,11 +157,17 @@ | |||
146 | #define AUDIT_PERS 10 | 157 | #define AUDIT_PERS 10 |
147 | #define AUDIT_ARCH 11 | 158 | #define AUDIT_ARCH 11 |
148 | #define AUDIT_MSGTYPE 12 | 159 | #define AUDIT_MSGTYPE 12 |
149 | #define AUDIT_SE_USER 13 /* security label user */ | 160 | #define AUDIT_SUBJ_USER 13 /* security label user */ |
150 | #define AUDIT_SE_ROLE 14 /* security label role */ | 161 | #define AUDIT_SUBJ_ROLE 14 /* security label role */ |
151 | #define AUDIT_SE_TYPE 15 /* security label type */ | 162 | #define AUDIT_SUBJ_TYPE 15 /* security label type */ |
152 | #define AUDIT_SE_SEN 16 /* security label sensitivity label */ | 163 | #define AUDIT_SUBJ_SEN 16 /* security label sensitivity label */ |
153 | #define AUDIT_SE_CLR 17 /* security label clearance label */ | 164 | #define AUDIT_SUBJ_CLR 17 /* security label clearance label */ |
165 | #define AUDIT_PPID 18 | ||
166 | #define AUDIT_OBJ_USER 19 | ||
167 | #define AUDIT_OBJ_ROLE 20 | ||
168 | #define AUDIT_OBJ_TYPE 21 | ||
169 | #define AUDIT_OBJ_LEV_LOW 22 | ||
170 | #define AUDIT_OBJ_LEV_HIGH 23 | ||
154 | 171 | ||
155 | /* These are ONLY useful when checking | 172 | /* These are ONLY useful when checking |
156 | * at syscall exit time (AUDIT_AT_EXIT). */ | 173 | * at syscall exit time (AUDIT_AT_EXIT). */ |
@@ -159,12 +176,15 @@ | |||
159 | #define AUDIT_INODE 102 | 176 | #define AUDIT_INODE 102 |
160 | #define AUDIT_EXIT 103 | 177 | #define AUDIT_EXIT 103 |
161 | #define AUDIT_SUCCESS 104 /* exit >= 0; value ignored */ | 178 | #define AUDIT_SUCCESS 104 /* exit >= 0; value ignored */ |
179 | #define AUDIT_WATCH 105 | ||
162 | 180 | ||
163 | #define AUDIT_ARG0 200 | 181 | #define AUDIT_ARG0 200 |
164 | #define AUDIT_ARG1 (AUDIT_ARG0+1) | 182 | #define AUDIT_ARG1 (AUDIT_ARG0+1) |
165 | #define AUDIT_ARG2 (AUDIT_ARG0+2) | 183 | #define AUDIT_ARG2 (AUDIT_ARG0+2) |
166 | #define AUDIT_ARG3 (AUDIT_ARG0+3) | 184 | #define AUDIT_ARG3 (AUDIT_ARG0+3) |
167 | 185 | ||
186 | #define AUDIT_FILTERKEY 210 | ||
187 | |||
168 | #define AUDIT_NEGATE 0x80000000 | 188 | #define AUDIT_NEGATE 0x80000000 |
169 | 189 | ||
170 | /* These are the supported operators. | 190 | /* These are the supported operators. |
@@ -273,21 +293,27 @@ struct audit_rule { /* for AUDIT_LIST, AUDIT_ADD, and AUDIT_DEL */ | |||
273 | }; | 293 | }; |
274 | 294 | ||
275 | #ifdef __KERNEL__ | 295 | #ifdef __KERNEL__ |
296 | #include <linux/sched.h> | ||
276 | 297 | ||
277 | struct audit_sig_info { | 298 | struct audit_sig_info { |
278 | uid_t uid; | 299 | uid_t uid; |
279 | pid_t pid; | 300 | pid_t pid; |
301 | char ctx[0]; | ||
280 | }; | 302 | }; |
281 | 303 | ||
282 | struct audit_buffer; | 304 | struct audit_buffer; |
283 | struct audit_context; | 305 | struct audit_context; |
284 | struct inode; | 306 | struct inode; |
285 | struct netlink_skb_parms; | 307 | struct netlink_skb_parms; |
308 | struct linux_binprm; | ||
309 | struct mq_attr; | ||
310 | struct mqstat; | ||
286 | 311 | ||
287 | #define AUDITSC_INVALID 0 | 312 | #define AUDITSC_INVALID 0 |
288 | #define AUDITSC_SUCCESS 1 | 313 | #define AUDITSC_SUCCESS 1 |
289 | #define AUDITSC_FAILURE 2 | 314 | #define AUDITSC_FAILURE 2 |
290 | #define AUDITSC_RESULT(x) ( ((long)(x))<0?AUDITSC_FAILURE:AUDITSC_SUCCESS ) | 315 | #define AUDITSC_RESULT(x) ( ((long)(x))<0?AUDITSC_FAILURE:AUDITSC_SUCCESS ) |
316 | extern int __init audit_register_class(int class, unsigned *list); | ||
291 | #ifdef CONFIG_AUDITSYSCALL | 317 | #ifdef CONFIG_AUDITSYSCALL |
292 | /* These are defined in auditsc.c */ | 318 | /* These are defined in auditsc.c */ |
293 | /* Public API */ | 319 | /* Public API */ |
@@ -297,15 +323,19 @@ extern void audit_syscall_entry(int arch, | |||
297 | int major, unsigned long a0, unsigned long a1, | 323 | int major, unsigned long a0, unsigned long a1, |
298 | unsigned long a2, unsigned long a3); | 324 | unsigned long a2, unsigned long a3); |
299 | extern void audit_syscall_exit(int failed, long return_code); | 325 | extern void audit_syscall_exit(int failed, long return_code); |
300 | extern void audit_getname(const char *name); | 326 | extern void __audit_getname(const char *name); |
301 | extern void audit_putname(const char *name); | 327 | extern void audit_putname(const char *name); |
302 | extern void __audit_inode(const char *name, const struct inode *inode, unsigned flags); | 328 | extern void __audit_inode(const char *name, const struct inode *inode); |
303 | extern void __audit_inode_child(const char *dname, const struct inode *inode, | 329 | extern void __audit_inode_child(const char *dname, const struct inode *inode, |
304 | unsigned long pino); | 330 | unsigned long pino); |
305 | static inline void audit_inode(const char *name, const struct inode *inode, | 331 | static inline void audit_getname(const char *name) |
306 | unsigned flags) { | 332 | { |
333 | if (unlikely(current->audit_context)) | ||
334 | __audit_getname(name); | ||
335 | } | ||
336 | static inline void audit_inode(const char *name, const struct inode *inode) { | ||
307 | if (unlikely(current->audit_context)) | 337 | if (unlikely(current->audit_context)) |
308 | __audit_inode(name, inode, flags); | 338 | __audit_inode(name, inode); |
309 | } | 339 | } |
310 | static inline void audit_inode_child(const char *dname, | 340 | static inline void audit_inode_child(const char *dname, |
311 | const struct inode *inode, | 341 | const struct inode *inode, |
@@ -320,13 +350,61 @@ extern void auditsc_get_stamp(struct audit_context *ctx, | |||
320 | struct timespec *t, unsigned int *serial); | 350 | struct timespec *t, unsigned int *serial); |
321 | extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid); | 351 | extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid); |
322 | extern uid_t audit_get_loginuid(struct audit_context *ctx); | 352 | extern uid_t audit_get_loginuid(struct audit_context *ctx); |
323 | extern int audit_ipc_obj(struct kern_ipc_perm *ipcp); | 353 | extern int __audit_ipc_obj(struct kern_ipc_perm *ipcp); |
324 | extern int audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode, struct kern_ipc_perm *ipcp); | 354 | extern int __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode); |
355 | extern int audit_bprm(struct linux_binprm *bprm); | ||
325 | extern int audit_socketcall(int nargs, unsigned long *args); | 356 | extern int audit_socketcall(int nargs, unsigned long *args); |
326 | extern int audit_sockaddr(int len, void *addr); | 357 | extern int audit_sockaddr(int len, void *addr); |
327 | extern int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt); | 358 | extern int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt); |
328 | extern void audit_signal_info(int sig, struct task_struct *t); | ||
329 | extern int audit_set_macxattr(const char *name); | 359 | extern int audit_set_macxattr(const char *name); |
360 | extern int __audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr); | ||
361 | extern int __audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec __user *u_abs_timeout); | ||
362 | extern int __audit_mq_timedreceive(mqd_t mqdes, size_t msg_len, unsigned int __user *u_msg_prio, const struct timespec __user *u_abs_timeout); | ||
363 | extern int __audit_mq_notify(mqd_t mqdes, const struct sigevent __user *u_notification); | ||
364 | extern int __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat); | ||
365 | |||
366 | static inline int audit_ipc_obj(struct kern_ipc_perm *ipcp) | ||
367 | { | ||
368 | if (unlikely(current->audit_context)) | ||
369 | return __audit_ipc_obj(ipcp); | ||
370 | return 0; | ||
371 | } | ||
372 | static inline int audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode) | ||
373 | { | ||
374 | if (unlikely(current->audit_context)) | ||
375 | return __audit_ipc_set_perm(qbytes, uid, gid, mode); | ||
376 | return 0; | ||
377 | } | ||
378 | static inline int audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr) | ||
379 | { | ||
380 | if (unlikely(current->audit_context)) | ||
381 | return __audit_mq_open(oflag, mode, u_attr); | ||
382 | return 0; | ||
383 | } | ||
384 | static inline int audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec __user *u_abs_timeout) | ||
385 | { | ||
386 | if (unlikely(current->audit_context)) | ||
387 | return __audit_mq_timedsend(mqdes, msg_len, msg_prio, u_abs_timeout); | ||
388 | return 0; | ||
389 | } | ||
390 | static inline int audit_mq_timedreceive(mqd_t mqdes, size_t msg_len, unsigned int __user *u_msg_prio, const struct timespec __user *u_abs_timeout) | ||
391 | { | ||
392 | if (unlikely(current->audit_context)) | ||
393 | return __audit_mq_timedreceive(mqdes, msg_len, u_msg_prio, u_abs_timeout); | ||
394 | return 0; | ||
395 | } | ||
396 | static inline int audit_mq_notify(mqd_t mqdes, const struct sigevent __user *u_notification) | ||
397 | { | ||
398 | if (unlikely(current->audit_context)) | ||
399 | return __audit_mq_notify(mqdes, u_notification); | ||
400 | return 0; | ||
401 | } | ||
402 | static inline int audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat) | ||
403 | { | ||
404 | if (unlikely(current->audit_context)) | ||
405 | return __audit_mq_getsetattr(mqdes, mqstat); | ||
406 | return 0; | ||
407 | } | ||
330 | #else | 408 | #else |
331 | #define audit_alloc(t) ({ 0; }) | 409 | #define audit_alloc(t) ({ 0; }) |
332 | #define audit_free(t) do { ; } while (0) | 410 | #define audit_free(t) do { ; } while (0) |
@@ -334,19 +412,24 @@ extern int audit_set_macxattr(const char *name); | |||
334 | #define audit_syscall_exit(f,r) do { ; } while (0) | 412 | #define audit_syscall_exit(f,r) do { ; } while (0) |
335 | #define audit_getname(n) do { ; } while (0) | 413 | #define audit_getname(n) do { ; } while (0) |
336 | #define audit_putname(n) do { ; } while (0) | 414 | #define audit_putname(n) do { ; } while (0) |
337 | #define __audit_inode(n,i,f) do { ; } while (0) | 415 | #define __audit_inode(n,i) do { ; } while (0) |
338 | #define __audit_inode_child(d,i,p) do { ; } while (0) | 416 | #define __audit_inode_child(d,i,p) do { ; } while (0) |
339 | #define audit_inode(n,i,f) do { ; } while (0) | 417 | #define audit_inode(n,i) do { ; } while (0) |
340 | #define audit_inode_child(d,i,p) do { ; } while (0) | 418 | #define audit_inode_child(d,i,p) do { ; } while (0) |
341 | #define auditsc_get_stamp(c,t,s) do { BUG(); } while (0) | 419 | #define auditsc_get_stamp(c,t,s) do { BUG(); } while (0) |
342 | #define audit_get_loginuid(c) ({ -1; }) | 420 | #define audit_get_loginuid(c) ({ -1; }) |
343 | #define audit_ipc_obj(i) ({ 0; }) | 421 | #define audit_ipc_obj(i) ({ 0; }) |
344 | #define audit_ipc_set_perm(q,u,g,m,i) ({ 0; }) | 422 | #define audit_ipc_set_perm(q,u,g,m) ({ 0; }) |
423 | #define audit_bprm(p) ({ 0; }) | ||
345 | #define audit_socketcall(n,a) ({ 0; }) | 424 | #define audit_socketcall(n,a) ({ 0; }) |
346 | #define audit_sockaddr(len, addr) ({ 0; }) | 425 | #define audit_sockaddr(len, addr) ({ 0; }) |
347 | #define audit_avc_path(dentry, mnt) ({ 0; }) | 426 | #define audit_avc_path(dentry, mnt) ({ 0; }) |
348 | #define audit_signal_info(s,t) do { ; } while (0) | ||
349 | #define audit_set_macxattr(n) do { ; } while (0) | 427 | #define audit_set_macxattr(n) do { ; } while (0) |
428 | #define audit_mq_open(o,m,a) ({ 0; }) | ||
429 | #define audit_mq_timedsend(d,l,p,t) ({ 0; }) | ||
430 | #define audit_mq_timedreceive(d,l,p,t) ({ 0; }) | ||
431 | #define audit_mq_notify(d,n) ({ 0; }) | ||
432 | #define audit_mq_getsetattr(d,s) ({ 0; }) | ||
350 | #endif | 433 | #endif |
351 | 434 | ||
352 | #ifdef CONFIG_AUDIT | 435 | #ifdef CONFIG_AUDIT |
@@ -364,8 +447,11 @@ extern void audit_log_end(struct audit_buffer *ab); | |||
364 | extern void audit_log_hex(struct audit_buffer *ab, | 447 | extern void audit_log_hex(struct audit_buffer *ab, |
365 | const unsigned char *buf, | 448 | const unsigned char *buf, |
366 | size_t len); | 449 | size_t len); |
367 | extern void audit_log_untrustedstring(struct audit_buffer *ab, | 450 | extern const char * audit_log_untrustedstring(struct audit_buffer *ab, |
368 | const char *string); | 451 | const char *string); |
452 | extern const char * audit_log_n_untrustedstring(struct audit_buffer *ab, | ||
453 | size_t n, | ||
454 | const char *string); | ||
369 | extern void audit_log_d_path(struct audit_buffer *ab, | 455 | extern void audit_log_d_path(struct audit_buffer *ab, |
370 | const char *prefix, | 456 | const char *prefix, |
371 | struct dentry *dentry, | 457 | struct dentry *dentry, |
@@ -383,8 +469,8 @@ extern int audit_receive_filter(int type, int pid, int uid, int seq, | |||
383 | #define audit_log_end(b) do { ; } while (0) | 469 | #define audit_log_end(b) do { ; } while (0) |
384 | #define audit_log_hex(a,b,l) do { ; } while (0) | 470 | #define audit_log_hex(a,b,l) do { ; } while (0) |
385 | #define audit_log_untrustedstring(a,s) do { ; } while (0) | 471 | #define audit_log_untrustedstring(a,s) do { ; } while (0) |
472 | #define audit_log_n_untrustedstring(a,n,s) do { ; } while (0) | ||
386 | #define audit_log_d_path(b,p,d,v) do { ; } while (0) | 473 | #define audit_log_d_path(b,p,d,v) do { ; } while (0) |
387 | #define audit_panic(m) do { ; } while (0) | ||
388 | #endif | 474 | #endif |
389 | #endif | 475 | #endif |
390 | #endif | 476 | #endif |
diff --git a/include/linux/bio.h b/include/linux/bio.h index b60ffe32cd21..76bdaeab6f62 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -47,7 +47,7 @@ | |||
47 | #define BIO_BUG_ON | 47 | #define BIO_BUG_ON |
48 | #endif | 48 | #endif |
49 | 49 | ||
50 | #define BIO_MAX_PAGES (256) | 50 | #define BIO_MAX_PAGES 256 |
51 | #define BIO_MAX_SIZE (BIO_MAX_PAGES << PAGE_CACHE_SHIFT) | 51 | #define BIO_MAX_SIZE (BIO_MAX_PAGES << PAGE_CACHE_SHIFT) |
52 | #define BIO_MAX_SECTORS (BIO_MAX_SIZE >> 9) | 52 | #define BIO_MAX_SECTORS (BIO_MAX_SIZE >> 9) |
53 | 53 | ||
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index d9ed27969855..dcc5de7cc487 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h | |||
@@ -24,6 +24,9 @@ | |||
24 | * The available bitmap operations and their rough meaning in the | 24 | * The available bitmap operations and their rough meaning in the |
25 | * case that the bitmap is a single unsigned long are thus: | 25 | * case that the bitmap is a single unsigned long are thus: |
26 | * | 26 | * |
27 | * Note that nbits should be always a compile time evaluable constant. | ||
28 | * Otherwise many inlines will generate horrible code. | ||
29 | * | ||
27 | * bitmap_zero(dst, nbits) *dst = 0UL | 30 | * bitmap_zero(dst, nbits) *dst = 0UL |
28 | * bitmap_fill(dst, nbits) *dst = ~0UL | 31 | * bitmap_fill(dst, nbits) *dst = ~0UL |
29 | * bitmap_copy(dst, src, nbits) *dst = *src | 32 | * bitmap_copy(dst, src, nbits) *dst = *src |
@@ -244,6 +247,8 @@ static inline int bitmap_full(const unsigned long *src, int nbits) | |||
244 | 247 | ||
245 | static inline int bitmap_weight(const unsigned long *src, int nbits) | 248 | static inline int bitmap_weight(const unsigned long *src, int nbits) |
246 | { | 249 | { |
250 | if (nbits <= BITS_PER_LONG) | ||
251 | return hweight_long(*src & BITMAP_LAST_WORD_MASK(nbits)); | ||
247 | return __bitmap_weight(src, nbits); | 252 | return __bitmap_weight(src, nbits); |
248 | } | 253 | } |
249 | 254 | ||
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 59e1259b1c40..aafe82788b4e 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _LINUX_BLKDEV_H | 1 | #ifndef _LINUX_BLKDEV_H |
2 | #define _LINUX_BLKDEV_H | 2 | #define _LINUX_BLKDEV_H |
3 | 3 | ||
4 | #include <linux/config.h> | ||
5 | #include <linux/major.h> | 4 | #include <linux/major.h> |
6 | #include <linux/genhd.h> | 5 | #include <linux/genhd.h> |
7 | #include <linux/list.h> | 6 | #include <linux/list.h> |
@@ -152,11 +151,9 @@ struct request { | |||
152 | void *elevator_private; | 151 | void *elevator_private; |
153 | void *completion_data; | 152 | void *completion_data; |
154 | 153 | ||
155 | unsigned short ioprio; | ||
156 | |||
157 | int rq_status; /* should split this into a few status bits */ | 154 | int rq_status; /* should split this into a few status bits */ |
158 | struct gendisk *rq_disk; | ||
159 | int errors; | 155 | int errors; |
156 | struct gendisk *rq_disk; | ||
160 | unsigned long start_time; | 157 | unsigned long start_time; |
161 | 158 | ||
162 | /* Number of scatter-gather DMA addr+len pairs after | 159 | /* Number of scatter-gather DMA addr+len pairs after |
@@ -171,8 +168,9 @@ struct request { | |||
171 | */ | 168 | */ |
172 | unsigned short nr_hw_segments; | 169 | unsigned short nr_hw_segments; |
173 | 170 | ||
171 | unsigned short ioprio; | ||
172 | |||
174 | int tag; | 173 | int tag; |
175 | char *buffer; | ||
176 | 174 | ||
177 | int ref_count; | 175 | int ref_count; |
178 | request_queue_t *q; | 176 | request_queue_t *q; |
@@ -180,6 +178,7 @@ struct request { | |||
180 | 178 | ||
181 | struct completion *waiting; | 179 | struct completion *waiting; |
182 | void *special; | 180 | void *special; |
181 | char *buffer; | ||
183 | 182 | ||
184 | /* | 183 | /* |
185 | * when request is used as a packet command carrier | 184 | * when request is used as a packet command carrier |
@@ -188,20 +187,14 @@ struct request { | |||
188 | unsigned char cmd[BLK_MAX_CDB]; | 187 | unsigned char cmd[BLK_MAX_CDB]; |
189 | 188 | ||
190 | unsigned int data_len; | 189 | unsigned int data_len; |
191 | void *data; | ||
192 | |||
193 | unsigned int sense_len; | 190 | unsigned int sense_len; |
191 | void *data; | ||
194 | void *sense; | 192 | void *sense; |
195 | 193 | ||
196 | unsigned int timeout; | 194 | unsigned int timeout; |
197 | int retries; | 195 | int retries; |
198 | 196 | ||
199 | /* | 197 | /* |
200 | * For Power Management requests | ||
201 | */ | ||
202 | struct request_pm_state *pm; | ||
203 | |||
204 | /* | ||
205 | * completion callback. end_io_data should be folded in with waiting | 198 | * completion callback. end_io_data should be folded in with waiting |
206 | */ | 199 | */ |
207 | rq_end_io_fn *end_io; | 200 | rq_end_io_fn *end_io; |
@@ -242,6 +235,7 @@ enum rq_flag_bits { | |||
242 | __REQ_PM_RESUME, /* resume request */ | 235 | __REQ_PM_RESUME, /* resume request */ |
243 | __REQ_PM_SHUTDOWN, /* shutdown request */ | 236 | __REQ_PM_SHUTDOWN, /* shutdown request */ |
244 | __REQ_ORDERED_COLOR, /* is before or after barrier */ | 237 | __REQ_ORDERED_COLOR, /* is before or after barrier */ |
238 | __REQ_RW_SYNC, /* request is sync (O_DIRECT) */ | ||
245 | __REQ_NR_BITS, /* stops here */ | 239 | __REQ_NR_BITS, /* stops here */ |
246 | }; | 240 | }; |
247 | 241 | ||
@@ -271,6 +265,7 @@ enum rq_flag_bits { | |||
271 | #define REQ_PM_RESUME (1 << __REQ_PM_RESUME) | 265 | #define REQ_PM_RESUME (1 << __REQ_PM_RESUME) |
272 | #define REQ_PM_SHUTDOWN (1 << __REQ_PM_SHUTDOWN) | 266 | #define REQ_PM_SHUTDOWN (1 << __REQ_PM_SHUTDOWN) |
273 | #define REQ_ORDERED_COLOR (1 << __REQ_ORDERED_COLOR) | 267 | #define REQ_ORDERED_COLOR (1 << __REQ_ORDERED_COLOR) |
268 | #define REQ_RW_SYNC (1 << __REQ_RW_SYNC) | ||
274 | 269 | ||
275 | /* | 270 | /* |
276 | * State information carried for REQ_PM_SUSPEND and REQ_PM_RESUME | 271 | * State information carried for REQ_PM_SUSPEND and REQ_PM_RESUME |
@@ -439,9 +434,6 @@ struct request_queue | |||
439 | 434 | ||
440 | #define RQ_INACTIVE (-1) | 435 | #define RQ_INACTIVE (-1) |
441 | #define RQ_ACTIVE 1 | 436 | #define RQ_ACTIVE 1 |
442 | #define RQ_SCSI_BUSY 0xffff | ||
443 | #define RQ_SCSI_DONE 0xfffe | ||
444 | #define RQ_SCSI_DISCONNECTING 0xffe0 | ||
445 | 437 | ||
446 | #define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ | 438 | #define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ |
447 | #define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */ | 439 | #define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */ |
diff --git a/include/linux/blkpg.h b/include/linux/blkpg.h index be5d0f4ad24c..faf8a45af210 100644 --- a/include/linux/blkpg.h +++ b/include/linux/blkpg.h | |||
@@ -24,6 +24,7 @@ | |||
24 | * | 24 | * |
25 | * For today, only the partition stuff - aeb, 990515 | 25 | * For today, only the partition stuff - aeb, 990515 |
26 | */ | 26 | */ |
27 | #include <linux/compiler.h> | ||
27 | #include <linux/ioctl.h> | 28 | #include <linux/ioctl.h> |
28 | 29 | ||
29 | #define BLKPG _IO(0x12,105) | 30 | #define BLKPG _IO(0x12,105) |
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index b34d3e73d5ea..a7e8cef73d15 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef BLKTRACE_H | 1 | #ifndef BLKTRACE_H |
2 | #define BLKTRACE_H | 2 | #define BLKTRACE_H |
3 | 3 | ||
4 | #include <linux/config.h> | ||
5 | #include <linux/blkdev.h> | 4 | #include <linux/blkdev.h> |
6 | #include <linux/relay.h> | 5 | #include <linux/relay.h> |
7 | 6 | ||
@@ -91,9 +90,9 @@ struct blk_io_trace { | |||
91 | * The remap event | 90 | * The remap event |
92 | */ | 91 | */ |
93 | struct blk_io_trace_remap { | 92 | struct blk_io_trace_remap { |
94 | u32 device; | 93 | __be32 device; |
95 | u32 __pad; | 94 | u32 __pad; |
96 | u64 sector; | 95 | __be64 sector; |
97 | }; | 96 | }; |
98 | 97 | ||
99 | enum { | 98 | enum { |
@@ -225,7 +224,7 @@ static inline void blk_add_trace_pdu_int(struct request_queue *q, u32 what, | |||
225 | struct bio *bio, unsigned int pdu) | 224 | struct bio *bio, unsigned int pdu) |
226 | { | 225 | { |
227 | struct blk_trace *bt = q->blk_trace; | 226 | struct blk_trace *bt = q->blk_trace; |
228 | u64 rpdu = cpu_to_be64(pdu); | 227 | __be64 rpdu = cpu_to_be64(pdu); |
229 | 228 | ||
230 | if (likely(!bt)) | 229 | if (likely(!bt)) |
231 | return; | 230 | return; |
diff --git a/include/linux/blockgroup_lock.h b/include/linux/blockgroup_lock.h index 0137ee5dd43c..8607312983bd 100644 --- a/include/linux/blockgroup_lock.h +++ b/include/linux/blockgroup_lock.h | |||
@@ -6,7 +6,6 @@ | |||
6 | * Simple hashed spinlocking. | 6 | * Simple hashed spinlocking. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <linux/config.h> | ||
10 | #include <linux/spinlock.h> | 9 | #include <linux/spinlock.h> |
11 | #include <linux/cache.h> | 10 | #include <linux/cache.h> |
12 | 11 | ||
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index da2d107fe2cf..22866fa2d960 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
@@ -91,8 +91,8 @@ static inline void *alloc_remap(int nid, unsigned long size) | |||
91 | } | 91 | } |
92 | #endif | 92 | #endif |
93 | 93 | ||
94 | extern unsigned long __initdata nr_kernel_pages; | 94 | extern unsigned long nr_kernel_pages; |
95 | extern unsigned long __initdata nr_all_pages; | 95 | extern unsigned long nr_all_pages; |
96 | 96 | ||
97 | extern void *__init alloc_large_system_hash(const char *tablename, | 97 | extern void *__init alloc_large_system_hash(const char *tablename, |
98 | unsigned long bucketsize, | 98 | unsigned long bucketsize, |
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index fb7e9b7ccbe3..737e407d0cd1 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -149,7 +149,6 @@ void create_empty_buffers(struct page *, unsigned long, | |||
149 | unsigned long b_state); | 149 | unsigned long b_state); |
150 | void end_buffer_read_sync(struct buffer_head *bh, int uptodate); | 150 | void end_buffer_read_sync(struct buffer_head *bh, int uptodate); |
151 | void end_buffer_write_sync(struct buffer_head *bh, int uptodate); | 151 | void end_buffer_write_sync(struct buffer_head *bh, int uptodate); |
152 | void end_buffer_async_write(struct buffer_head *bh, int uptodate); | ||
153 | 152 | ||
154 | /* Things to do with buffers at mapping->private_list */ | 153 | /* Things to do with buffers at mapping->private_list */ |
155 | void mark_buffer_dirty_inode(struct buffer_head *bh, struct inode *inode); | 154 | void mark_buffer_dirty_inode(struct buffer_head *bh, struct inode *inode); |
@@ -214,6 +213,7 @@ int nobh_truncate_page(struct address_space *, loff_t); | |||
214 | int nobh_writepage(struct page *page, get_block_t *get_block, | 213 | int nobh_writepage(struct page *page, get_block_t *get_block, |
215 | struct writeback_control *wbc); | 214 | struct writeback_control *wbc); |
216 | 215 | ||
216 | void buffer_init(void); | ||
217 | 217 | ||
218 | /* | 218 | /* |
219 | * inline definitions | 219 | * inline definitions |
diff --git a/include/linux/cache.h b/include/linux/cache.h index cc4b3aafad9a..4552504c0228 100644 --- a/include/linux/cache.h +++ b/include/linux/cache.h | |||
@@ -2,7 +2,6 @@ | |||
2 | #define __LINUX_CACHE_H | 2 | #define __LINUX_CACHE_H |
3 | 3 | ||
4 | #include <linux/kernel.h> | 4 | #include <linux/kernel.h> |
5 | #include <linux/config.h> | ||
6 | #include <asm/cache.h> | 5 | #include <asm/cache.h> |
7 | 6 | ||
8 | #ifndef L1_CACHE_ALIGN | 7 | #ifndef L1_CACHE_ALIGN |
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h new file mode 100644 index 000000000000..d852024ed095 --- /dev/null +++ b/include/linux/clocksource.h | |||
@@ -0,0 +1,185 @@ | |||
1 | /* linux/include/linux/clocksource.h | ||
2 | * | ||
3 | * This file contains the structure definitions for clocksources. | ||
4 | * | ||
5 | * If you are not a clocksource, or timekeeping code, you should | ||
6 | * not be including this file! | ||
7 | */ | ||
8 | #ifndef _LINUX_CLOCKSOURCE_H | ||
9 | #define _LINUX_CLOCKSOURCE_H | ||
10 | |||
11 | #include <linux/types.h> | ||
12 | #include <linux/timex.h> | ||
13 | #include <linux/time.h> | ||
14 | #include <linux/list.h> | ||
15 | #include <asm/div64.h> | ||
16 | #include <asm/io.h> | ||
17 | |||
18 | /* clocksource cycle base type */ | ||
19 | typedef u64 cycle_t; | ||
20 | |||
21 | /** | ||
22 | * struct clocksource - hardware abstraction for a free running counter | ||
23 | * Provides mostly state-free accessors to the underlying hardware. | ||
24 | * | ||
25 | * @name: ptr to clocksource name | ||
26 | * @list: list head for registration | ||
27 | * @rating: rating value for selection (higher is better) | ||
28 | * To avoid rating inflation the following | ||
29 | * list should give you a guide as to how | ||
30 | * to assign your clocksource a rating | ||
31 | * 1-99: Unfit for real use | ||
32 | * Only available for bootup and testing purposes. | ||
33 | * 100-199: Base level usability. | ||
34 | * Functional for real use, but not desired. | ||
35 | * 200-299: Good. | ||
36 | * A correct and usable clocksource. | ||
37 | * 300-399: Desired. | ||
38 | * A reasonably fast and accurate clocksource. | ||
39 | * 400-499: Perfect | ||
40 | * The ideal clocksource. A must-use where | ||
41 | * available. | ||
42 | * @read: returns a cycle value | ||
43 | * @mask: bitmask for two's complement | ||
44 | * subtraction of non 64 bit counters | ||
45 | * @mult: cycle to nanosecond multiplier | ||
46 | * @shift: cycle to nanosecond divisor (power of two) | ||
47 | * @update_callback: called when safe to alter clocksource values | ||
48 | * @is_continuous: defines if clocksource is free-running. | ||
49 | * @cycle_interval: Used internally by timekeeping core, please ignore. | ||
50 | * @xtime_interval: Used internally by timekeeping core, please ignore. | ||
51 | */ | ||
52 | struct clocksource { | ||
53 | char *name; | ||
54 | struct list_head list; | ||
55 | int rating; | ||
56 | cycle_t (*read)(void); | ||
57 | cycle_t mask; | ||
58 | u32 mult; | ||
59 | u32 shift; | ||
60 | int (*update_callback)(void); | ||
61 | int is_continuous; | ||
62 | |||
63 | /* timekeeping specific data, ignore */ | ||
64 | cycle_t cycle_last, cycle_interval; | ||
65 | u64 xtime_nsec, xtime_interval; | ||
66 | s64 error; | ||
67 | }; | ||
68 | |||
69 | /* simplify initialization of mask field */ | ||
70 | #define CLOCKSOURCE_MASK(bits) (cycle_t)(bits<64 ? ((1ULL<<bits)-1) : -1) | ||
71 | |||
72 | /** | ||
73 | * clocksource_khz2mult - calculates mult from khz and shift | ||
74 | * @khz: Clocksource frequency in KHz | ||
75 | * @shift_constant: Clocksource shift factor | ||
76 | * | ||
77 | * Helper functions that converts a khz counter frequency to a timsource | ||
78 | * multiplier, given the clocksource shift value | ||
79 | */ | ||
80 | static inline u32 clocksource_khz2mult(u32 khz, u32 shift_constant) | ||
81 | { | ||
82 | /* khz = cyc/(Million ns) | ||
83 | * mult/2^shift = ns/cyc | ||
84 | * mult = ns/cyc * 2^shift | ||
85 | * mult = 1Million/khz * 2^shift | ||
86 | * mult = 1000000 * 2^shift / khz | ||
87 | * mult = (1000000<<shift) / khz | ||
88 | */ | ||
89 | u64 tmp = ((u64)1000000) << shift_constant; | ||
90 | |||
91 | tmp += khz/2; /* round for do_div */ | ||
92 | do_div(tmp, khz); | ||
93 | |||
94 | return (u32)tmp; | ||
95 | } | ||
96 | |||
97 | /** | ||
98 | * clocksource_hz2mult - calculates mult from hz and shift | ||
99 | * @hz: Clocksource frequency in Hz | ||
100 | * @shift_constant: Clocksource shift factor | ||
101 | * | ||
102 | * Helper functions that converts a hz counter | ||
103 | * frequency to a timsource multiplier, given the | ||
104 | * clocksource shift value | ||
105 | */ | ||
106 | static inline u32 clocksource_hz2mult(u32 hz, u32 shift_constant) | ||
107 | { | ||
108 | /* hz = cyc/(Billion ns) | ||
109 | * mult/2^shift = ns/cyc | ||
110 | * mult = ns/cyc * 2^shift | ||
111 | * mult = 1Billion/hz * 2^shift | ||
112 | * mult = 1000000000 * 2^shift / hz | ||
113 | * mult = (1000000000<<shift) / hz | ||
114 | */ | ||
115 | u64 tmp = ((u64)1000000000) << shift_constant; | ||
116 | |||
117 | tmp += hz/2; /* round for do_div */ | ||
118 | do_div(tmp, hz); | ||
119 | |||
120 | return (u32)tmp; | ||
121 | } | ||
122 | |||
123 | /** | ||
124 | * clocksource_read: - Access the clocksource's current cycle value | ||
125 | * @cs: pointer to clocksource being read | ||
126 | * | ||
127 | * Uses the clocksource to return the current cycle_t value | ||
128 | */ | ||
129 | static inline cycle_t clocksource_read(struct clocksource *cs) | ||
130 | { | ||
131 | return cs->read(); | ||
132 | } | ||
133 | |||
134 | /** | ||
135 | * cyc2ns - converts clocksource cycles to nanoseconds | ||
136 | * @cs: Pointer to clocksource | ||
137 | * @cycles: Cycles | ||
138 | * | ||
139 | * Uses the clocksource and ntp ajdustment to convert cycle_ts to nanoseconds. | ||
140 | * | ||
141 | * XXX - This could use some mult_lxl_ll() asm optimization | ||
142 | */ | ||
143 | static inline s64 cyc2ns(struct clocksource *cs, cycle_t cycles) | ||
144 | { | ||
145 | u64 ret = (u64)cycles; | ||
146 | ret = (ret * cs->mult) >> cs->shift; | ||
147 | return ret; | ||
148 | } | ||
149 | |||
150 | /** | ||
151 | * clocksource_calculate_interval - Calculates a clocksource interval struct | ||
152 | * | ||
153 | * @c: Pointer to clocksource. | ||
154 | * @length_nsec: Desired interval length in nanoseconds. | ||
155 | * | ||
156 | * Calculates a fixed cycle/nsec interval for a given clocksource/adjustment | ||
157 | * pair and interval request. | ||
158 | * | ||
159 | * Unless you're the timekeeping code, you should not be using this! | ||
160 | */ | ||
161 | static inline void clocksource_calculate_interval(struct clocksource *c, | ||
162 | unsigned long length_nsec) | ||
163 | { | ||
164 | u64 tmp; | ||
165 | |||
166 | /* XXX - All of this could use a whole lot of optimization */ | ||
167 | tmp = length_nsec; | ||
168 | tmp <<= c->shift; | ||
169 | tmp += c->mult/2; | ||
170 | do_div(tmp, c->mult); | ||
171 | |||
172 | c->cycle_interval = (cycle_t)tmp; | ||
173 | if (c->cycle_interval == 0) | ||
174 | c->cycle_interval = 1; | ||
175 | |||
176 | c->xtime_interval = (u64)c->cycle_interval * c->mult; | ||
177 | } | ||
178 | |||
179 | |||
180 | /* used to install a new clocksource */ | ||
181 | int clocksource_register(struct clocksource*); | ||
182 | void clocksource_reselect(void); | ||
183 | struct clocksource* clocksource_get_next(void); | ||
184 | |||
185 | #endif /* _LINUX_CLOCKSOURCE_H */ | ||
diff --git a/include/linux/cn_proc.h b/include/linux/cn_proc.h index 1417de935057..dbb7769009be 100644 --- a/include/linux/cn_proc.h +++ b/include/linux/cn_proc.h | |||
@@ -3,31 +3,22 @@ | |||
3 | * | 3 | * |
4 | * Copyright (C) Matt Helsley, IBM Corp. 2005 | 4 | * Copyright (C) Matt Helsley, IBM Corp. 2005 |
5 | * Based on cn_fork.h by Nguyen Anh Quynh and Guillaume Thouvenin | 5 | * Based on cn_fork.h by Nguyen Anh Quynh and Guillaume Thouvenin |
6 | * Original copyright notice follows: | ||
7 | * Copyright (C) 2005 Nguyen Anh Quynh <aquynh@gmail.com> | 6 | * Copyright (C) 2005 Nguyen Anh Quynh <aquynh@gmail.com> |
8 | * Copyright (C) 2005 Guillaume Thouvenin <guillaume.thouvenin@bull.net> | 7 | * Copyright (C) 2005 Guillaume Thouvenin <guillaume.thouvenin@bull.net> |
9 | * | 8 | * |
10 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify it |
11 | * it under the terms of the GNU General Public License as published by | 10 | * under the terms of version 2.1 of the GNU Lesser General Public License |
12 | * the Free Software Foundation; either version 2 of the License, or | 11 | * as published by the Free Software Foundation. |
13 | * (at your option) any later version. | ||
14 | * | 12 | * |
15 | * This program is distributed in the hope that it will be useful, | 13 | * This program is distributed in the hope that it would be useful, but |
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | * GNU General Public License for more details. | ||
19 | * | ||
20 | * You should have received a copy of the GNU General Public License | ||
21 | * along with this program; if not, write to the Free Software | ||
22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
23 | */ | 16 | */ |
24 | 17 | ||
25 | #ifndef CN_PROC_H | 18 | #ifndef CN_PROC_H |
26 | #define CN_PROC_H | 19 | #define CN_PROC_H |
27 | 20 | ||
28 | #include <linux/types.h> | 21 | #include <linux/types.h> |
29 | #include <linux/time.h> | ||
30 | #include <linux/connector.h> | ||
31 | 22 | ||
32 | /* | 23 | /* |
33 | * Userspace sends this enum to register with the kernel that it is listening | 24 | * Userspace sends this enum to register with the kernel that it is listening |
diff --git a/include/linux/coda.h b/include/linux/coda.h index bbc5afcd7db6..b5cf0780c51a 100644 --- a/include/linux/coda.h +++ b/include/linux/coda.h | |||
@@ -59,7 +59,6 @@ Mellon the rights to redistribute these changes without encumbrance. | |||
59 | #ifndef _CODA_HEADER_ | 59 | #ifndef _CODA_HEADER_ |
60 | #define _CODA_HEADER_ | 60 | #define _CODA_HEADER_ |
61 | 61 | ||
62 | #include <linux/config.h> | ||
63 | 62 | ||
64 | /* Catch new _KERNEL defn for NetBSD and DJGPP/__CYGWIN32__ */ | 63 | /* Catch new _KERNEL defn for NetBSD and DJGPP/__CYGWIN32__ */ |
65 | #if defined(__NetBSD__) || \ | 64 | #if defined(__NetBSD__) || \ |
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h index b3ecf8f71d97..be512cc98791 100644 --- a/include/linux/coda_linux.h +++ b/include/linux/coda_linux.h | |||
@@ -27,8 +27,8 @@ extern struct inode_operations coda_dir_inode_operations; | |||
27 | extern struct inode_operations coda_file_inode_operations; | 27 | extern struct inode_operations coda_file_inode_operations; |
28 | extern struct inode_operations coda_ioctl_inode_operations; | 28 | extern struct inode_operations coda_ioctl_inode_operations; |
29 | 29 | ||
30 | extern struct address_space_operations coda_file_aops; | 30 | extern const struct address_space_operations coda_file_aops; |
31 | extern struct address_space_operations coda_symlink_aops; | 31 | extern const struct address_space_operations coda_symlink_aops; |
32 | 32 | ||
33 | extern const struct file_operations coda_dir_operations; | 33 | extern const struct file_operations coda_dir_operations; |
34 | extern const struct file_operations coda_file_operations; | 34 | extern const struct file_operations coda_file_operations; |
@@ -36,7 +36,7 @@ extern const struct file_operations coda_ioctl_operations; | |||
36 | 36 | ||
37 | /* operations shared over more than one file */ | 37 | /* operations shared over more than one file */ |
38 | int coda_open(struct inode *i, struct file *f); | 38 | int coda_open(struct inode *i, struct file *f); |
39 | int coda_flush(struct file *f); | 39 | int coda_flush(struct file *f, fl_owner_t id); |
40 | int coda_release(struct inode *i, struct file *f); | 40 | int coda_release(struct inode *i, struct file *f); |
41 | int coda_permission(struct inode *inode, int mask, struct nameidata *nd); | 41 | int coda_permission(struct inode *inode, int mask, struct nameidata *nd); |
42 | int coda_revalidate_inode(struct dentry *); | 42 | int coda_revalidate_inode(struct dentry *); |
diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h index d539262a8f89..98f6c52c152b 100644 --- a/include/linux/coda_psdev.h +++ b/include/linux/coda_psdev.h | |||
@@ -70,7 +70,7 @@ int venus_pioctl(struct super_block *sb, struct CodaFid *fid, | |||
70 | unsigned int cmd, struct PioctlData *data); | 70 | unsigned int cmd, struct PioctlData *data); |
71 | int coda_downcall(int opcode, union outputArgs *out, struct super_block *sb); | 71 | int coda_downcall(int opcode, union outputArgs *out, struct super_block *sb); |
72 | int venus_fsync(struct super_block *sb, struct CodaFid *fid); | 72 | int venus_fsync(struct super_block *sb, struct CodaFid *fid); |
73 | int venus_statfs(struct super_block *sb, struct kstatfs *sfs); | 73 | int venus_statfs(struct dentry *dentry, struct kstatfs *sfs); |
74 | 74 | ||
75 | 75 | ||
76 | /* messages between coda filesystem in kernel and Venus */ | 76 | /* messages between coda filesystem in kernel and Venus */ |
diff --git a/include/linux/compat.h b/include/linux/compat.h index 6d3a654be1ae..9760753e662b 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -4,7 +4,6 @@ | |||
4 | * These are the type definitions for the architecture specific | 4 | * These are the type definitions for the architecture specific |
5 | * syscall compatibility layer. | 5 | * syscall compatibility layer. |
6 | */ | 6 | */ |
7 | #include <linux/config.h> | ||
8 | 7 | ||
9 | #ifdef CONFIG_COMPAT | 8 | #ifdef CONFIG_COMPAT |
10 | 9 | ||
@@ -227,5 +226,7 @@ static inline int compat_timespec_compare(struct compat_timespec *lhs, | |||
227 | 226 | ||
228 | asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp); | 227 | asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp); |
229 | 228 | ||
229 | extern int compat_printk(const char *fmt, ...); | ||
230 | |||
230 | #endif /* CONFIG_COMPAT */ | 231 | #endif /* CONFIG_COMPAT */ |
231 | #endif /* _LINUX_COMPAT_H */ | 232 | #endif /* _LINUX_COMPAT_H */ |
diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h index 89ab677cb993..269d000bb2a3 100644 --- a/include/linux/compat_ioctl.h +++ b/include/linux/compat_ioctl.h | |||
@@ -567,11 +567,6 @@ COMPATIBLE_IOCTL(AUTOFS_IOC_PROTOSUBVER) | |||
567 | COMPATIBLE_IOCTL(AUTOFS_IOC_ASKREGHOST) | 567 | COMPATIBLE_IOCTL(AUTOFS_IOC_ASKREGHOST) |
568 | COMPATIBLE_IOCTL(AUTOFS_IOC_TOGGLEREGHOST) | 568 | COMPATIBLE_IOCTL(AUTOFS_IOC_TOGGLEREGHOST) |
569 | COMPATIBLE_IOCTL(AUTOFS_IOC_ASKUMOUNT) | 569 | COMPATIBLE_IOCTL(AUTOFS_IOC_ASKUMOUNT) |
570 | /* DEVFS */ | ||
571 | COMPATIBLE_IOCTL(DEVFSDIOC_GET_PROTO_REV) | ||
572 | COMPATIBLE_IOCTL(DEVFSDIOC_SET_EVENT_MASK) | ||
573 | COMPATIBLE_IOCTL(DEVFSDIOC_RELEASE_EVENT_QUEUE) | ||
574 | COMPATIBLE_IOCTL(DEVFSDIOC_SET_DEBUG_MASK) | ||
575 | /* Raw devices */ | 570 | /* Raw devices */ |
576 | COMPATIBLE_IOCTL(RAW_SETBIND) | 571 | COMPATIBLE_IOCTL(RAW_SETBIND) |
577 | COMPATIBLE_IOCTL(RAW_GETBIND) | 572 | COMPATIBLE_IOCTL(RAW_GETBIND) |
@@ -673,6 +668,11 @@ COMPATIBLE_IOCTL(CAPI_SET_FLAGS) | |||
673 | COMPATIBLE_IOCTL(CAPI_CLR_FLAGS) | 668 | COMPATIBLE_IOCTL(CAPI_CLR_FLAGS) |
674 | COMPATIBLE_IOCTL(CAPI_NCCI_OPENCOUNT) | 669 | COMPATIBLE_IOCTL(CAPI_NCCI_OPENCOUNT) |
675 | COMPATIBLE_IOCTL(CAPI_NCCI_GETUNIT) | 670 | COMPATIBLE_IOCTL(CAPI_NCCI_GETUNIT) |
671 | /* Siemens Gigaset */ | ||
672 | COMPATIBLE_IOCTL(GIGASET_REDIR) | ||
673 | COMPATIBLE_IOCTL(GIGASET_CONFIG) | ||
674 | COMPATIBLE_IOCTL(GIGASET_BRKCHARS) | ||
675 | COMPATIBLE_IOCTL(GIGASET_VERSION) | ||
676 | /* Misc. */ | 676 | /* Misc. */ |
677 | COMPATIBLE_IOCTL(0x41545900) /* ATYIO_CLKR */ | 677 | COMPATIBLE_IOCTL(0x41545900) /* ATYIO_CLKR */ |
678 | COMPATIBLE_IOCTL(0x41545901) /* ATYIO_CLKW */ | 678 | COMPATIBLE_IOCTL(0x41545901) /* ATYIO_CLKW */ |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index f23d3c6fc2c0..9b4f11094937 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -78,6 +78,7 @@ extern void __chk_io_ptr(void __iomem *); | |||
78 | 78 | ||
79 | #endif /* __ASSEMBLY__ */ | 79 | #endif /* __ASSEMBLY__ */ |
80 | 80 | ||
81 | #ifdef __KERNEL__ | ||
81 | /* | 82 | /* |
82 | * Allow us to mark functions as 'deprecated' and have gcc emit a nice | 83 | * Allow us to mark functions as 'deprecated' and have gcc emit a nice |
83 | * warning for each use, in hopes of speeding the functions removal. | 84 | * warning for each use, in hopes of speeding the functions removal. |
@@ -127,6 +128,16 @@ extern void __chk_io_ptr(void __iomem *); | |||
127 | # define __attribute_pure__ /* unimplemented */ | 128 | # define __attribute_pure__ /* unimplemented */ |
128 | #endif | 129 | #endif |
129 | 130 | ||
131 | #ifndef noinline | ||
132 | #define noinline | ||
133 | #endif | ||
134 | |||
135 | #ifndef __always_inline | ||
136 | #define __always_inline inline | ||
137 | #endif | ||
138 | |||
139 | #endif /* __KERNEL__ */ | ||
140 | |||
130 | /* | 141 | /* |
131 | * From the GCC manual: | 142 | * From the GCC manual: |
132 | * | 143 | * |
@@ -145,12 +156,4 @@ extern void __chk_io_ptr(void __iomem *); | |||
145 | # define __attribute_const__ /* unimplemented */ | 156 | # define __attribute_const__ /* unimplemented */ |
146 | #endif | 157 | #endif |
147 | 158 | ||
148 | #ifndef noinline | ||
149 | #define noinline | ||
150 | #endif | ||
151 | |||
152 | #ifndef __always_inline | ||
153 | #define __always_inline inline | ||
154 | #endif | ||
155 | |||
156 | #endif /* __LINUX_COMPILER_H */ | 159 | #endif /* __LINUX_COMPILER_H */ |
diff --git a/include/linux/connector.h b/include/linux/connector.h index ad1a22c1c42e..4c02119c6ab9 100644 --- a/include/linux/connector.h +++ b/include/linux/connector.h | |||
@@ -34,8 +34,11 @@ | |||
34 | #define CN_VAL_PROC 0x1 | 34 | #define CN_VAL_PROC 0x1 |
35 | #define CN_IDX_CIFS 0x2 | 35 | #define CN_IDX_CIFS 0x2 |
36 | #define CN_VAL_CIFS 0x1 | 36 | #define CN_VAL_CIFS 0x1 |
37 | #define CN_W1_IDX 0x3 /* w1 communication */ | ||
38 | #define CN_W1_VAL 0x1 | ||
37 | 39 | ||
38 | #define CN_NETLINK_USERS 1 | 40 | |
41 | #define CN_NETLINK_USERS 4 | ||
39 | 42 | ||
40 | /* | 43 | /* |
41 | * Maximum connector's message size. | 44 | * Maximum connector's message size. |
diff --git a/include/linux/console.h b/include/linux/console.h index 08734e660d41..3bdf2155e565 100644 --- a/include/linux/console.h +++ b/include/linux/console.h | |||
@@ -63,9 +63,11 @@ extern const struct consw vga_con; /* VGA text console */ | |||
63 | extern const struct consw newport_con; /* SGI Newport console */ | 63 | extern const struct consw newport_con; /* SGI Newport console */ |
64 | extern const struct consw prom_con; /* SPARC PROM console */ | 64 | extern const struct consw prom_con; /* SPARC PROM console */ |
65 | 65 | ||
66 | int con_is_bound(const struct consw *csw); | ||
67 | int register_con_driver(const struct consw *csw, int first, int last); | ||
68 | int unregister_con_driver(const struct consw *csw); | ||
66 | int take_over_console(const struct consw *sw, int first, int last, int deflt); | 69 | int take_over_console(const struct consw *sw, int first, int last, int deflt); |
67 | void give_up_console(const struct consw *sw); | 70 | void give_up_console(const struct consw *sw); |
68 | |||
69 | /* scroll */ | 71 | /* scroll */ |
70 | #define SM_UP (1) | 72 | #define SM_UP (1) |
71 | #define SM_DOWN (2) | 73 | #define SM_DOWN (2) |
@@ -87,6 +89,7 @@ void give_up_console(const struct consw *sw); | |||
87 | #define CON_CONSDEV (2) /* Last on the command line */ | 89 | #define CON_CONSDEV (2) /* Last on the command line */ |
88 | #define CON_ENABLED (4) | 90 | #define CON_ENABLED (4) |
89 | #define CON_BOOT (8) | 91 | #define CON_BOOT (8) |
92 | #define CON_ANYTIME (16) /* Safe to call when cpu is offline */ | ||
90 | 93 | ||
91 | struct console | 94 | struct console |
92 | { | 95 | { |
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 08d50c53aab4..44a11f1ccaf2 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
@@ -31,17 +31,23 @@ struct cpu { | |||
31 | struct sys_device sysdev; | 31 | struct sys_device sysdev; |
32 | }; | 32 | }; |
33 | 33 | ||
34 | extern int register_cpu(struct cpu *, int, struct node *); | 34 | extern int register_cpu(struct cpu *cpu, int num); |
35 | extern struct sys_device *get_cpu_sysdev(unsigned cpu); | 35 | extern struct sys_device *get_cpu_sysdev(unsigned cpu); |
36 | #ifdef CONFIG_HOTPLUG_CPU | 36 | #ifdef CONFIG_HOTPLUG_CPU |
37 | extern void unregister_cpu(struct cpu *, struct node *); | 37 | extern void unregister_cpu(struct cpu *cpu); |
38 | #endif | 38 | #endif |
39 | struct notifier_block; | 39 | struct notifier_block; |
40 | 40 | ||
41 | #ifdef CONFIG_SMP | 41 | #ifdef CONFIG_SMP |
42 | /* Need to know about CPUs going up/down? */ | 42 | /* Need to know about CPUs going up/down? */ |
43 | extern int register_cpu_notifier(struct notifier_block *nb); | 43 | extern int register_cpu_notifier(struct notifier_block *nb); |
44 | #ifdef CONFIG_HOTPLUG_CPU | ||
44 | extern void unregister_cpu_notifier(struct notifier_block *nb); | 45 | extern void unregister_cpu_notifier(struct notifier_block *nb); |
46 | #else | ||
47 | static inline void unregister_cpu_notifier(struct notifier_block *nb) | ||
48 | { | ||
49 | } | ||
50 | #endif | ||
45 | extern int current_in_cpu_hotplug(void); | 51 | extern int current_in_cpu_hotplug(void); |
46 | 52 | ||
47 | int cpu_up(unsigned int cpu); | 53 | int cpu_up(unsigned int cpu); |
@@ -73,13 +79,17 @@ extern int lock_cpu_hotplug_interruptible(void); | |||
73 | { .notifier_call = fn, .priority = pri }; \ | 79 | { .notifier_call = fn, .priority = pri }; \ |
74 | register_cpu_notifier(&fn##_nb); \ | 80 | register_cpu_notifier(&fn##_nb); \ |
75 | } | 81 | } |
82 | #define register_hotcpu_notifier(nb) register_cpu_notifier(nb) | ||
83 | #define unregister_hotcpu_notifier(nb) unregister_cpu_notifier(nb) | ||
76 | int cpu_down(unsigned int cpu); | 84 | int cpu_down(unsigned int cpu); |
77 | #define cpu_is_offline(cpu) unlikely(!cpu_online(cpu)) | 85 | #define cpu_is_offline(cpu) unlikely(!cpu_online(cpu)) |
78 | #else | 86 | #else |
79 | #define lock_cpu_hotplug() do { } while (0) | 87 | #define lock_cpu_hotplug() do { } while (0) |
80 | #define unlock_cpu_hotplug() do { } while (0) | 88 | #define unlock_cpu_hotplug() do { } while (0) |
81 | #define lock_cpu_hotplug_interruptible() 0 | 89 | #define lock_cpu_hotplug_interruptible() 0 |
82 | #define hotcpu_notifier(fn, pri) | 90 | #define hotcpu_notifier(fn, pri) do { } while (0) |
91 | #define register_hotcpu_notifier(nb) do { } while (0) | ||
92 | #define unregister_hotcpu_notifier(nb) do { } while (0) | ||
83 | 93 | ||
84 | /* CPUs don't go offline once they're online w/o CONFIG_HOTPLUG_CPU */ | 94 | /* CPUs don't go offline once they're online w/o CONFIG_HOTPLUG_CPU */ |
85 | static inline int cpu_is_offline(int cpu) { return 0; } | 95 | static inline int cpu_is_offline(int cpu) { return 0; } |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 17866d7e2b71..35e137636b0b 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -15,7 +15,6 @@ | |||
15 | #define _LINUX_CPUFREQ_H | 15 | #define _LINUX_CPUFREQ_H |
16 | 16 | ||
17 | #include <linux/mutex.h> | 17 | #include <linux/mutex.h> |
18 | #include <linux/config.h> | ||
19 | #include <linux/notifier.h> | 18 | #include <linux/notifier.h> |
20 | #include <linux/threads.h> | 19 | #include <linux/threads.h> |
21 | #include <linux/device.h> | 20 | #include <linux/device.h> |
@@ -73,6 +72,8 @@ struct cpufreq_real_policy { | |||
73 | 72 | ||
74 | struct cpufreq_policy { | 73 | struct cpufreq_policy { |
75 | cpumask_t cpus; /* affected CPUs */ | 74 | cpumask_t cpus; /* affected CPUs */ |
75 | unsigned int shared_type; /* ANY or ALL affected CPUs | ||
76 | should set cpufreq */ | ||
76 | unsigned int cpu; /* cpu nr of registered CPU */ | 77 | unsigned int cpu; /* cpu nr of registered CPU */ |
77 | struct cpufreq_cpuinfo cpuinfo;/* see above */ | 78 | struct cpufreq_cpuinfo cpuinfo;/* see above */ |
78 | 79 | ||
@@ -99,6 +100,10 @@ struct cpufreq_policy { | |||
99 | #define CPUFREQ_INCOMPATIBLE (1) | 100 | #define CPUFREQ_INCOMPATIBLE (1) |
100 | #define CPUFREQ_NOTIFY (2) | 101 | #define CPUFREQ_NOTIFY (2) |
101 | 102 | ||
103 | #define CPUFREQ_SHARED_TYPE_NONE (0) /* None */ | ||
104 | #define CPUFREQ_SHARED_TYPE_HW (1) /* HW does needed coordination */ | ||
105 | #define CPUFREQ_SHARED_TYPE_ALL (2) /* All dependent CPUs should set freq */ | ||
106 | #define CPUFREQ_SHARED_TYPE_ANY (3) /* Freq can be set from any dependent CPU*/ | ||
102 | 107 | ||
103 | /******************** cpufreq transition notifiers *******************/ | 108 | /******************** cpufreq transition notifiers *******************/ |
104 | 109 | ||
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 9cbb781d6f80..b268a3c0c376 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -317,7 +317,8 @@ static inline void __cpus_remap(cpumask_t *dstp, const cpumask_t *srcp, | |||
317 | (cpu) < NR_CPUS; \ | 317 | (cpu) < NR_CPUS; \ |
318 | (cpu) = next_cpu((cpu), (mask))) | 318 | (cpu) = next_cpu((cpu), (mask))) |
319 | #else /* NR_CPUS == 1 */ | 319 | #else /* NR_CPUS == 1 */ |
320 | #define for_each_cpu_mask(cpu, mask) for ((cpu) = 0; (cpu) < 1; (cpu)++) | 320 | #define for_each_cpu_mask(cpu, mask) \ |
321 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) | ||
321 | #endif /* NR_CPUS */ | 322 | #endif /* NR_CPUS */ |
322 | 323 | ||
323 | /* | 324 | /* |
@@ -405,7 +406,6 @@ int __any_online_cpu(const cpumask_t *mask); | |||
405 | #define any_online_cpu(mask) 0 | 406 | #define any_online_cpu(mask) 0 |
406 | #endif | 407 | #endif |
407 | 408 | ||
408 | #define for_each_cpu(cpu) for_each_cpu_mask((cpu), cpu_possible_map) | ||
409 | #define for_each_possible_cpu(cpu) for_each_cpu_mask((cpu), cpu_possible_map) | 409 | #define for_each_possible_cpu(cpu) for_each_cpu_mask((cpu), cpu_possible_map) |
410 | #define for_each_online_cpu(cpu) for_each_cpu_mask((cpu), cpu_online_map) | 410 | #define for_each_online_cpu(cpu) for_each_cpu_mask((cpu), cpu_online_map) |
411 | #define for_each_present_cpu(cpu) for_each_cpu_mask((cpu), cpu_present_map) | 411 | #define for_each_present_cpu(cpu) for_each_cpu_mask((cpu), cpu_present_map) |
diff --git a/include/linux/cramfs_fs.h b/include/linux/cramfs_fs.h index a8948f34b776..a41f38428c37 100644 --- a/include/linux/cramfs_fs.h +++ b/include/linux/cramfs_fs.h | |||
@@ -1,13 +1,7 @@ | |||
1 | #ifndef __CRAMFS_H | 1 | #ifndef __CRAMFS_H |
2 | #define __CRAMFS_H | 2 | #define __CRAMFS_H |
3 | 3 | ||
4 | #ifndef __KERNEL__ | 4 | #include <linux/types.h> |
5 | |||
6 | typedef unsigned char u8; | ||
7 | typedef unsigned short u16; | ||
8 | typedef unsigned int u32; | ||
9 | |||
10 | #endif | ||
11 | 5 | ||
12 | #define CRAMFS_MAGIC 0x28cd3d45 /* some random number */ | 6 | #define CRAMFS_MAGIC 0x28cd3d45 /* some random number */ |
13 | #define CRAMFS_SIGNATURE "Compressed ROMFS" | 7 | #define CRAMFS_SIGNATURE "Compressed ROMFS" |
@@ -33,9 +27,9 @@ typedef unsigned int u32; | |||
33 | * Reasonably terse representation of the inode data. | 27 | * Reasonably terse representation of the inode data. |
34 | */ | 28 | */ |
35 | struct cramfs_inode { | 29 | struct cramfs_inode { |
36 | u32 mode:CRAMFS_MODE_WIDTH, uid:CRAMFS_UID_WIDTH; | 30 | __u32 mode:CRAMFS_MODE_WIDTH, uid:CRAMFS_UID_WIDTH; |
37 | /* SIZE for device files is i_rdev */ | 31 | /* SIZE for device files is i_rdev */ |
38 | u32 size:CRAMFS_SIZE_WIDTH, gid:CRAMFS_GID_WIDTH; | 32 | __u32 size:CRAMFS_SIZE_WIDTH, gid:CRAMFS_GID_WIDTH; |
39 | /* NAMELEN is the length of the file name, divided by 4 and | 33 | /* NAMELEN is the length of the file name, divided by 4 and |
40 | rounded up. (cramfs doesn't support hard links.) */ | 34 | rounded up. (cramfs doesn't support hard links.) */ |
41 | /* OFFSET: For symlinks and non-empty regular files, this | 35 | /* OFFSET: For symlinks and non-empty regular files, this |
@@ -44,27 +38,27 @@ struct cramfs_inode { | |||
44 | see README). For non-empty directories it is the offset | 38 | see README). For non-empty directories it is the offset |
45 | (divided by 4) of the inode of the first file in that | 39 | (divided by 4) of the inode of the first file in that |
46 | directory. For anything else, offset is zero. */ | 40 | directory. For anything else, offset is zero. */ |
47 | u32 namelen:CRAMFS_NAMELEN_WIDTH, offset:CRAMFS_OFFSET_WIDTH; | 41 | __u32 namelen:CRAMFS_NAMELEN_WIDTH, offset:CRAMFS_OFFSET_WIDTH; |
48 | }; | 42 | }; |
49 | 43 | ||
50 | struct cramfs_info { | 44 | struct cramfs_info { |
51 | u32 crc; | 45 | __u32 crc; |
52 | u32 edition; | 46 | __u32 edition; |
53 | u32 blocks; | 47 | __u32 blocks; |
54 | u32 files; | 48 | __u32 files; |
55 | }; | 49 | }; |
56 | 50 | ||
57 | /* | 51 | /* |
58 | * Superblock information at the beginning of the FS. | 52 | * Superblock information at the beginning of the FS. |
59 | */ | 53 | */ |
60 | struct cramfs_super { | 54 | struct cramfs_super { |
61 | u32 magic; /* 0x28cd3d45 - random number */ | 55 | __u32 magic; /* 0x28cd3d45 - random number */ |
62 | u32 size; /* length in bytes */ | 56 | __u32 size; /* length in bytes */ |
63 | u32 flags; /* feature flags */ | 57 | __u32 flags; /* feature flags */ |
64 | u32 future; /* reserved for future use */ | 58 | __u32 future; /* reserved for future use */ |
65 | u8 signature[16]; /* "Compressed ROMFS" */ | 59 | __u8 signature[16]; /* "Compressed ROMFS" */ |
66 | struct cramfs_info fsid; /* unique filesystem info */ | 60 | struct cramfs_info fsid; /* unique filesystem info */ |
67 | u8 name[16]; /* user-defined name */ | 61 | __u8 name[16]; /* user-defined name */ |
68 | struct cramfs_inode root; /* root inode data */ | 62 | struct cramfs_inode root; /* root inode data */ |
69 | }; | 63 | }; |
70 | 64 | ||
diff --git a/include/linux/crypto.h b/include/linux/crypto.h index 0ab1bc1152ca..7f946241b879 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h | |||
@@ -17,7 +17,6 @@ | |||
17 | #ifndef _LINUX_CRYPTO_H | 17 | #ifndef _LINUX_CRYPTO_H |
18 | #define _LINUX_CRYPTO_H | 18 | #define _LINUX_CRYPTO_H |
19 | 19 | ||
20 | #include <linux/config.h> | ||
21 | #include <linux/module.h> | 20 | #include <linux/module.h> |
22 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
23 | #include <linux/types.h> | 22 | #include <linux/types.h> |
@@ -67,7 +66,7 @@ struct crypto_tfm; | |||
67 | 66 | ||
68 | struct cipher_desc { | 67 | struct cipher_desc { |
69 | struct crypto_tfm *tfm; | 68 | struct crypto_tfm *tfm; |
70 | void (*crfn)(void *ctx, u8 *dst, const u8 *src); | 69 | void (*crfn)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); |
71 | unsigned int (*prfn)(const struct cipher_desc *desc, u8 *dst, | 70 | unsigned int (*prfn)(const struct cipher_desc *desc, u8 *dst, |
72 | const u8 *src, unsigned int nbytes); | 71 | const u8 *src, unsigned int nbytes); |
73 | void *info; | 72 | void *info; |
@@ -80,10 +79,10 @@ struct cipher_desc { | |||
80 | struct cipher_alg { | 79 | struct cipher_alg { |
81 | unsigned int cia_min_keysize; | 80 | unsigned int cia_min_keysize; |
82 | unsigned int cia_max_keysize; | 81 | unsigned int cia_max_keysize; |
83 | int (*cia_setkey)(void *ctx, const u8 *key, | 82 | int (*cia_setkey)(struct crypto_tfm *tfm, const u8 *key, |
84 | unsigned int keylen, u32 *flags); | 83 | unsigned int keylen, u32 *flags); |
85 | void (*cia_encrypt)(void *ctx, u8 *dst, const u8 *src); | 84 | void (*cia_encrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); |
86 | void (*cia_decrypt)(void *ctx, u8 *dst, const u8 *src); | 85 | void (*cia_decrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); |
87 | 86 | ||
88 | unsigned int (*cia_encrypt_ecb)(const struct cipher_desc *desc, | 87 | unsigned int (*cia_encrypt_ecb)(const struct cipher_desc *desc, |
89 | u8 *dst, const u8 *src, | 88 | u8 *dst, const u8 *src, |
@@ -101,20 +100,19 @@ struct cipher_alg { | |||
101 | 100 | ||
102 | struct digest_alg { | 101 | struct digest_alg { |
103 | unsigned int dia_digestsize; | 102 | unsigned int dia_digestsize; |
104 | void (*dia_init)(void *ctx); | 103 | void (*dia_init)(struct crypto_tfm *tfm); |
105 | void (*dia_update)(void *ctx, const u8 *data, unsigned int len); | 104 | void (*dia_update)(struct crypto_tfm *tfm, const u8 *data, |
106 | void (*dia_final)(void *ctx, u8 *out); | 105 | unsigned int len); |
107 | int (*dia_setkey)(void *ctx, const u8 *key, | 106 | void (*dia_final)(struct crypto_tfm *tfm, u8 *out); |
107 | int (*dia_setkey)(struct crypto_tfm *tfm, const u8 *key, | ||
108 | unsigned int keylen, u32 *flags); | 108 | unsigned int keylen, u32 *flags); |
109 | }; | 109 | }; |
110 | 110 | ||
111 | struct compress_alg { | 111 | struct compress_alg { |
112 | int (*coa_init)(void *ctx); | 112 | int (*coa_compress)(struct crypto_tfm *tfm, const u8 *src, |
113 | void (*coa_exit)(void *ctx); | 113 | unsigned int slen, u8 *dst, unsigned int *dlen); |
114 | int (*coa_compress)(void *ctx, const u8 *src, unsigned int slen, | 114 | int (*coa_decompress)(struct crypto_tfm *tfm, const u8 *src, |
115 | u8 *dst, unsigned int *dlen); | 115 | unsigned int slen, u8 *dst, unsigned int *dlen); |
116 | int (*coa_decompress)(void *ctx, const u8 *src, unsigned int slen, | ||
117 | u8 *dst, unsigned int *dlen); | ||
118 | }; | 116 | }; |
119 | 117 | ||
120 | #define cra_cipher cra_u.cipher | 118 | #define cra_cipher cra_u.cipher |
@@ -130,14 +128,17 @@ struct crypto_alg { | |||
130 | 128 | ||
131 | int cra_priority; | 129 | int cra_priority; |
132 | 130 | ||
133 | const char cra_name[CRYPTO_MAX_ALG_NAME]; | 131 | char cra_name[CRYPTO_MAX_ALG_NAME]; |
134 | const char cra_driver_name[CRYPTO_MAX_ALG_NAME]; | 132 | char cra_driver_name[CRYPTO_MAX_ALG_NAME]; |
135 | 133 | ||
136 | union { | 134 | union { |
137 | struct cipher_alg cipher; | 135 | struct cipher_alg cipher; |
138 | struct digest_alg digest; | 136 | struct digest_alg digest; |
139 | struct compress_alg compress; | 137 | struct compress_alg compress; |
140 | } cra_u; | 138 | } cra_u; |
139 | |||
140 | int (*cra_init)(struct crypto_tfm *tfm); | ||
141 | void (*cra_exit)(struct crypto_tfm *tfm); | ||
141 | 142 | ||
142 | struct module *cra_module; | 143 | struct module *cra_module; |
143 | }; | 144 | }; |
diff --git a/include/linux/cyclomx.h b/include/linux/cyclomx.h index 300d704bdb9a..b88f7f428e58 100644 --- a/include/linux/cyclomx.h +++ b/include/linux/cyclomx.h | |||
@@ -24,7 +24,6 @@ | |||
24 | * 1998/08/08 acme Version 0.0.1 | 24 | * 1998/08/08 acme Version 0.0.1 |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include <linux/config.h> | ||
28 | #include <linux/wanrouter.h> | 27 | #include <linux/wanrouter.h> |
29 | #include <linux/spinlock.h> | 28 | #include <linux/spinlock.h> |
30 | 29 | ||
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 836325ee0931..0dd1610a94a9 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
@@ -217,7 +217,6 @@ extern struct dentry * d_alloc_anon(struct inode *); | |||
217 | extern struct dentry * d_splice_alias(struct inode *, struct dentry *); | 217 | extern struct dentry * d_splice_alias(struct inode *, struct dentry *); |
218 | extern void shrink_dcache_sb(struct super_block *); | 218 | extern void shrink_dcache_sb(struct super_block *); |
219 | extern void shrink_dcache_parent(struct dentry *); | 219 | extern void shrink_dcache_parent(struct dentry *); |
220 | extern void shrink_dcache_anon(struct hlist_head *); | ||
221 | extern int d_invalidate(struct dentry *); | 220 | extern int d_invalidate(struct dentry *); |
222 | 221 | ||
223 | /* only used at mount-time */ | 222 | /* only used at mount-time */ |
diff --git a/include/linux/dcookies.h b/include/linux/dcookies.h index 1d68428c925d..0fe7cdf326f7 100644 --- a/include/linux/dcookies.h +++ b/include/linux/dcookies.h | |||
@@ -9,7 +9,6 @@ | |||
9 | #ifndef DCOOKIES_H | 9 | #ifndef DCOOKIES_H |
10 | #define DCOOKIES_H | 10 | #define DCOOKIES_H |
11 | 11 | ||
12 | #include <linux/config.h> | ||
13 | 12 | ||
14 | #ifdef CONFIG_PROFILING | 13 | #ifdef CONFIG_PROFILING |
15 | 14 | ||
diff --git a/include/linux/delay.h b/include/linux/delay.h index acb74865b973..17ddb55430ae 100644 --- a/include/linux/delay.h +++ b/include/linux/delay.h | |||
@@ -25,10 +25,7 @@ extern unsigned long loops_per_jiffy; | |||
25 | #define MAX_UDELAY_MS 5 | 25 | #define MAX_UDELAY_MS 5 |
26 | #endif | 26 | #endif |
27 | 27 | ||
28 | #ifdef notdef | 28 | #ifndef mdelay |
29 | #define mdelay(n) (\ | ||
30 | {unsigned long __ms=(n); while (__ms--) udelay(1000);}) | ||
31 | #else | ||
32 | #define mdelay(n) (\ | 29 | #define mdelay(n) (\ |
33 | (__builtin_constant_p(n) && (n)<=MAX_UDELAY_MS) ? udelay((n)*1000) : \ | 30 | (__builtin_constant_p(n) && (n)<=MAX_UDELAY_MS) ? udelay((n)*1000) : \ |
34 | ({unsigned long __ms=(n); while (__ms--) udelay(1000);})) | 31 | ({unsigned long __ms=(n); while (__ms--) udelay(1000);})) |
diff --git a/include/linux/devfs_fs.h b/include/linux/devfs_fs.h deleted file mode 100644 index de236f431877..000000000000 --- a/include/linux/devfs_fs.h +++ /dev/null | |||
@@ -1,41 +0,0 @@ | |||
1 | #ifndef _LINUX_DEVFS_FS_H | ||
2 | #define _LINUX_DEVFS_FS_H | ||
3 | |||
4 | #include <linux/ioctl.h> | ||
5 | |||
6 | #define DEVFSD_PROTOCOL_REVISION_KERNEL 5 | ||
7 | |||
8 | #define DEVFSD_IOCTL_BASE 'd' | ||
9 | |||
10 | /* These are the various ioctls */ | ||
11 | #define DEVFSDIOC_GET_PROTO_REV _IOR(DEVFSD_IOCTL_BASE, 0, int) | ||
12 | #define DEVFSDIOC_SET_EVENT_MASK _IOW(DEVFSD_IOCTL_BASE, 2, int) | ||
13 | #define DEVFSDIOC_RELEASE_EVENT_QUEUE _IOW(DEVFSD_IOCTL_BASE, 3, int) | ||
14 | #define DEVFSDIOC_SET_DEBUG_MASK _IOW(DEVFSD_IOCTL_BASE, 4, int) | ||
15 | |||
16 | #define DEVFSD_NOTIFY_REGISTERED 0 | ||
17 | #define DEVFSD_NOTIFY_UNREGISTERED 1 | ||
18 | #define DEVFSD_NOTIFY_ASYNC_OPEN 2 | ||
19 | #define DEVFSD_NOTIFY_CLOSE 3 | ||
20 | #define DEVFSD_NOTIFY_LOOKUP 4 | ||
21 | #define DEVFSD_NOTIFY_CHANGE 5 | ||
22 | #define DEVFSD_NOTIFY_CREATE 6 | ||
23 | #define DEVFSD_NOTIFY_DELETE 7 | ||
24 | |||
25 | #define DEVFS_PATHLEN 1024 /* Never change this otherwise the | ||
26 | binary interface will change */ | ||
27 | |||
28 | struct devfsd_notify_struct { /* Use native C types to ensure same types in kernel and user space */ | ||
29 | unsigned int type; /* DEVFSD_NOTIFY_* value */ | ||
30 | unsigned int mode; /* Mode of the inode or device entry */ | ||
31 | unsigned int major; /* Major number of device entry */ | ||
32 | unsigned int minor; /* Minor number of device entry */ | ||
33 | unsigned int uid; /* Uid of process, inode or device entry */ | ||
34 | unsigned int gid; /* Gid of process, inode or device entry */ | ||
35 | unsigned int overrun_count; /* Number of lost events */ | ||
36 | unsigned int namelen; /* Number of characters not including '\0' */ | ||
37 | /* The device name MUST come last */ | ||
38 | char devname[DEVFS_PATHLEN]; /* This will be '\0' terminated */ | ||
39 | }; | ||
40 | |||
41 | #endif /* _LINUX_DEVFS_FS_H */ | ||
diff --git a/include/linux/devfs_fs_kernel.h b/include/linux/devfs_fs_kernel.h deleted file mode 100644 index 89810e73d256..000000000000 --- a/include/linux/devfs_fs_kernel.h +++ /dev/null | |||
@@ -1,58 +0,0 @@ | |||
1 | #ifndef _LINUX_DEVFS_FS_KERNEL_H | ||
2 | #define _LINUX_DEVFS_FS_KERNEL_H | ||
3 | |||
4 | #include <linux/fs.h> | ||
5 | #include <linux/config.h> | ||
6 | #include <linux/spinlock.h> | ||
7 | #include <linux/types.h> | ||
8 | |||
9 | #include <asm/semaphore.h> | ||
10 | |||
11 | #define DEVFS_SUPER_MAGIC 0x1373 | ||
12 | |||
13 | #ifdef CONFIG_DEVFS_FS | ||
14 | extern int devfs_mk_bdev(dev_t dev, umode_t mode, const char *fmt, ...) | ||
15 | __attribute__ ((format(printf, 3, 4))); | ||
16 | extern int devfs_mk_cdev(dev_t dev, umode_t mode, const char *fmt, ...) | ||
17 | __attribute__ ((format(printf, 3, 4))); | ||
18 | extern int devfs_mk_symlink(const char *name, const char *link); | ||
19 | extern int devfs_mk_dir(const char *fmt, ...) | ||
20 | __attribute__ ((format(printf, 1, 2))); | ||
21 | extern void devfs_remove(const char *fmt, ...) | ||
22 | __attribute__ ((format(printf, 1, 2))); | ||
23 | extern int devfs_register_tape(const char *name); | ||
24 | extern void devfs_unregister_tape(int num); | ||
25 | extern void mount_devfs_fs(void); | ||
26 | #else /* CONFIG_DEVFS_FS */ | ||
27 | static inline int devfs_mk_bdev(dev_t dev, umode_t mode, const char *fmt, ...) | ||
28 | { | ||
29 | return 0; | ||
30 | } | ||
31 | static inline int devfs_mk_cdev(dev_t dev, umode_t mode, const char *fmt, ...) | ||
32 | { | ||
33 | return 0; | ||
34 | } | ||
35 | static inline int devfs_mk_symlink(const char *name, const char *link) | ||
36 | { | ||
37 | return 0; | ||
38 | } | ||
39 | static inline int devfs_mk_dir(const char *fmt, ...) | ||
40 | { | ||
41 | return 0; | ||
42 | } | ||
43 | static inline void devfs_remove(const char *fmt, ...) | ||
44 | { | ||
45 | } | ||
46 | static inline int devfs_register_tape(const char *name) | ||
47 | { | ||
48 | return -1; | ||
49 | } | ||
50 | static inline void devfs_unregister_tape(int num) | ||
51 | { | ||
52 | } | ||
53 | static inline void mount_devfs_fs(void) | ||
54 | { | ||
55 | return; | ||
56 | } | ||
57 | #endif /* CONFIG_DEVFS_FS */ | ||
58 | #endif /* _LINUX_DEVFS_FS_KERNEL_H */ | ||
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index aee10b2ea4c6..e3d1c33d1558 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -8,9 +8,12 @@ | |||
8 | #ifndef _LINUX_DEVICE_MAPPER_H | 8 | #ifndef _LINUX_DEVICE_MAPPER_H |
9 | #define _LINUX_DEVICE_MAPPER_H | 9 | #define _LINUX_DEVICE_MAPPER_H |
10 | 10 | ||
11 | #ifdef __KERNEL__ | ||
12 | |||
11 | struct dm_target; | 13 | struct dm_target; |
12 | struct dm_table; | 14 | struct dm_table; |
13 | struct dm_dev; | 15 | struct dm_dev; |
16 | struct mapped_device; | ||
14 | 17 | ||
15 | typedef enum { STATUSTYPE_INFO, STATUSTYPE_TABLE } status_type_t; | 18 | typedef enum { STATUSTYPE_INFO, STATUSTYPE_TABLE } status_type_t; |
16 | 19 | ||
@@ -78,7 +81,7 @@ void dm_put_device(struct dm_target *ti, struct dm_dev *d); | |||
78 | struct target_type { | 81 | struct target_type { |
79 | const char *name; | 82 | const char *name; |
80 | struct module *module; | 83 | struct module *module; |
81 | unsigned version[3]; | 84 | unsigned version[3]; |
82 | dm_ctr_fn ctr; | 85 | dm_ctr_fn ctr; |
83 | dm_dtr_fn dtr; | 86 | dm_dtr_fn dtr; |
84 | dm_map_fn map; | 87 | dm_map_fn map; |
@@ -128,4 +131,108 @@ struct dm_target { | |||
128 | int dm_register_target(struct target_type *t); | 131 | int dm_register_target(struct target_type *t); |
129 | int dm_unregister_target(struct target_type *t); | 132 | int dm_unregister_target(struct target_type *t); |
130 | 133 | ||
131 | #endif /* _LINUX_DEVICE_MAPPER_H */ | 134 | |
135 | /*----------------------------------------------------------------- | ||
136 | * Functions for creating and manipulating mapped devices. | ||
137 | * Drop the reference with dm_put when you finish with the object. | ||
138 | *---------------------------------------------------------------*/ | ||
139 | |||
140 | /* | ||
141 | * DM_ANY_MINOR chooses the next available minor number. | ||
142 | */ | ||
143 | #define DM_ANY_MINOR (-1) | ||
144 | int dm_create(int minor, struct mapped_device **md); | ||
145 | |||
146 | /* | ||
147 | * Reference counting for md. | ||
148 | */ | ||
149 | struct mapped_device *dm_get_md(dev_t dev); | ||
150 | void dm_get(struct mapped_device *md); | ||
151 | void dm_put(struct mapped_device *md); | ||
152 | |||
153 | /* | ||
154 | * An arbitrary pointer may be stored alongside a mapped device. | ||
155 | */ | ||
156 | void dm_set_mdptr(struct mapped_device *md, void *ptr); | ||
157 | void *dm_get_mdptr(struct mapped_device *md); | ||
158 | |||
159 | /* | ||
160 | * A device can still be used while suspended, but I/O is deferred. | ||
161 | */ | ||
162 | int dm_suspend(struct mapped_device *md, int with_lockfs); | ||
163 | int dm_resume(struct mapped_device *md); | ||
164 | |||
165 | /* | ||
166 | * Event functions. | ||
167 | */ | ||
168 | uint32_t dm_get_event_nr(struct mapped_device *md); | ||
169 | int dm_wait_event(struct mapped_device *md, int event_nr); | ||
170 | |||
171 | /* | ||
172 | * Info functions. | ||
173 | */ | ||
174 | const char *dm_device_name(struct mapped_device *md); | ||
175 | struct gendisk *dm_disk(struct mapped_device *md); | ||
176 | int dm_suspended(struct mapped_device *md); | ||
177 | |||
178 | /* | ||
179 | * Geometry functions. | ||
180 | */ | ||
181 | int dm_get_geometry(struct mapped_device *md, struct hd_geometry *geo); | ||
182 | int dm_set_geometry(struct mapped_device *md, struct hd_geometry *geo); | ||
183 | |||
184 | |||
185 | /*----------------------------------------------------------------- | ||
186 | * Functions for manipulating device-mapper tables. | ||
187 | *---------------------------------------------------------------*/ | ||
188 | |||
189 | /* | ||
190 | * First create an empty table. | ||
191 | */ | ||
192 | int dm_table_create(struct dm_table **result, int mode, | ||
193 | unsigned num_targets, struct mapped_device *md); | ||
194 | |||
195 | /* | ||
196 | * Then call this once for each target. | ||
197 | */ | ||
198 | int dm_table_add_target(struct dm_table *t, const char *type, | ||
199 | sector_t start, sector_t len, char *params); | ||
200 | |||
201 | /* | ||
202 | * Finally call this to make the table ready for use. | ||
203 | */ | ||
204 | int dm_table_complete(struct dm_table *t); | ||
205 | |||
206 | /* | ||
207 | * Table reference counting. | ||
208 | */ | ||
209 | struct dm_table *dm_get_table(struct mapped_device *md); | ||
210 | void dm_table_get(struct dm_table *t); | ||
211 | void dm_table_put(struct dm_table *t); | ||
212 | |||
213 | /* | ||
214 | * Queries | ||
215 | */ | ||
216 | sector_t dm_table_get_size(struct dm_table *t); | ||
217 | unsigned int dm_table_get_num_targets(struct dm_table *t); | ||
218 | int dm_table_get_mode(struct dm_table *t); | ||
219 | struct mapped_device *dm_table_get_md(struct dm_table *t); | ||
220 | |||
221 | /* | ||
222 | * Trigger an event. | ||
223 | */ | ||
224 | void dm_table_event(struct dm_table *t); | ||
225 | |||
226 | /* | ||
227 | * The device must be suspended before calling this method. | ||
228 | */ | ||
229 | int dm_swap_table(struct mapped_device *md, struct dm_table *t); | ||
230 | |||
231 | /* | ||
232 | * Prepare a table for a device that will error all I/O. | ||
233 | * To make it active, call dm_suspend(), dm_swap_table() then dm_resume(). | ||
234 | */ | ||
235 | int dm_create_error_table(struct dm_table **result, struct mapped_device *md); | ||
236 | |||
237 | #endif /* __KERNEL__ */ | ||
238 | #endif /* _LINUX_DEVICE_MAPPER_H */ | ||
diff --git a/include/linux/device.h b/include/linux/device.h index e8e53b9accc6..1e5f30da98bc 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -11,7 +11,6 @@ | |||
11 | #ifndef _DEVICE_H_ | 11 | #ifndef _DEVICE_H_ |
12 | #define _DEVICE_H_ | 12 | #define _DEVICE_H_ |
13 | 13 | ||
14 | #include <linux/config.h> | ||
15 | #include <linux/ioport.h> | 14 | #include <linux/ioport.h> |
16 | #include <linux/kobject.h> | 15 | #include <linux/kobject.h> |
17 | #include <linux/klist.h> | 16 | #include <linux/klist.h> |
@@ -61,11 +60,6 @@ extern void bus_unregister(struct bus_type * bus); | |||
61 | 60 | ||
62 | extern void bus_rescan_devices(struct bus_type * bus); | 61 | extern void bus_rescan_devices(struct bus_type * bus); |
63 | 62 | ||
64 | extern struct bus_type * get_bus(struct bus_type * bus); | ||
65 | extern void put_bus(struct bus_type * bus); | ||
66 | |||
67 | extern struct bus_type * find_bus(char * name); | ||
68 | |||
69 | /* iterator helpers for buses */ | 63 | /* iterator helpers for buses */ |
70 | 64 | ||
71 | int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data, | 65 | int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data, |
@@ -148,6 +142,7 @@ struct class { | |||
148 | 142 | ||
149 | struct subsystem subsys; | 143 | struct subsystem subsys; |
150 | struct list_head children; | 144 | struct list_head children; |
145 | struct list_head devices; | ||
151 | struct list_head interfaces; | 146 | struct list_head interfaces; |
152 | struct semaphore sem; /* locks both the children and interfaces lists */ | 147 | struct semaphore sem; /* locks both the children and interfaces lists */ |
153 | 148 | ||
@@ -164,9 +159,6 @@ struct class { | |||
164 | extern int class_register(struct class *); | 159 | extern int class_register(struct class *); |
165 | extern void class_unregister(struct class *); | 160 | extern void class_unregister(struct class *); |
166 | 161 | ||
167 | extern struct class * class_get(struct class *); | ||
168 | extern void class_put(struct class *); | ||
169 | |||
170 | 162 | ||
171 | struct class_attribute { | 163 | struct class_attribute { |
172 | struct attribute attr; | 164 | struct attribute attr; |
@@ -314,6 +306,7 @@ struct device { | |||
314 | struct kobject kobj; | 306 | struct kobject kobj; |
315 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ | 307 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ |
316 | struct device_attribute uevent_attr; | 308 | struct device_attribute uevent_attr; |
309 | struct device_attribute *devt_attr; | ||
317 | 310 | ||
318 | struct semaphore sem; /* semaphore to synchronize calls to | 311 | struct semaphore sem; /* semaphore to synchronize calls to |
319 | * its driver. | 312 | * its driver. |
@@ -341,6 +334,11 @@ struct device { | |||
341 | struct dma_coherent_mem *dma_mem; /* internal for coherent mem | 334 | struct dma_coherent_mem *dma_mem; /* internal for coherent mem |
342 | override */ | 335 | override */ |
343 | 336 | ||
337 | /* class_device migration path */ | ||
338 | struct list_head node; | ||
339 | struct class *class; /* optional*/ | ||
340 | dev_t devt; /* dev_t, creates the sysfs "dev" */ | ||
341 | |||
344 | void (*release)(struct device * dev); | 342 | void (*release)(struct device * dev); |
345 | }; | 343 | }; |
346 | 344 | ||
@@ -382,6 +380,13 @@ extern int device_attach(struct device * dev); | |||
382 | extern void driver_attach(struct device_driver * drv); | 380 | extern void driver_attach(struct device_driver * drv); |
383 | extern void device_reprobe(struct device *dev); | 381 | extern void device_reprobe(struct device *dev); |
384 | 382 | ||
383 | /* | ||
384 | * Easy functions for dynamically creating devices on the fly | ||
385 | */ | ||
386 | extern struct device *device_create(struct class *cls, struct device *parent, | ||
387 | dev_t devt, char *fmt, ...) | ||
388 | __attribute__((format(printf,4,5))); | ||
389 | extern void device_destroy(struct class *cls, dev_t devt); | ||
385 | 390 | ||
386 | /* | 391 | /* |
387 | * Platform "fixup" functions - allow the platform to have their say | 392 | * Platform "fixup" functions - allow the platform to have their say |
@@ -411,8 +416,9 @@ extern int firmware_register(struct subsystem *); | |||
411 | extern void firmware_unregister(struct subsystem *); | 416 | extern void firmware_unregister(struct subsystem *); |
412 | 417 | ||
413 | /* debugging and troubleshooting/diagnostic helpers. */ | 418 | /* debugging and troubleshooting/diagnostic helpers. */ |
419 | extern const char *dev_driver_string(struct device *dev); | ||
414 | #define dev_printk(level, dev, format, arg...) \ | 420 | #define dev_printk(level, dev, format, arg...) \ |
415 | printk(level "%s %s: " format , (dev)->driver ? (dev)->driver->name : "" , (dev)->bus_id , ## arg) | 421 | printk(level "%s %s: " format , dev_driver_string(dev) , (dev)->bus_id , ## arg) |
416 | 422 | ||
417 | #ifdef DEBUG | 423 | #ifdef DEBUG |
418 | #define dev_dbg(dev, format, arg...) \ | 424 | #define dev_dbg(dev, format, arg...) \ |
diff --git a/include/linux/divert.h b/include/linux/divert.h index 6919b09133d4..8fb4e9de6843 100644 --- a/include/linux/divert.h +++ b/include/linux/divert.h | |||
@@ -27,10 +27,10 @@ struct divert_blk | |||
27 | { | 27 | { |
28 | int divert; /* are we active */ | 28 | int divert; /* are we active */ |
29 | unsigned int protos; /* protocols */ | 29 | unsigned int protos; /* protocols */ |
30 | u16 tcp_dst[MAX_DIVERT_PORTS]; /* specific tcp dst ports to divert */ | 30 | __u16 tcp_dst[MAX_DIVERT_PORTS]; /* specific tcp dst ports to divert */ |
31 | u16 tcp_src[MAX_DIVERT_PORTS]; /* specific tcp src ports to divert */ | 31 | __u16 tcp_src[MAX_DIVERT_PORTS]; /* specific tcp src ports to divert */ |
32 | u16 udp_dst[MAX_DIVERT_PORTS]; /* specific udp dst ports to divert */ | 32 | __u16 udp_dst[MAX_DIVERT_PORTS]; /* specific udp dst ports to divert */ |
33 | u16 udp_src[MAX_DIVERT_PORTS]; /* specific udp src ports to divert */ | 33 | __u16 udp_src[MAX_DIVERT_PORTS]; /* specific udp src ports to divert */ |
34 | }; | 34 | }; |
35 | 35 | ||
36 | /* | 36 | /* |
@@ -40,12 +40,12 @@ struct divert_blk | |||
40 | 40 | ||
41 | typedef union _divert_cf_arg | 41 | typedef union _divert_cf_arg |
42 | { | 42 | { |
43 | s16 int16; | 43 | __s16 int16; |
44 | u16 uint16; | 44 | __u16 uint16; |
45 | s32 int32; | 45 | __s32 int32; |
46 | u32 uint32; | 46 | __u32 uint32; |
47 | s64 int64; | 47 | __s64 int64; |
48 | u64 uint64; | 48 | __u64 uint64; |
49 | void __user *ptr; | 49 | void __user *ptr; |
50 | } divert_cf_arg; | 50 | } divert_cf_arg; |
51 | 51 | ||
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h index c67c6786612a..9623bb625090 100644 --- a/include/linux/dm-ioctl.h +++ b/include/linux/dm-ioctl.h | |||
@@ -285,9 +285,9 @@ typedef char ioctl_struct[308]; | |||
285 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) | 285 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) |
286 | 286 | ||
287 | #define DM_VERSION_MAJOR 4 | 287 | #define DM_VERSION_MAJOR 4 |
288 | #define DM_VERSION_MINOR 6 | 288 | #define DM_VERSION_MINOR 7 |
289 | #define DM_VERSION_PATCHLEVEL 0 | 289 | #define DM_VERSION_PATCHLEVEL 0 |
290 | #define DM_VERSION_EXTRA "-ioctl (2006-02-17)" | 290 | #define DM_VERSION_EXTRA "-ioctl (2006-06-24)" |
291 | 291 | ||
292 | /* Status bits */ | 292 | /* Status bits */ |
293 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ | 293 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ |
@@ -314,7 +314,7 @@ typedef char ioctl_struct[308]; | |||
314 | #define DM_BUFFER_FULL_FLAG (1 << 8) /* Out */ | 314 | #define DM_BUFFER_FULL_FLAG (1 << 8) /* Out */ |
315 | 315 | ||
316 | /* | 316 | /* |
317 | * Set this to improve performance when you aren't going to use open_count. | 317 | * This flag is now ignored. |
318 | */ | 318 | */ |
319 | #define DM_SKIP_BDGET_FLAG (1 << 9) /* In */ | 319 | #define DM_SKIP_BDGET_FLAG (1 << 9) /* In */ |
320 | 320 | ||
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 78b236ca04f8..272010a6078a 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -20,7 +20,7 @@ | |||
20 | */ | 20 | */ |
21 | #ifndef DMAENGINE_H | 21 | #ifndef DMAENGINE_H |
22 | #define DMAENGINE_H | 22 | #define DMAENGINE_H |
23 | #include <linux/config.h> | 23 | |
24 | #ifdef CONFIG_DMA_ENGINE | 24 | #ifdef CONFIG_DMA_ENGINE |
25 | 25 | ||
26 | #include <linux/device.h> | 26 | #include <linux/device.h> |
diff --git a/include/linux/dmi.h b/include/linux/dmi.h index 64fd6c366604..b2cd2071d432 100644 --- a/include/linux/dmi.h +++ b/include/linux/dmi.h | |||
@@ -2,7 +2,6 @@ | |||
2 | #define __DMI_H__ | 2 | #define __DMI_H__ |
3 | 3 | ||
4 | #include <linux/list.h> | 4 | #include <linux/list.h> |
5 | #include <linux/config.h> | ||
6 | 5 | ||
7 | enum dmi_field { | 6 | enum dmi_field { |
8 | DMI_NONE, | 7 | DMI_NONE, |
diff --git a/include/linux/dnotify.h b/include/linux/dnotify.h index f134a01975c7..102a902b4396 100644 --- a/include/linux/dnotify.h +++ b/include/linux/dnotify.h | |||
@@ -18,7 +18,6 @@ struct dnotify_struct { | |||
18 | 18 | ||
19 | #ifdef __KERNEL__ | 19 | #ifdef __KERNEL__ |
20 | 20 | ||
21 | #include <linux/config.h> | ||
22 | 21 | ||
23 | #ifdef CONFIG_DNOTIFY | 22 | #ifdef CONFIG_DNOTIFY |
24 | 23 | ||
diff --git a/include/linux/dqblk_xfs.h b/include/linux/dqblk_xfs.h index 2fda1b2aabd9..527504c11c5e 100644 --- a/include/linux/dqblk_xfs.h +++ b/include/linux/dqblk_xfs.h | |||
@@ -125,14 +125,14 @@ typedef struct fs_disk_quota { | |||
125 | 125 | ||
126 | /* | 126 | /* |
127 | * fs_quota_stat is the struct returned in Q_XGETQSTAT for a given file system. | 127 | * fs_quota_stat is the struct returned in Q_XGETQSTAT for a given file system. |
128 | * Provides a centralized way to get meta infomation about the quota subsystem. | 128 | * Provides a centralized way to get meta information about the quota subsystem. |
129 | * eg. space taken up for user and group quotas, number of dquots currently | 129 | * eg. space taken up for user and group quotas, number of dquots currently |
130 | * incore. | 130 | * incore. |
131 | */ | 131 | */ |
132 | #define FS_QSTAT_VERSION 1 /* fs_quota_stat.qs_version */ | 132 | #define FS_QSTAT_VERSION 1 /* fs_quota_stat.qs_version */ |
133 | 133 | ||
134 | /* | 134 | /* |
135 | * Some basic infomation about 'quota files'. | 135 | * Some basic information about 'quota files'. |
136 | */ | 136 | */ |
137 | typedef struct fs_qfilestat { | 137 | typedef struct fs_qfilestat { |
138 | __u64 qfs_ino; /* inode number */ | 138 | __u64 qfs_ino; /* inode number */ |
diff --git a/include/linux/dvb/dmx.h b/include/linux/dvb/dmx.h index 2787b8a22ff1..c6a2353c4e68 100644 --- a/include/linux/dvb/dmx.h +++ b/include/linux/dvb/dmx.h | |||
@@ -88,20 +88,6 @@ typedef enum | |||
88 | #define DMX_PES_PCR DMX_PES_PCR0 | 88 | #define DMX_PES_PCR DMX_PES_PCR0 |
89 | 89 | ||
90 | 90 | ||
91 | typedef enum | ||
92 | { | ||
93 | DMX_SCRAMBLING_EV, | ||
94 | DMX_FRONTEND_EV | ||
95 | } dmx_event_t; | ||
96 | |||
97 | |||
98 | typedef enum | ||
99 | { | ||
100 | DMX_SCRAMBLING_OFF, | ||
101 | DMX_SCRAMBLING_ON | ||
102 | } dmx_scrambling_status_t; | ||
103 | |||
104 | |||
105 | typedef struct dmx_filter | 91 | typedef struct dmx_filter |
106 | { | 92 | { |
107 | __u8 filter[DMX_FILTER_SIZE]; | 93 | __u8 filter[DMX_FILTER_SIZE]; |
@@ -132,17 +118,6 @@ struct dmx_pes_filter_params | |||
132 | __u32 flags; | 118 | __u32 flags; |
133 | }; | 119 | }; |
134 | 120 | ||
135 | |||
136 | struct dmx_event | ||
137 | { | ||
138 | dmx_event_t event; | ||
139 | time_t timeStamp; | ||
140 | union | ||
141 | { | ||
142 | dmx_scrambling_status_t scrambling; | ||
143 | } u; | ||
144 | }; | ||
145 | |||
146 | typedef struct dmx_caps { | 121 | typedef struct dmx_caps { |
147 | __u32 caps; | 122 | __u32 caps; |
148 | int num_decoders; | 123 | int num_decoders; |
@@ -171,7 +146,6 @@ struct dmx_stc { | |||
171 | #define DMX_SET_FILTER _IOW('o', 43, struct dmx_sct_filter_params) | 146 | #define DMX_SET_FILTER _IOW('o', 43, struct dmx_sct_filter_params) |
172 | #define DMX_SET_PES_FILTER _IOW('o', 44, struct dmx_pes_filter_params) | 147 | #define DMX_SET_PES_FILTER _IOW('o', 44, struct dmx_pes_filter_params) |
173 | #define DMX_SET_BUFFER_SIZE _IO('o', 45) | 148 | #define DMX_SET_BUFFER_SIZE _IO('o', 45) |
174 | #define DMX_GET_EVENT _IOR('o', 46, struct dmx_event) | ||
175 | #define DMX_GET_PES_PIDS _IOR('o', 47, __u16[5]) | 149 | #define DMX_GET_PES_PIDS _IOR('o', 47, __u16[5]) |
176 | #define DMX_GET_CAPS _IOR('o', 48, dmx_caps_t) | 150 | #define DMX_GET_CAPS _IOR('o', 48, dmx_caps_t) |
177 | #define DMX_SET_SOURCE _IOW('o', 49, dmx_source_t) | 151 | #define DMX_SET_SOURCE _IOW('o', 49, dmx_source_t) |
diff --git a/include/linux/efi.h b/include/linux/efi.h index e203613d3aec..66d621dbcb6c 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
@@ -294,6 +294,7 @@ extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, if pos | |||
294 | extern u64 efi_get_iobase (void); | 294 | extern u64 efi_get_iobase (void); |
295 | extern u32 efi_mem_type (unsigned long phys_addr); | 295 | extern u32 efi_mem_type (unsigned long phys_addr); |
296 | extern u64 efi_mem_attributes (unsigned long phys_addr); | 296 | extern u64 efi_mem_attributes (unsigned long phys_addr); |
297 | extern u64 efi_mem_attribute (unsigned long phys_addr, unsigned long size); | ||
297 | extern int efi_mem_attribute_range (unsigned long phys_addr, unsigned long size, | 298 | extern int efi_mem_attribute_range (unsigned long phys_addr, unsigned long size, |
298 | u64 attr); | 299 | u64 attr); |
299 | extern int __init efi_uart_console_only (void); | 300 | extern int __init efi_uart_console_only (void); |
diff --git a/include/linux/efs_fs.h b/include/linux/efs_fs.h index fbfa6b52e2fb..278ef4495819 100644 --- a/include/linux/efs_fs.h +++ b/include/linux/efs_fs.h | |||
@@ -38,7 +38,7 @@ struct statfs; | |||
38 | 38 | ||
39 | extern struct inode_operations efs_dir_inode_operations; | 39 | extern struct inode_operations efs_dir_inode_operations; |
40 | extern const struct file_operations efs_dir_operations; | 40 | extern const struct file_operations efs_dir_operations; |
41 | extern struct address_space_operations efs_symlink_aops; | 41 | extern const struct address_space_operations efs_symlink_aops; |
42 | 42 | ||
43 | extern void efs_read_inode(struct inode *); | 43 | extern void efs_read_inode(struct inode *); |
44 | extern efs_block_t efs_map_block(struct inode *, efs_block_t); | 44 | extern efs_block_t efs_map_block(struct inode *, efs_block_t); |
diff --git a/include/linux/elf-em.h b/include/linux/elf-em.h new file mode 100644 index 000000000000..6a5796c81c90 --- /dev/null +++ b/include/linux/elf-em.h | |||
@@ -0,0 +1,49 @@ | |||
1 | #ifndef _LINUX_ELF_EM_H | ||
2 | #define _LINUX_ELF_EM_H | ||
3 | |||
4 | /* These constants define the various ELF target machines */ | ||
5 | #define EM_NONE 0 | ||
6 | #define EM_M32 1 | ||
7 | #define EM_SPARC 2 | ||
8 | #define EM_386 3 | ||
9 | #define EM_68K 4 | ||
10 | #define EM_88K 5 | ||
11 | #define EM_486 6 /* Perhaps disused */ | ||
12 | #define EM_860 7 | ||
13 | #define EM_MIPS 8 /* MIPS R3000 (officially, big-endian only) */ | ||
14 | /* Next two are historical and binaries and | ||
15 | modules of these types will be rejected by | ||
16 | Linux. */ | ||
17 | #define EM_MIPS_RS3_LE 10 /* MIPS R3000 little-endian */ | ||
18 | #define EM_MIPS_RS4_BE 10 /* MIPS R4000 big-endian */ | ||
19 | |||
20 | #define EM_PARISC 15 /* HPPA */ | ||
21 | #define EM_SPARC32PLUS 18 /* Sun's "v8plus" */ | ||
22 | #define EM_PPC 20 /* PowerPC */ | ||
23 | #define EM_PPC64 21 /* PowerPC64 */ | ||
24 | #define EM_SH 42 /* SuperH */ | ||
25 | #define EM_SPARCV9 43 /* SPARC v9 64-bit */ | ||
26 | #define EM_IA_64 50 /* HP/Intel IA-64 */ | ||
27 | #define EM_X86_64 62 /* AMD x86-64 */ | ||
28 | #define EM_S390 22 /* IBM S/390 */ | ||
29 | #define EM_CRIS 76 /* Axis Communications 32-bit embedded processor */ | ||
30 | #define EM_V850 87 /* NEC v850 */ | ||
31 | #define EM_M32R 88 /* Renesas M32R */ | ||
32 | #define EM_H8_300 46 /* Renesas H8/300,300H,H8S */ | ||
33 | #define EM_FRV 0x5441 /* Fujitsu FR-V */ | ||
34 | |||
35 | /* | ||
36 | * This is an interim value that we will use until the committee comes | ||
37 | * up with a final number. | ||
38 | */ | ||
39 | #define EM_ALPHA 0x9026 | ||
40 | |||
41 | /* Bogus old v850 magic number, used by old tools. */ | ||
42 | #define EM_CYGNUS_V850 0x9080 | ||
43 | /* Bogus old m32r magic number, used by old tools. */ | ||
44 | #define EM_CYGNUS_M32R 0x9041 | ||
45 | /* This is the old interim value for S/390 architecture */ | ||
46 | #define EM_S390_OLD 0xA390 | ||
47 | |||
48 | |||
49 | #endif /* _LINUX_ELF_EM_H */ | ||
diff --git a/include/linux/elf.h b/include/linux/elf.h index d3bfacb24496..b70d1d2c8d28 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/auxvec.h> | 5 | #include <linux/auxvec.h> |
6 | #include <linux/elf-em.h> | ||
6 | #include <asm/elf.h> | 7 | #include <asm/elf.h> |
7 | 8 | ||
8 | #ifndef elf_read_implies_exec | 9 | #ifndef elf_read_implies_exec |
@@ -55,64 +56,6 @@ typedef __s64 Elf64_Sxword; | |||
55 | #define ET_LOPROC 0xff00 | 56 | #define ET_LOPROC 0xff00 |
56 | #define ET_HIPROC 0xffff | 57 | #define ET_HIPROC 0xffff |
57 | 58 | ||
58 | /* These constants define the various ELF target machines */ | ||
59 | #define EM_NONE 0 | ||
60 | #define EM_M32 1 | ||
61 | #define EM_SPARC 2 | ||
62 | #define EM_386 3 | ||
63 | #define EM_68K 4 | ||
64 | #define EM_88K 5 | ||
65 | #define EM_486 6 /* Perhaps disused */ | ||
66 | #define EM_860 7 | ||
67 | |||
68 | #define EM_MIPS 8 /* MIPS R3000 (officially, big-endian only) */ | ||
69 | |||
70 | #define EM_MIPS_RS4_BE 10 /* MIPS R4000 big-endian */ | ||
71 | |||
72 | #define EM_PARISC 15 /* HPPA */ | ||
73 | |||
74 | #define EM_SPARC32PLUS 18 /* Sun's "v8plus" */ | ||
75 | |||
76 | #define EM_PPC 20 /* PowerPC */ | ||
77 | #define EM_PPC64 21 /* PowerPC64 */ | ||
78 | |||
79 | #define EM_SH 42 /* SuperH */ | ||
80 | |||
81 | #define EM_SPARCV9 43 /* SPARC v9 64-bit */ | ||
82 | |||
83 | #define EM_IA_64 50 /* HP/Intel IA-64 */ | ||
84 | |||
85 | #define EM_X86_64 62 /* AMD x86-64 */ | ||
86 | |||
87 | #define EM_S390 22 /* IBM S/390 */ | ||
88 | |||
89 | #define EM_CRIS 76 /* Axis Communications 32-bit embedded processor */ | ||
90 | |||
91 | #define EM_V850 87 /* NEC v850 */ | ||
92 | |||
93 | #define EM_M32R 88 /* Renesas M32R */ | ||
94 | |||
95 | #define EM_H8_300 46 /* Renesas H8/300,300H,H8S */ | ||
96 | |||
97 | /* | ||
98 | * This is an interim value that we will use until the committee comes | ||
99 | * up with a final number. | ||
100 | */ | ||
101 | #define EM_ALPHA 0x9026 | ||
102 | |||
103 | /* Bogus old v850 magic number, used by old tools. */ | ||
104 | #define EM_CYGNUS_V850 0x9080 | ||
105 | |||
106 | /* Bogus old m32r magic number, used by old tools. */ | ||
107 | #define EM_CYGNUS_M32R 0x9041 | ||
108 | |||
109 | /* | ||
110 | * This is the old interim value for S/390 architecture | ||
111 | */ | ||
112 | #define EM_S390_OLD 0xA390 | ||
113 | |||
114 | #define EM_FRV 0x5441 /* Fujitsu FR-V */ | ||
115 | |||
116 | /* This is the info that is needed to parse the dynamic section of the file */ | 59 | /* This is the info that is needed to parse the dynamic section of the file */ |
117 | #define DT_NULL 0 | 60 | #define DT_NULL 0 |
118 | #define DT_NEEDED 1 | 61 | #define DT_NEEDED 1 |
diff --git a/include/linux/err.h b/include/linux/err.h index ff71d2af5da3..cd3b367f7445 100644 --- a/include/linux/err.h +++ b/include/linux/err.h | |||
@@ -13,7 +13,9 @@ | |||
13 | * This should be a per-architecture thing, to allow different | 13 | * This should be a per-architecture thing, to allow different |
14 | * error and pointer decisions. | 14 | * error and pointer decisions. |
15 | */ | 15 | */ |
16 | #define IS_ERR_VALUE(x) unlikely((x) > (unsigned long)-1000L) | 16 | #define MAX_ERRNO 4095 |
17 | |||
18 | #define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO) | ||
17 | 19 | ||
18 | static inline void *ERR_PTR(long error) | 20 | static inline void *ERR_PTR(long error) |
19 | { | 21 | { |
diff --git a/include/linux/errqueue.h b/include/linux/errqueue.h index 174582fedb8b..408118a07763 100644 --- a/include/linux/errqueue.h +++ b/include/linux/errqueue.h | |||
@@ -21,7 +21,6 @@ struct sock_extended_err | |||
21 | 21 | ||
22 | #ifdef __KERNEL__ | 22 | #ifdef __KERNEL__ |
23 | 23 | ||
24 | #include <linux/config.h> | ||
25 | #include <net/ip.h> | 24 | #include <net/ip.h> |
26 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | 25 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) |
27 | #include <linux/ipv6.h> | 26 | #include <linux/ipv6.h> |
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index 93535f093216..c6310aef5ab0 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -15,24 +15,24 @@ | |||
15 | 15 | ||
16 | /* This should work for both 32 and 64 bit userland. */ | 16 | /* This should work for both 32 and 64 bit userland. */ |
17 | struct ethtool_cmd { | 17 | struct ethtool_cmd { |
18 | u32 cmd; | 18 | __u32 cmd; |
19 | u32 supported; /* Features this interface supports */ | 19 | __u32 supported; /* Features this interface supports */ |
20 | u32 advertising; /* Features this interface advertises */ | 20 | __u32 advertising; /* Features this interface advertises */ |
21 | u16 speed; /* The forced speed, 10Mb, 100Mb, gigabit */ | 21 | __u16 speed; /* The forced speed, 10Mb, 100Mb, gigabit */ |
22 | u8 duplex; /* Duplex, half or full */ | 22 | __u8 duplex; /* Duplex, half or full */ |
23 | u8 port; /* Which connector port */ | 23 | __u8 port; /* Which connector port */ |
24 | u8 phy_address; | 24 | __u8 phy_address; |
25 | u8 transceiver; /* Which transceiver to use */ | 25 | __u8 transceiver; /* Which transceiver to use */ |
26 | u8 autoneg; /* Enable or disable autonegotiation */ | 26 | __u8 autoneg; /* Enable or disable autonegotiation */ |
27 | u32 maxtxpkt; /* Tx pkts before generating tx int */ | 27 | __u32 maxtxpkt; /* Tx pkts before generating tx int */ |
28 | u32 maxrxpkt; /* Rx pkts before generating rx int */ | 28 | __u32 maxrxpkt; /* Rx pkts before generating rx int */ |
29 | u32 reserved[4]; | 29 | __u32 reserved[4]; |
30 | }; | 30 | }; |
31 | 31 | ||
32 | #define ETHTOOL_BUSINFO_LEN 32 | 32 | #define ETHTOOL_BUSINFO_LEN 32 |
33 | /* these strings are set to whatever the driver author decides... */ | 33 | /* these strings are set to whatever the driver author decides... */ |
34 | struct ethtool_drvinfo { | 34 | struct ethtool_drvinfo { |
35 | u32 cmd; | 35 | __u32 cmd; |
36 | char driver[32]; /* driver short name, "tulip", "eepro100" */ | 36 | char driver[32]; /* driver short name, "tulip", "eepro100" */ |
37 | char version[32]; /* driver version string */ | 37 | char version[32]; /* driver version string */ |
38 | char fw_version[32]; /* firmware version string, if applicable */ | 38 | char fw_version[32]; /* firmware version string, if applicable */ |
@@ -40,53 +40,53 @@ struct ethtool_drvinfo { | |||
40 | /* For PCI devices, use pci_name(pci_dev). */ | 40 | /* For PCI devices, use pci_name(pci_dev). */ |
41 | char reserved1[32]; | 41 | char reserved1[32]; |
42 | char reserved2[16]; | 42 | char reserved2[16]; |
43 | u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */ | 43 | __u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */ |
44 | u32 testinfo_len; | 44 | __u32 testinfo_len; |
45 | u32 eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */ | 45 | __u32 eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */ |
46 | u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */ | 46 | __u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */ |
47 | }; | 47 | }; |
48 | 48 | ||
49 | #define SOPASS_MAX 6 | 49 | #define SOPASS_MAX 6 |
50 | /* wake-on-lan settings */ | 50 | /* wake-on-lan settings */ |
51 | struct ethtool_wolinfo { | 51 | struct ethtool_wolinfo { |
52 | u32 cmd; | 52 | __u32 cmd; |
53 | u32 supported; | 53 | __u32 supported; |
54 | u32 wolopts; | 54 | __u32 wolopts; |
55 | u8 sopass[SOPASS_MAX]; /* SecureOn(tm) password */ | 55 | __u8 sopass[SOPASS_MAX]; /* SecureOn(tm) password */ |
56 | }; | 56 | }; |
57 | 57 | ||
58 | /* for passing single values */ | 58 | /* for passing single values */ |
59 | struct ethtool_value { | 59 | struct ethtool_value { |
60 | u32 cmd; | 60 | __u32 cmd; |
61 | u32 data; | 61 | __u32 data; |
62 | }; | 62 | }; |
63 | 63 | ||
64 | /* for passing big chunks of data */ | 64 | /* for passing big chunks of data */ |
65 | struct ethtool_regs { | 65 | struct ethtool_regs { |
66 | u32 cmd; | 66 | __u32 cmd; |
67 | u32 version; /* driver-specific, indicates different chips/revs */ | 67 | __u32 version; /* driver-specific, indicates different chips/revs */ |
68 | u32 len; /* bytes */ | 68 | __u32 len; /* bytes */ |
69 | u8 data[0]; | 69 | __u8 data[0]; |
70 | }; | 70 | }; |
71 | 71 | ||
72 | /* for passing EEPROM chunks */ | 72 | /* for passing EEPROM chunks */ |
73 | struct ethtool_eeprom { | 73 | struct ethtool_eeprom { |
74 | u32 cmd; | 74 | __u32 cmd; |
75 | u32 magic; | 75 | __u32 magic; |
76 | u32 offset; /* in bytes */ | 76 | __u32 offset; /* in bytes */ |
77 | u32 len; /* in bytes */ | 77 | __u32 len; /* in bytes */ |
78 | u8 data[0]; | 78 | __u8 data[0]; |
79 | }; | 79 | }; |
80 | 80 | ||
81 | /* for configuring coalescing parameters of chip */ | 81 | /* for configuring coalescing parameters of chip */ |
82 | struct ethtool_coalesce { | 82 | struct ethtool_coalesce { |
83 | u32 cmd; /* ETHTOOL_{G,S}COALESCE */ | 83 | __u32 cmd; /* ETHTOOL_{G,S}COALESCE */ |
84 | 84 | ||
85 | /* How many usecs to delay an RX interrupt after | 85 | /* How many usecs to delay an RX interrupt after |
86 | * a packet arrives. If 0, only rx_max_coalesced_frames | 86 | * a packet arrives. If 0, only rx_max_coalesced_frames |
87 | * is used. | 87 | * is used. |
88 | */ | 88 | */ |
89 | u32 rx_coalesce_usecs; | 89 | __u32 rx_coalesce_usecs; |
90 | 90 | ||
91 | /* How many packets to delay an RX interrupt after | 91 | /* How many packets to delay an RX interrupt after |
92 | * a packet arrives. If 0, only rx_coalesce_usecs is | 92 | * a packet arrives. If 0, only rx_coalesce_usecs is |
@@ -94,21 +94,21 @@ struct ethtool_coalesce { | |||
94 | * to zero as this would cause RX interrupts to never be | 94 | * to zero as this would cause RX interrupts to never be |
95 | * generated. | 95 | * generated. |
96 | */ | 96 | */ |
97 | u32 rx_max_coalesced_frames; | 97 | __u32 rx_max_coalesced_frames; |
98 | 98 | ||
99 | /* Same as above two parameters, except that these values | 99 | /* Same as above two parameters, except that these values |
100 | * apply while an IRQ is being serviced by the host. Not | 100 | * apply while an IRQ is being serviced by the host. Not |
101 | * all cards support this feature and the values are ignored | 101 | * all cards support this feature and the values are ignored |
102 | * in that case. | 102 | * in that case. |
103 | */ | 103 | */ |
104 | u32 rx_coalesce_usecs_irq; | 104 | __u32 rx_coalesce_usecs_irq; |
105 | u32 rx_max_coalesced_frames_irq; | 105 | __u32 rx_max_coalesced_frames_irq; |
106 | 106 | ||
107 | /* How many usecs to delay a TX interrupt after | 107 | /* How many usecs to delay a TX interrupt after |
108 | * a packet is sent. If 0, only tx_max_coalesced_frames | 108 | * a packet is sent. If 0, only tx_max_coalesced_frames |
109 | * is used. | 109 | * is used. |
110 | */ | 110 | */ |
111 | u32 tx_coalesce_usecs; | 111 | __u32 tx_coalesce_usecs; |
112 | 112 | ||
113 | /* How many packets to delay a TX interrupt after | 113 | /* How many packets to delay a TX interrupt after |
114 | * a packet is sent. If 0, only tx_coalesce_usecs is | 114 | * a packet is sent. If 0, only tx_coalesce_usecs is |
@@ -116,22 +116,22 @@ struct ethtool_coalesce { | |||
116 | * to zero as this would cause TX interrupts to never be | 116 | * to zero as this would cause TX interrupts to never be |
117 | * generated. | 117 | * generated. |
118 | */ | 118 | */ |
119 | u32 tx_max_coalesced_frames; | 119 | __u32 tx_max_coalesced_frames; |
120 | 120 | ||
121 | /* Same as above two parameters, except that these values | 121 | /* Same as above two parameters, except that these values |
122 | * apply while an IRQ is being serviced by the host. Not | 122 | * apply while an IRQ is being serviced by the host. Not |
123 | * all cards support this feature and the values are ignored | 123 | * all cards support this feature and the values are ignored |
124 | * in that case. | 124 | * in that case. |
125 | */ | 125 | */ |
126 | u32 tx_coalesce_usecs_irq; | 126 | __u32 tx_coalesce_usecs_irq; |
127 | u32 tx_max_coalesced_frames_irq; | 127 | __u32 tx_max_coalesced_frames_irq; |
128 | 128 | ||
129 | /* How many usecs to delay in-memory statistics | 129 | /* How many usecs to delay in-memory statistics |
130 | * block updates. Some drivers do not have an in-memory | 130 | * block updates. Some drivers do not have an in-memory |
131 | * statistic block, and in such cases this value is ignored. | 131 | * statistic block, and in such cases this value is ignored. |
132 | * This value must not be zero. | 132 | * This value must not be zero. |
133 | */ | 133 | */ |
134 | u32 stats_block_coalesce_usecs; | 134 | __u32 stats_block_coalesce_usecs; |
135 | 135 | ||
136 | /* Adaptive RX/TX coalescing is an algorithm implemented by | 136 | /* Adaptive RX/TX coalescing is an algorithm implemented by |
137 | * some drivers to improve latency under low packet rates and | 137 | * some drivers to improve latency under low packet rates and |
@@ -140,18 +140,18 @@ struct ethtool_coalesce { | |||
140 | * not implemented by the driver causes these values to be | 140 | * not implemented by the driver causes these values to be |
141 | * silently ignored. | 141 | * silently ignored. |
142 | */ | 142 | */ |
143 | u32 use_adaptive_rx_coalesce; | 143 | __u32 use_adaptive_rx_coalesce; |
144 | u32 use_adaptive_tx_coalesce; | 144 | __u32 use_adaptive_tx_coalesce; |
145 | 145 | ||
146 | /* When the packet rate (measured in packets per second) | 146 | /* When the packet rate (measured in packets per second) |
147 | * is below pkt_rate_low, the {rx,tx}_*_low parameters are | 147 | * is below pkt_rate_low, the {rx,tx}_*_low parameters are |
148 | * used. | 148 | * used. |
149 | */ | 149 | */ |
150 | u32 pkt_rate_low; | 150 | __u32 pkt_rate_low; |
151 | u32 rx_coalesce_usecs_low; | 151 | __u32 rx_coalesce_usecs_low; |
152 | u32 rx_max_coalesced_frames_low; | 152 | __u32 rx_max_coalesced_frames_low; |
153 | u32 tx_coalesce_usecs_low; | 153 | __u32 tx_coalesce_usecs_low; |
154 | u32 tx_max_coalesced_frames_low; | 154 | __u32 tx_max_coalesced_frames_low; |
155 | 155 | ||
156 | /* When the packet rate is below pkt_rate_high but above | 156 | /* When the packet rate is below pkt_rate_high but above |
157 | * pkt_rate_low (both measured in packets per second) the | 157 | * pkt_rate_low (both measured in packets per second) the |
@@ -162,43 +162,43 @@ struct ethtool_coalesce { | |||
162 | * is above pkt_rate_high, the {rx,tx}_*_high parameters are | 162 | * is above pkt_rate_high, the {rx,tx}_*_high parameters are |
163 | * used. | 163 | * used. |
164 | */ | 164 | */ |
165 | u32 pkt_rate_high; | 165 | __u32 pkt_rate_high; |
166 | u32 rx_coalesce_usecs_high; | 166 | __u32 rx_coalesce_usecs_high; |
167 | u32 rx_max_coalesced_frames_high; | 167 | __u32 rx_max_coalesced_frames_high; |
168 | u32 tx_coalesce_usecs_high; | 168 | __u32 tx_coalesce_usecs_high; |
169 | u32 tx_max_coalesced_frames_high; | 169 | __u32 tx_max_coalesced_frames_high; |
170 | 170 | ||
171 | /* How often to do adaptive coalescing packet rate sampling, | 171 | /* How often to do adaptive coalescing packet rate sampling, |
172 | * measured in seconds. Must not be zero. | 172 | * measured in seconds. Must not be zero. |
173 | */ | 173 | */ |
174 | u32 rate_sample_interval; | 174 | __u32 rate_sample_interval; |
175 | }; | 175 | }; |
176 | 176 | ||
177 | /* for configuring RX/TX ring parameters */ | 177 | /* for configuring RX/TX ring parameters */ |
178 | struct ethtool_ringparam { | 178 | struct ethtool_ringparam { |
179 | u32 cmd; /* ETHTOOL_{G,S}RINGPARAM */ | 179 | __u32 cmd; /* ETHTOOL_{G,S}RINGPARAM */ |
180 | 180 | ||
181 | /* Read only attributes. These indicate the maximum number | 181 | /* Read only attributes. These indicate the maximum number |
182 | * of pending RX/TX ring entries the driver will allow the | 182 | * of pending RX/TX ring entries the driver will allow the |
183 | * user to set. | 183 | * user to set. |
184 | */ | 184 | */ |
185 | u32 rx_max_pending; | 185 | __u32 rx_max_pending; |
186 | u32 rx_mini_max_pending; | 186 | __u32 rx_mini_max_pending; |
187 | u32 rx_jumbo_max_pending; | 187 | __u32 rx_jumbo_max_pending; |
188 | u32 tx_max_pending; | 188 | __u32 tx_max_pending; |
189 | 189 | ||
190 | /* Values changeable by the user. The valid values are | 190 | /* Values changeable by the user. The valid values are |
191 | * in the range 1 to the "*_max_pending" counterpart above. | 191 | * in the range 1 to the "*_max_pending" counterpart above. |
192 | */ | 192 | */ |
193 | u32 rx_pending; | 193 | __u32 rx_pending; |
194 | u32 rx_mini_pending; | 194 | __u32 rx_mini_pending; |
195 | u32 rx_jumbo_pending; | 195 | __u32 rx_jumbo_pending; |
196 | u32 tx_pending; | 196 | __u32 tx_pending; |
197 | }; | 197 | }; |
198 | 198 | ||
199 | /* for configuring link flow control parameters */ | 199 | /* for configuring link flow control parameters */ |
200 | struct ethtool_pauseparam { | 200 | struct ethtool_pauseparam { |
201 | u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */ | 201 | __u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */ |
202 | 202 | ||
203 | /* If the link is being auto-negotiated (via ethtool_cmd.autoneg | 203 | /* If the link is being auto-negotiated (via ethtool_cmd.autoneg |
204 | * being true) the user may set 'autonet' here non-zero to have the | 204 | * being true) the user may set 'autonet' here non-zero to have the |
@@ -210,9 +210,9 @@ struct ethtool_pauseparam { | |||
210 | * then {rx,tx}_pause force the driver to use/not-use pause | 210 | * then {rx,tx}_pause force the driver to use/not-use pause |
211 | * flow control. | 211 | * flow control. |
212 | */ | 212 | */ |
213 | u32 autoneg; | 213 | __u32 autoneg; |
214 | u32 rx_pause; | 214 | __u32 rx_pause; |
215 | u32 tx_pause; | 215 | __u32 tx_pause; |
216 | }; | 216 | }; |
217 | 217 | ||
218 | #define ETH_GSTRING_LEN 32 | 218 | #define ETH_GSTRING_LEN 32 |
@@ -223,10 +223,10 @@ enum ethtool_stringset { | |||
223 | 223 | ||
224 | /* for passing string sets for data tagging */ | 224 | /* for passing string sets for data tagging */ |
225 | struct ethtool_gstrings { | 225 | struct ethtool_gstrings { |
226 | u32 cmd; /* ETHTOOL_GSTRINGS */ | 226 | __u32 cmd; /* ETHTOOL_GSTRINGS */ |
227 | u32 string_set; /* string set id e.c. ETH_SS_TEST, etc*/ | 227 | __u32 string_set; /* string set id e.c. ETH_SS_TEST, etc*/ |
228 | u32 len; /* number of strings in the string set */ | 228 | __u32 len; /* number of strings in the string set */ |
229 | u8 data[0]; | 229 | __u8 data[0]; |
230 | }; | 230 | }; |
231 | 231 | ||
232 | enum ethtool_test_flags { | 232 | enum ethtool_test_flags { |
@@ -236,26 +236,28 @@ enum ethtool_test_flags { | |||
236 | 236 | ||
237 | /* for requesting NIC test and getting results*/ | 237 | /* for requesting NIC test and getting results*/ |
238 | struct ethtool_test { | 238 | struct ethtool_test { |
239 | u32 cmd; /* ETHTOOL_TEST */ | 239 | __u32 cmd; /* ETHTOOL_TEST */ |
240 | u32 flags; /* ETH_TEST_FL_xxx */ | 240 | __u32 flags; /* ETH_TEST_FL_xxx */ |
241 | u32 reserved; | 241 | __u32 reserved; |
242 | u32 len; /* result length, in number of u64 elements */ | 242 | __u32 len; /* result length, in number of u64 elements */ |
243 | u64 data[0]; | 243 | __u64 data[0]; |
244 | }; | 244 | }; |
245 | 245 | ||
246 | /* for dumping NIC-specific statistics */ | 246 | /* for dumping NIC-specific statistics */ |
247 | struct ethtool_stats { | 247 | struct ethtool_stats { |
248 | u32 cmd; /* ETHTOOL_GSTATS */ | 248 | __u32 cmd; /* ETHTOOL_GSTATS */ |
249 | u32 n_stats; /* number of u64's being returned */ | 249 | __u32 n_stats; /* number of u64's being returned */ |
250 | u64 data[0]; | 250 | __u64 data[0]; |
251 | }; | 251 | }; |
252 | 252 | ||
253 | struct ethtool_perm_addr { | 253 | struct ethtool_perm_addr { |
254 | u32 cmd; /* ETHTOOL_GPERMADDR */ | 254 | __u32 cmd; /* ETHTOOL_GPERMADDR */ |
255 | u32 size; | 255 | __u32 size; |
256 | u8 data[0]; | 256 | __u8 data[0]; |
257 | }; | 257 | }; |
258 | 258 | ||
259 | #ifdef __KERNEL__ | ||
260 | |||
259 | struct net_device; | 261 | struct net_device; |
260 | 262 | ||
261 | /* Some generic methods drivers may use in their ethtool_ops */ | 263 | /* Some generic methods drivers may use in their ethtool_ops */ |
@@ -371,6 +373,7 @@ struct ethtool_ops { | |||
371 | u32 (*get_ufo)(struct net_device *); | 373 | u32 (*get_ufo)(struct net_device *); |
372 | int (*set_ufo)(struct net_device *, u32); | 374 | int (*set_ufo)(struct net_device *, u32); |
373 | }; | 375 | }; |
376 | #endif /* __KERNEL__ */ | ||
374 | 377 | ||
375 | /* CMDs currently supported */ | 378 | /* CMDs currently supported */ |
376 | #define ETHTOOL_GSET 0x00000001 /* Get settings. */ | 379 | #define ETHTOOL_GSET 0x00000001 /* Get settings. */ |
@@ -408,6 +411,8 @@ struct ethtool_ops { | |||
408 | #define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */ | 411 | #define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */ |
409 | #define ETHTOOL_GUFO 0x00000021 /* Get UFO enable (ethtool_value) */ | 412 | #define ETHTOOL_GUFO 0x00000021 /* Get UFO enable (ethtool_value) */ |
410 | #define ETHTOOL_SUFO 0x00000022 /* Set UFO enable (ethtool_value) */ | 413 | #define ETHTOOL_SUFO 0x00000022 /* Set UFO enable (ethtool_value) */ |
414 | #define ETHTOOL_GGSO 0x00000023 /* Get GSO enable (ethtool_value) */ | ||
415 | #define ETHTOOL_SGSO 0x00000024 /* Set GSO enable (ethtool_value) */ | ||
411 | 416 | ||
412 | /* compatibility with older code */ | 417 | /* compatibility with older code */ |
413 | #define SPARC_ETH_GSET ETHTOOL_GSET | 418 | #define SPARC_ETH_GSET ETHTOOL_GSET |
diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h index 1e4bdfcf83a2..84cfa8bbdc36 100644 --- a/include/linux/eventpoll.h +++ b/include/linux/eventpoll.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * include/linux/eventpoll.h ( Efficent event polling implementation ) | 2 | * include/linux/eventpoll.h ( Efficent event polling implementation ) |
3 | * Copyright (C) 2001,...,2003 Davide Libenzi | 3 | * Copyright (C) 2001,...,2006 Davide Libenzi |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h index f7bd1c7ebefb..facf34e98954 100644 --- a/include/linux/ext2_fs.h +++ b/include/linux/ext2_fs.h | |||
@@ -17,7 +17,6 @@ | |||
17 | #define _LINUX_EXT2_FS_H | 17 | #define _LINUX_EXT2_FS_H |
18 | 18 | ||
19 | #include <linux/types.h> | 19 | #include <linux/types.h> |
20 | #include <linux/ext2_fs_sb.h> | ||
21 | 20 | ||
22 | /* | 21 | /* |
23 | * The second extended filesystem constants/structures | 22 | * The second extended filesystem constants/structures |
@@ -70,6 +69,7 @@ | |||
70 | #define EXT2_SUPER_MAGIC 0xEF53 | 69 | #define EXT2_SUPER_MAGIC 0xEF53 |
71 | 70 | ||
72 | #ifdef __KERNEL__ | 71 | #ifdef __KERNEL__ |
72 | #include <linux/ext2_fs_sb.h> | ||
73 | static inline struct ext2_sb_info *EXT2_SB(struct super_block *sb) | 73 | static inline struct ext2_sb_info *EXT2_SB(struct super_block *sb) |
74 | { | 74 | { |
75 | return sb->s_fs_info; | 75 | return sb->s_fs_info; |
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 3ade6a4e3bdd..5607e6457a65 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
@@ -17,11 +17,6 @@ | |||
17 | #define _LINUX_EXT3_FS_H | 17 | #define _LINUX_EXT3_FS_H |
18 | 18 | ||
19 | #include <linux/types.h> | 19 | #include <linux/types.h> |
20 | #include <linux/ext3_fs_i.h> | ||
21 | #include <linux/ext3_fs_sb.h> | ||
22 | |||
23 | |||
24 | struct statfs; | ||
25 | 20 | ||
26 | /* | 21 | /* |
27 | * The second extended filesystem constants/structures | 22 | * The second extended filesystem constants/structures |
@@ -487,6 +482,8 @@ struct ext3_super_block { | |||
487 | }; | 482 | }; |
488 | 483 | ||
489 | #ifdef __KERNEL__ | 484 | #ifdef __KERNEL__ |
485 | #include <linux/ext3_fs_i.h> | ||
486 | #include <linux/ext3_fs_sb.h> | ||
490 | static inline struct ext3_sb_info * EXT3_SB(struct super_block *sb) | 487 | static inline struct ext3_sb_info * EXT3_SB(struct super_block *sb) |
491 | { | 488 | { |
492 | return sb->s_fs_info; | 489 | return sb->s_fs_info; |
@@ -664,6 +661,8 @@ struct ext3_dir_entry_2 { | |||
664 | #define DX_HASH_HALF_MD4 1 | 661 | #define DX_HASH_HALF_MD4 1 |
665 | #define DX_HASH_TEA 2 | 662 | #define DX_HASH_TEA 2 |
666 | 663 | ||
664 | #ifdef __KERNEL__ | ||
665 | |||
667 | /* hash info structure used by the directory hash */ | 666 | /* hash info structure used by the directory hash */ |
668 | struct dx_hash_info | 667 | struct dx_hash_info |
669 | { | 668 | { |
@@ -675,7 +674,6 @@ struct dx_hash_info | |||
675 | 674 | ||
676 | #define EXT3_HTREE_EOF 0x7fffffff | 675 | #define EXT3_HTREE_EOF 0x7fffffff |
677 | 676 | ||
678 | #ifdef __KERNEL__ | ||
679 | /* | 677 | /* |
680 | * Control parameters used by ext3_htree_next_block | 678 | * Control parameters used by ext3_htree_next_block |
681 | */ | 679 | */ |
@@ -712,6 +710,14 @@ struct dir_private_info { | |||
712 | __u32 next_hash; | 710 | __u32 next_hash; |
713 | }; | 711 | }; |
714 | 712 | ||
713 | /* calculate the first block number of the group */ | ||
714 | static inline ext3_fsblk_t | ||
715 | ext3_group_first_block_no(struct super_block *sb, unsigned long group_no) | ||
716 | { | ||
717 | return group_no * (ext3_fsblk_t)EXT3_BLOCKS_PER_GROUP(sb) + | ||
718 | le32_to_cpu(EXT3_SB(sb)->s_es->s_first_data_block); | ||
719 | } | ||
720 | |||
715 | /* | 721 | /* |
716 | * Special error return code only used by dx_probe() and its callers. | 722 | * Special error return code only used by dx_probe() and its callers. |
717 | */ | 723 | */ |
@@ -732,14 +738,16 @@ struct dir_private_info { | |||
732 | /* balloc.c */ | 738 | /* balloc.c */ |
733 | extern int ext3_bg_has_super(struct super_block *sb, int group); | 739 | extern int ext3_bg_has_super(struct super_block *sb, int group); |
734 | extern unsigned long ext3_bg_num_gdb(struct super_block *sb, int group); | 740 | extern unsigned long ext3_bg_num_gdb(struct super_block *sb, int group); |
735 | extern int ext3_new_block (handle_t *, struct inode *, unsigned long, int *); | 741 | extern ext3_fsblk_t ext3_new_block (handle_t *handle, struct inode *inode, |
736 | extern int ext3_new_blocks (handle_t *, struct inode *, unsigned long, | 742 | ext3_fsblk_t goal, int *errp); |
737 | unsigned long *, int *); | 743 | extern ext3_fsblk_t ext3_new_blocks (handle_t *handle, struct inode *inode, |
738 | extern void ext3_free_blocks (handle_t *, struct inode *, unsigned long, | 744 | ext3_fsblk_t goal, unsigned long *count, int *errp); |
739 | unsigned long); | 745 | extern void ext3_free_blocks (handle_t *handle, struct inode *inode, |
740 | extern void ext3_free_blocks_sb (handle_t *, struct super_block *, | 746 | ext3_fsblk_t block, unsigned long count); |
741 | unsigned long, unsigned long, int *); | 747 | extern void ext3_free_blocks_sb (handle_t *handle, struct super_block *sb, |
742 | extern unsigned long ext3_count_free_blocks (struct super_block *); | 748 | ext3_fsblk_t block, unsigned long count, |
749 | unsigned long *pdquot_freed_blocks); | ||
750 | extern ext3_fsblk_t ext3_count_free_blocks (struct super_block *); | ||
743 | extern void ext3_check_blocks_bitmap (struct super_block *); | 751 | extern void ext3_check_blocks_bitmap (struct super_block *); |
744 | extern struct ext3_group_desc * ext3_get_group_desc(struct super_block * sb, | 752 | extern struct ext3_group_desc * ext3_get_group_desc(struct super_block * sb, |
745 | unsigned int block_group, | 753 | unsigned int block_group, |
@@ -775,7 +783,8 @@ extern unsigned long ext3_count_free (struct buffer_head *, unsigned); | |||
775 | 783 | ||
776 | 784 | ||
777 | /* inode.c */ | 785 | /* inode.c */ |
778 | int ext3_forget(handle_t *, int, struct inode *, struct buffer_head *, int); | 786 | int ext3_forget(handle_t *handle, int is_metadata, struct inode *inode, |
787 | struct buffer_head *bh, ext3_fsblk_t blocknr); | ||
779 | struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *); | 788 | struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *); |
780 | struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *); | 789 | struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *); |
781 | int ext3_get_blocks_handle(handle_t *handle, struct inode *inode, | 790 | int ext3_get_blocks_handle(handle_t *handle, struct inode *inode, |
@@ -810,7 +819,7 @@ extern int ext3_group_add(struct super_block *sb, | |||
810 | struct ext3_new_group_data *input); | 819 | struct ext3_new_group_data *input); |
811 | extern int ext3_group_extend(struct super_block *sb, | 820 | extern int ext3_group_extend(struct super_block *sb, |
812 | struct ext3_super_block *es, | 821 | struct ext3_super_block *es, |
813 | unsigned long n_blocks_count); | 822 | ext3_fsblk_t n_blocks_count); |
814 | 823 | ||
815 | /* super.c */ | 824 | /* super.c */ |
816 | extern void ext3_error (struct super_block *, const char *, const char *, ...) | 825 | extern void ext3_error (struct super_block *, const char *, const char *, ...) |
diff --git a/include/linux/ext3_fs_i.h b/include/linux/ext3_fs_i.h index 7abf90147180..2f18b9511f21 100644 --- a/include/linux/ext3_fs_i.h +++ b/include/linux/ext3_fs_i.h | |||
@@ -21,9 +21,17 @@ | |||
21 | #include <linux/seqlock.h> | 21 | #include <linux/seqlock.h> |
22 | #include <linux/mutex.h> | 22 | #include <linux/mutex.h> |
23 | 23 | ||
24 | /* data type for block offset of block group */ | ||
25 | typedef int ext3_grpblk_t; | ||
26 | |||
27 | /* data type for filesystem-wide blocks number */ | ||
28 | typedef unsigned long ext3_fsblk_t; | ||
29 | |||
30 | #define E3FSBLK "%lu" | ||
31 | |||
24 | struct ext3_reserve_window { | 32 | struct ext3_reserve_window { |
25 | __u32 _rsv_start; /* First byte reserved */ | 33 | ext3_fsblk_t _rsv_start; /* First byte reserved */ |
26 | __u32 _rsv_end; /* Last byte reserved or 0 */ | 34 | ext3_fsblk_t _rsv_end; /* Last byte reserved or 0 */ |
27 | }; | 35 | }; |
28 | 36 | ||
29 | struct ext3_reserve_window_node { | 37 | struct ext3_reserve_window_node { |
@@ -50,7 +58,7 @@ struct ext3_block_alloc_info { | |||
50 | * allocated to this file. This give us the goal (target) for the next | 58 | * allocated to this file. This give us the goal (target) for the next |
51 | * allocation when we detect linearly ascending requests. | 59 | * allocation when we detect linearly ascending requests. |
52 | */ | 60 | */ |
53 | __u32 last_alloc_physical_block; | 61 | ext3_fsblk_t last_alloc_physical_block; |
54 | }; | 62 | }; |
55 | 63 | ||
56 | #define rsv_start rsv_window._rsv_start | 64 | #define rsv_start rsv_window._rsv_start |
@@ -67,7 +75,7 @@ struct ext3_inode_info { | |||
67 | __u8 i_frag_no; | 75 | __u8 i_frag_no; |
68 | __u8 i_frag_size; | 76 | __u8 i_frag_size; |
69 | #endif | 77 | #endif |
70 | __u32 i_file_acl; | 78 | ext3_fsblk_t i_file_acl; |
71 | __u32 i_dir_acl; | 79 | __u32 i_dir_acl; |
72 | __u32 i_dtime; | 80 | __u32 i_dtime; |
73 | 81 | ||
diff --git a/include/linux/fb.h b/include/linux/fb.h index 315d89740ddf..ffefeeeeca93 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef _LINUX_FB_H | 1 | #ifndef _LINUX_FB_H |
2 | #define _LINUX_FB_H | 2 | #define _LINUX_FB_H |
3 | 3 | ||
4 | #include <linux/backlight.h> | ||
4 | #include <asm/types.h> | 5 | #include <asm/types.h> |
5 | 6 | ||
6 | /* Definitions of frame buffers */ | 7 | /* Definitions of frame buffers */ |
@@ -366,6 +367,12 @@ struct fb_cursor { | |||
366 | struct fb_image image; /* Cursor image */ | 367 | struct fb_image image; /* Cursor image */ |
367 | }; | 368 | }; |
368 | 369 | ||
370 | #ifdef CONFIG_FB_BACKLIGHT | ||
371 | /* Settings for the generic backlight code */ | ||
372 | #define FB_BACKLIGHT_LEVELS 128 | ||
373 | #define FB_BACKLIGHT_MAX 0xFF | ||
374 | #endif | ||
375 | |||
369 | #ifdef __KERNEL__ | 376 | #ifdef __KERNEL__ |
370 | 377 | ||
371 | #include <linux/fs.h> | 378 | #include <linux/fs.h> |
@@ -373,7 +380,6 @@ struct fb_cursor { | |||
373 | #include <linux/tty.h> | 380 | #include <linux/tty.h> |
374 | #include <linux/device.h> | 381 | #include <linux/device.h> |
375 | #include <linux/workqueue.h> | 382 | #include <linux/workqueue.h> |
376 | #include <linux/devfs_fs_kernel.h> | ||
377 | #include <linux/notifier.h> | 383 | #include <linux/notifier.h> |
378 | #include <linux/list.h> | 384 | #include <linux/list.h> |
379 | #include <asm/io.h> | 385 | #include <asm/io.h> |
@@ -497,23 +503,19 @@ struct fb_cursor_user { | |||
497 | #define FB_EVENT_MODE_DELETE 0x04 | 503 | #define FB_EVENT_MODE_DELETE 0x04 |
498 | /* A driver registered itself */ | 504 | /* A driver registered itself */ |
499 | #define FB_EVENT_FB_REGISTERED 0x05 | 505 | #define FB_EVENT_FB_REGISTERED 0x05 |
506 | /* A driver unregistered itself */ | ||
507 | #define FB_EVENT_FB_UNREGISTERED 0x06 | ||
500 | /* CONSOLE-SPECIFIC: get console to framebuffer mapping */ | 508 | /* CONSOLE-SPECIFIC: get console to framebuffer mapping */ |
501 | #define FB_EVENT_GET_CONSOLE_MAP 0x06 | 509 | #define FB_EVENT_GET_CONSOLE_MAP 0x07 |
502 | /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ | 510 | /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ |
503 | #define FB_EVENT_SET_CONSOLE_MAP 0x07 | 511 | #define FB_EVENT_SET_CONSOLE_MAP 0x08 |
504 | /* A display blank is requested */ | 512 | /* A display blank is requested */ |
505 | #define FB_EVENT_BLANK 0x08 | 513 | #define FB_EVENT_BLANK 0x09 |
506 | /* Private modelist is to be replaced */ | 514 | /* Private modelist is to be replaced */ |
507 | #define FB_EVENT_NEW_MODELIST 0x09 | 515 | #define FB_EVENT_NEW_MODELIST 0x0A |
508 | /* The resolution of the passed in fb_info about to change and | 516 | /* The resolution of the passed in fb_info about to change and |
509 | all vc's should be changed */ | 517 | all vc's should be changed */ |
510 | #define FB_EVENT_MODE_CHANGE_ALL 0x0A | 518 | #define FB_EVENT_MODE_CHANGE_ALL 0x0B |
511 | /* CONSOLE-SPECIFIC: set console rotation */ | ||
512 | #define FB_EVENT_SET_CON_ROTATE 0x0B | ||
513 | /* CONSOLE-SPECIFIC: get console rotation */ | ||
514 | #define FB_EVENT_GET_CON_ROTATE 0x0C | ||
515 | /* CONSOLE-SPECIFIC: rotate all consoles */ | ||
516 | #define FB_EVENT_SET_CON_ROTATE_ALL 0x0D | ||
517 | 519 | ||
518 | struct fb_event { | 520 | struct fb_event { |
519 | struct fb_info *info; | 521 | struct fb_info *info; |
@@ -555,7 +557,7 @@ struct fb_pixmap { | |||
555 | * Frame buffer operations | 557 | * Frame buffer operations |
556 | * | 558 | * |
557 | * LOCKING NOTE: those functions must _ALL_ be called with the console | 559 | * LOCKING NOTE: those functions must _ALL_ be called with the console |
558 | * semaphore held, this is the only suitable locking mecanism we have | 560 | * semaphore held, this is the only suitable locking mechanism we have |
559 | * in 2.6. Some may be called at interrupt time at this point though. | 561 | * in 2.6. Some may be called at interrupt time at this point though. |
560 | */ | 562 | */ |
561 | 563 | ||
@@ -756,6 +758,21 @@ struct fb_info { | |||
756 | struct fb_cmap cmap; /* Current cmap */ | 758 | struct fb_cmap cmap; /* Current cmap */ |
757 | struct list_head modelist; /* mode list */ | 759 | struct list_head modelist; /* mode list */ |
758 | struct fb_videomode *mode; /* current mode */ | 760 | struct fb_videomode *mode; /* current mode */ |
761 | |||
762 | #ifdef CONFIG_FB_BACKLIGHT | ||
763 | /* Lock ordering: | ||
764 | * bl_mutex (protects bl_dev and bl_curve) | ||
765 | * bl_dev->sem (backlight class) | ||
766 | */ | ||
767 | struct mutex bl_mutex; | ||
768 | |||
769 | /* assigned backlight device */ | ||
770 | struct backlight_device *bl_dev; | ||
771 | |||
772 | /* Backlight level curve */ | ||
773 | u8 bl_curve[FB_BACKLIGHT_LEVELS]; | ||
774 | #endif | ||
775 | |||
759 | struct fb_ops *fbops; | 776 | struct fb_ops *fbops; |
760 | struct device *device; | 777 | struct device *device; |
761 | struct class_device *class_device; /* sysfs per device attrs */ | 778 | struct class_device *class_device; /* sysfs per device attrs */ |
@@ -870,7 +887,6 @@ extern int fb_get_color_depth(struct fb_var_screeninfo *var, | |||
870 | struct fb_fix_screeninfo *fix); | 887 | struct fb_fix_screeninfo *fix); |
871 | extern int fb_get_options(char *name, char **option); | 888 | extern int fb_get_options(char *name, char **option); |
872 | extern int fb_new_modelist(struct fb_info *info); | 889 | extern int fb_new_modelist(struct fb_info *info); |
873 | extern int fb_con_duit(struct fb_info *info, int event, void *data); | ||
874 | 890 | ||
875 | extern struct fb_info *registered_fb[FB_MAX]; | 891 | extern struct fb_info *registered_fb[FB_MAX]; |
876 | extern int num_registered_fb; | 892 | extern int num_registered_fb; |
@@ -895,6 +911,7 @@ extern struct fb_info *framebuffer_alloc(size_t size, struct device *dev); | |||
895 | extern void framebuffer_release(struct fb_info *info); | 911 | extern void framebuffer_release(struct fb_info *info); |
896 | extern int fb_init_class_device(struct fb_info *fb_info); | 912 | extern int fb_init_class_device(struct fb_info *fb_info); |
897 | extern void fb_cleanup_class_device(struct fb_info *head); | 913 | extern void fb_cleanup_class_device(struct fb_info *head); |
914 | extern void fb_bl_default_curve(struct fb_info *fb_info, u8 off, u8 min, u8 max); | ||
898 | 915 | ||
899 | /* drivers/video/fbmon.c */ | 916 | /* drivers/video/fbmon.c */ |
900 | #define FB_MAXTIMINGS 0 | 917 | #define FB_MAXTIMINGS 0 |
diff --git a/include/linux/fcntl.h b/include/linux/fcntl.h index c52a63755fdd..996f5611cd59 100644 --- a/include/linux/fcntl.h +++ b/include/linux/fcntl.h | |||
@@ -29,6 +29,7 @@ | |||
29 | #define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */ | 29 | #define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */ |
30 | #define AT_REMOVEDIR 0x200 /* Remove directory instead of | 30 | #define AT_REMOVEDIR 0x200 /* Remove directory instead of |
31 | unlinking file. */ | 31 | unlinking file. */ |
32 | #define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */ | ||
32 | 33 | ||
33 | #ifdef __KERNEL__ | 34 | #ifdef __KERNEL__ |
34 | 35 | ||
diff --git a/include/linux/fs.h b/include/linux/fs.h index 39e3d117e3d9..0c5e1c5b03db 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -6,7 +6,6 @@ | |||
6 | * structures etc. | 6 | * structures etc. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <linux/config.h> | ||
10 | #include <linux/limits.h> | 9 | #include <linux/limits.h> |
11 | #include <linux/ioctl.h> | 10 | #include <linux/ioctl.h> |
12 | 11 | ||
@@ -377,7 +376,8 @@ struct address_space_operations { | |||
377 | struct page* (*get_xip_page)(struct address_space *, sector_t, | 376 | struct page* (*get_xip_page)(struct address_space *, sector_t, |
378 | int); | 377 | int); |
379 | /* migrate the contents of a page to the specified target */ | 378 | /* migrate the contents of a page to the specified target */ |
380 | int (*migratepage) (struct page *, struct page *); | 379 | int (*migratepage) (struct address_space *, |
380 | struct page *, struct page *); | ||
381 | }; | 381 | }; |
382 | 382 | ||
383 | struct backing_dev_info; | 383 | struct backing_dev_info; |
@@ -392,7 +392,7 @@ struct address_space { | |||
392 | unsigned int truncate_count; /* Cover race condition with truncate */ | 392 | unsigned int truncate_count; /* Cover race condition with truncate */ |
393 | unsigned long nrpages; /* number of total pages */ | 393 | unsigned long nrpages; /* number of total pages */ |
394 | pgoff_t writeback_index;/* writeback starts here */ | 394 | pgoff_t writeback_index;/* writeback starts here */ |
395 | struct address_space_operations *a_ops; /* methods */ | 395 | const struct address_space_operations *a_ops; /* methods */ |
396 | unsigned long flags; /* error bits/gfp mask */ | 396 | unsigned long flags; /* error bits/gfp mask */ |
397 | struct backing_dev_info *backing_dev_info; /* device readahead, etc */ | 397 | struct backing_dev_info *backing_dev_info; /* device readahead, etc */ |
398 | spinlock_t private_lock; /* for use by the address_space */ | 398 | spinlock_t private_lock; /* for use by the address_space */ |
@@ -683,6 +683,7 @@ extern spinlock_t files_lock; | |||
683 | #define FL_FLOCK 2 | 683 | #define FL_FLOCK 2 |
684 | #define FL_ACCESS 8 /* not trying to lock, just looking */ | 684 | #define FL_ACCESS 8 /* not trying to lock, just looking */ |
685 | #define FL_LEASE 32 /* lease held on this file */ | 685 | #define FL_LEASE 32 /* lease held on this file */ |
686 | #define FL_CLOSE 64 /* unlock on close */ | ||
686 | #define FL_SLEEP 128 /* A blocking lock */ | 687 | #define FL_SLEEP 128 /* A blocking lock */ |
687 | 688 | ||
688 | /* | 689 | /* |
@@ -775,7 +776,6 @@ extern int posix_lock_file_conf(struct file *, struct file_lock *, struct file_l | |||
775 | extern int posix_lock_file(struct file *, struct file_lock *); | 776 | extern int posix_lock_file(struct file *, struct file_lock *); |
776 | extern int posix_lock_file_wait(struct file *, struct file_lock *); | 777 | extern int posix_lock_file_wait(struct file *, struct file_lock *); |
777 | extern int posix_unblock_lock(struct file *, struct file_lock *); | 778 | extern int posix_unblock_lock(struct file *, struct file_lock *); |
778 | extern int posix_locks_deadlock(struct file_lock *, struct file_lock *); | ||
779 | extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); | 779 | extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); |
780 | extern int __break_lease(struct inode *inode, unsigned int flags); | 780 | extern int __break_lease(struct inode *inode, unsigned int flags); |
781 | extern void lease_get_mtime(struct inode *, struct timespec *time); | 781 | extern void lease_get_mtime(struct inode *, struct timespec *time); |
@@ -783,7 +783,6 @@ extern int setlease(struct file *, long, struct file_lock **); | |||
783 | extern int lease_modify(struct file_lock **, int); | 783 | extern int lease_modify(struct file_lock **, int); |
784 | extern int lock_may_read(struct inode *, loff_t start, unsigned long count); | 784 | extern int lock_may_read(struct inode *, loff_t start, unsigned long count); |
785 | extern int lock_may_write(struct inode *, loff_t start, unsigned long count); | 785 | extern int lock_may_write(struct inode *, loff_t start, unsigned long count); |
786 | extern void steal_locks(fl_owner_t from); | ||
787 | 786 | ||
788 | struct fasync_struct { | 787 | struct fasync_struct { |
789 | int magic; | 788 | int magic; |
@@ -1026,7 +1025,7 @@ struct file_operations { | |||
1026 | long (*compat_ioctl) (struct file *, unsigned int, unsigned long); | 1025 | long (*compat_ioctl) (struct file *, unsigned int, unsigned long); |
1027 | int (*mmap) (struct file *, struct vm_area_struct *); | 1026 | int (*mmap) (struct file *, struct vm_area_struct *); |
1028 | int (*open) (struct inode *, struct file *); | 1027 | int (*open) (struct inode *, struct file *); |
1029 | int (*flush) (struct file *); | 1028 | int (*flush) (struct file *, fl_owner_t id); |
1030 | int (*release) (struct inode *, struct file *); | 1029 | int (*release) (struct inode *, struct file *); |
1031 | int (*fsync) (struct file *, struct dentry *, int datasync); | 1030 | int (*fsync) (struct file *, struct dentry *, int datasync); |
1032 | int (*aio_fsync) (struct kiocb *, int datasync); | 1031 | int (*aio_fsync) (struct kiocb *, int datasync); |
@@ -1098,10 +1097,10 @@ struct super_operations { | |||
1098 | int (*sync_fs)(struct super_block *sb, int wait); | 1097 | int (*sync_fs)(struct super_block *sb, int wait); |
1099 | void (*write_super_lockfs) (struct super_block *); | 1098 | void (*write_super_lockfs) (struct super_block *); |
1100 | void (*unlockfs) (struct super_block *); | 1099 | void (*unlockfs) (struct super_block *); |
1101 | int (*statfs) (struct super_block *, struct kstatfs *); | 1100 | int (*statfs) (struct dentry *, struct kstatfs *); |
1102 | int (*remount_fs) (struct super_block *, int *, char *); | 1101 | int (*remount_fs) (struct super_block *, int *, char *); |
1103 | void (*clear_inode) (struct inode *); | 1102 | void (*clear_inode) (struct inode *); |
1104 | void (*umount_begin) (struct super_block *); | 1103 | void (*umount_begin) (struct vfsmount *, int); |
1105 | 1104 | ||
1106 | int (*show_options)(struct seq_file *, struct vfsmount *); | 1105 | int (*show_options)(struct seq_file *, struct vfsmount *); |
1107 | int (*show_stats)(struct seq_file *, struct vfsmount *); | 1106 | int (*show_stats)(struct seq_file *, struct vfsmount *); |
@@ -1271,23 +1270,26 @@ find_exported_dentry(struct super_block *sb, void *obj, void *parent, | |||
1271 | struct file_system_type { | 1270 | struct file_system_type { |
1272 | const char *name; | 1271 | const char *name; |
1273 | int fs_flags; | 1272 | int fs_flags; |
1274 | struct super_block *(*get_sb) (struct file_system_type *, int, | 1273 | int (*get_sb) (struct file_system_type *, int, |
1275 | const char *, void *); | 1274 | const char *, void *, struct vfsmount *); |
1276 | void (*kill_sb) (struct super_block *); | 1275 | void (*kill_sb) (struct super_block *); |
1277 | struct module *owner; | 1276 | struct module *owner; |
1278 | struct file_system_type * next; | 1277 | struct file_system_type * next; |
1279 | struct list_head fs_supers; | 1278 | struct list_head fs_supers; |
1280 | }; | 1279 | }; |
1281 | 1280 | ||
1282 | struct super_block *get_sb_bdev(struct file_system_type *fs_type, | 1281 | extern int get_sb_bdev(struct file_system_type *fs_type, |
1283 | int flags, const char *dev_name, void *data, | 1282 | int flags, const char *dev_name, void *data, |
1284 | int (*fill_super)(struct super_block *, void *, int)); | 1283 | int (*fill_super)(struct super_block *, void *, int), |
1285 | struct super_block *get_sb_single(struct file_system_type *fs_type, | 1284 | struct vfsmount *mnt); |
1285 | extern int get_sb_single(struct file_system_type *fs_type, | ||
1286 | int flags, void *data, | 1286 | int flags, void *data, |
1287 | int (*fill_super)(struct super_block *, void *, int)); | 1287 | int (*fill_super)(struct super_block *, void *, int), |
1288 | struct super_block *get_sb_nodev(struct file_system_type *fs_type, | 1288 | struct vfsmount *mnt); |
1289 | extern int get_sb_nodev(struct file_system_type *fs_type, | ||
1289 | int flags, void *data, | 1290 | int flags, void *data, |
1290 | int (*fill_super)(struct super_block *, void *, int)); | 1291 | int (*fill_super)(struct super_block *, void *, int), |
1292 | struct vfsmount *mnt); | ||
1291 | void generic_shutdown_super(struct super_block *sb); | 1293 | void generic_shutdown_super(struct super_block *sb); |
1292 | void kill_block_super(struct super_block *sb); | 1294 | void kill_block_super(struct super_block *sb); |
1293 | void kill_anon_super(struct super_block *sb); | 1295 | void kill_anon_super(struct super_block *sb); |
@@ -1298,8 +1300,10 @@ struct super_block *sget(struct file_system_type *type, | |||
1298 | int (*test)(struct super_block *,void *), | 1300 | int (*test)(struct super_block *,void *), |
1299 | int (*set)(struct super_block *,void *), | 1301 | int (*set)(struct super_block *,void *), |
1300 | void *data); | 1302 | void *data); |
1301 | struct super_block *get_sb_pseudo(struct file_system_type *, char *, | 1303 | extern int get_sb_pseudo(struct file_system_type *, char *, |
1302 | struct super_operations *ops, unsigned long); | 1304 | struct super_operations *ops, unsigned long, |
1305 | struct vfsmount *mnt); | ||
1306 | extern int simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); | ||
1303 | int __put_super(struct super_block *sb); | 1307 | int __put_super(struct super_block *sb); |
1304 | int __put_super_and_need_restart(struct super_block *sb); | 1308 | int __put_super_and_need_restart(struct super_block *sb); |
1305 | void unnamed_dev_init(void); | 1309 | void unnamed_dev_init(void); |
@@ -1322,7 +1326,7 @@ extern struct vfsmount *copy_tree(struct vfsmount *, struct dentry *, int); | |||
1322 | extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *, | 1326 | extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *, |
1323 | struct vfsmount *); | 1327 | struct vfsmount *); |
1324 | 1328 | ||
1325 | extern int vfs_statfs(struct super_block *, struct kstatfs *); | 1329 | extern int vfs_statfs(struct dentry *, struct kstatfs *); |
1326 | 1330 | ||
1327 | /* /sys/fs */ | 1331 | /* /sys/fs */ |
1328 | extern struct subsystem fs_subsys; | 1332 | extern struct subsystem fs_subsys; |
@@ -1404,7 +1408,7 @@ extern void bd_forget(struct inode *inode); | |||
1404 | extern void bdput(struct block_device *); | 1408 | extern void bdput(struct block_device *); |
1405 | extern struct block_device *open_by_devnum(dev_t, unsigned); | 1409 | extern struct block_device *open_by_devnum(dev_t, unsigned); |
1406 | extern const struct file_operations def_blk_fops; | 1410 | extern const struct file_operations def_blk_fops; |
1407 | extern struct address_space_operations def_blk_aops; | 1411 | extern const struct address_space_operations def_blk_aops; |
1408 | extern const struct file_operations def_chr_fops; | 1412 | extern const struct file_operations def_chr_fops; |
1409 | extern const struct file_operations bad_sock_fops; | 1413 | extern const struct file_operations bad_sock_fops; |
1410 | extern const struct file_operations def_fifo_fops; | 1414 | extern const struct file_operations def_fifo_fops; |
@@ -1746,7 +1750,7 @@ extern int dcache_dir_close(struct inode *, struct file *); | |||
1746 | extern loff_t dcache_dir_lseek(struct file *, loff_t, int); | 1750 | extern loff_t dcache_dir_lseek(struct file *, loff_t, int); |
1747 | extern int dcache_readdir(struct file *, void *, filldir_t); | 1751 | extern int dcache_readdir(struct file *, void *, filldir_t); |
1748 | extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *); | 1752 | extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *); |
1749 | extern int simple_statfs(struct super_block *, struct kstatfs *); | 1753 | extern int simple_statfs(struct dentry *, struct kstatfs *); |
1750 | extern int simple_link(struct dentry *, struct inode *, struct dentry *); | 1754 | extern int simple_link(struct dentry *, struct inode *, struct dentry *); |
1751 | extern int simple_unlink(struct inode *, struct dentry *); | 1755 | extern int simple_unlink(struct inode *, struct dentry *); |
1752 | extern int simple_rmdir(struct inode *, struct dentry *); | 1756 | extern int simple_rmdir(struct inode *, struct dentry *); |
@@ -1766,13 +1770,14 @@ extern struct inode_operations simple_dir_inode_operations; | |||
1766 | struct tree_descr { char *name; const struct file_operations *ops; int mode; }; | 1770 | struct tree_descr { char *name; const struct file_operations *ops; int mode; }; |
1767 | struct dentry *d_alloc_name(struct dentry *, const char *); | 1771 | struct dentry *d_alloc_name(struct dentry *, const char *); |
1768 | extern int simple_fill_super(struct super_block *, int, struct tree_descr *); | 1772 | extern int simple_fill_super(struct super_block *, int, struct tree_descr *); |
1769 | extern int simple_pin_fs(char *name, struct vfsmount **mount, int *count); | 1773 | extern int simple_pin_fs(struct file_system_type *, struct vfsmount **mount, int *count); |
1770 | extern void simple_release_fs(struct vfsmount **mount, int *count); | 1774 | extern void simple_release_fs(struct vfsmount **mount, int *count); |
1771 | 1775 | ||
1772 | extern ssize_t simple_read_from_buffer(void __user *, size_t, loff_t *, const void *, size_t); | 1776 | extern ssize_t simple_read_from_buffer(void __user *, size_t, loff_t *, const void *, size_t); |
1773 | 1777 | ||
1774 | #ifdef CONFIG_MIGRATION | 1778 | #ifdef CONFIG_MIGRATION |
1775 | extern int buffer_migrate_page(struct page *, struct page *); | 1779 | extern int buffer_migrate_page(struct address_space *, |
1780 | struct page *, struct page *); | ||
1776 | #else | 1781 | #else |
1777 | #define buffer_migrate_page NULL | 1782 | #define buffer_migrate_page NULL |
1778 | #endif | 1783 | #endif |
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index 11438eff4d44..cc5dec70c32c 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
@@ -54,19 +54,20 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, | |||
54 | 54 | ||
55 | if (isdir) | 55 | if (isdir) |
56 | isdir = IN_ISDIR; | 56 | isdir = IN_ISDIR; |
57 | inotify_inode_queue_event(old_dir, IN_MOVED_FROM|isdir,cookie,old_name); | 57 | inotify_inode_queue_event(old_dir, IN_MOVED_FROM|isdir,cookie,old_name, |
58 | inotify_inode_queue_event(new_dir, IN_MOVED_TO|isdir, cookie, new_name); | 58 | source); |
59 | inotify_inode_queue_event(new_dir, IN_MOVED_TO|isdir, cookie, new_name, | ||
60 | source); | ||
59 | 61 | ||
60 | if (target) { | 62 | if (target) { |
61 | inotify_inode_queue_event(target, IN_DELETE_SELF, 0, NULL); | 63 | inotify_inode_queue_event(target, IN_DELETE_SELF, 0, NULL, NULL); |
62 | inotify_inode_is_dead(target); | 64 | inotify_inode_is_dead(target); |
63 | } | 65 | } |
64 | 66 | ||
65 | if (source) { | 67 | if (source) { |
66 | inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL); | 68 | inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL, NULL); |
67 | } | 69 | } |
68 | audit_inode_child(old_name, source, old_dir->i_ino); | 70 | audit_inode_child(new_name, source, new_dir->i_ino); |
69 | audit_inode_child(new_name, target, new_dir->i_ino); | ||
70 | } | 71 | } |
71 | 72 | ||
72 | /* | 73 | /* |
@@ -85,7 +86,7 @@ static inline void fsnotify_nameremove(struct dentry *dentry, int isdir) | |||
85 | */ | 86 | */ |
86 | static inline void fsnotify_inoderemove(struct inode *inode) | 87 | static inline void fsnotify_inoderemove(struct inode *inode) |
87 | { | 88 | { |
88 | inotify_inode_queue_event(inode, IN_DELETE_SELF, 0, NULL); | 89 | inotify_inode_queue_event(inode, IN_DELETE_SELF, 0, NULL, NULL); |
89 | inotify_inode_is_dead(inode); | 90 | inotify_inode_is_dead(inode); |
90 | } | 91 | } |
91 | 92 | ||
@@ -95,7 +96,8 @@ static inline void fsnotify_inoderemove(struct inode *inode) | |||
95 | static inline void fsnotify_create(struct inode *inode, struct dentry *dentry) | 96 | static inline void fsnotify_create(struct inode *inode, struct dentry *dentry) |
96 | { | 97 | { |
97 | inode_dir_notify(inode, DN_CREATE); | 98 | inode_dir_notify(inode, DN_CREATE); |
98 | inotify_inode_queue_event(inode, IN_CREATE, 0, dentry->d_name.name); | 99 | inotify_inode_queue_event(inode, IN_CREATE, 0, dentry->d_name.name, |
100 | dentry->d_inode); | ||
99 | audit_inode_child(dentry->d_name.name, dentry->d_inode, inode->i_ino); | 101 | audit_inode_child(dentry->d_name.name, dentry->d_inode, inode->i_ino); |
100 | } | 102 | } |
101 | 103 | ||
@@ -106,7 +108,7 @@ static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry) | |||
106 | { | 108 | { |
107 | inode_dir_notify(inode, DN_CREATE); | 109 | inode_dir_notify(inode, DN_CREATE); |
108 | inotify_inode_queue_event(inode, IN_CREATE | IN_ISDIR, 0, | 110 | inotify_inode_queue_event(inode, IN_CREATE | IN_ISDIR, 0, |
109 | dentry->d_name.name); | 111 | dentry->d_name.name, dentry->d_inode); |
110 | audit_inode_child(dentry->d_name.name, dentry->d_inode, inode->i_ino); | 112 | audit_inode_child(dentry->d_name.name, dentry->d_inode, inode->i_ino); |
111 | } | 113 | } |
112 | 114 | ||
@@ -123,7 +125,7 @@ static inline void fsnotify_access(struct dentry *dentry) | |||
123 | 125 | ||
124 | dnotify_parent(dentry, DN_ACCESS); | 126 | dnotify_parent(dentry, DN_ACCESS); |
125 | inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name); | 127 | inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name); |
126 | inotify_inode_queue_event(inode, mask, 0, NULL); | 128 | inotify_inode_queue_event(inode, mask, 0, NULL, NULL); |
127 | } | 129 | } |
128 | 130 | ||
129 | /* | 131 | /* |
@@ -139,7 +141,7 @@ static inline void fsnotify_modify(struct dentry *dentry) | |||
139 | 141 | ||
140 | dnotify_parent(dentry, DN_MODIFY); | 142 | dnotify_parent(dentry, DN_MODIFY); |
141 | inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name); | 143 | inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name); |
142 | inotify_inode_queue_event(inode, mask, 0, NULL); | 144 | inotify_inode_queue_event(inode, mask, 0, NULL, NULL); |
143 | } | 145 | } |
144 | 146 | ||
145 | /* | 147 | /* |
@@ -154,7 +156,7 @@ static inline void fsnotify_open(struct dentry *dentry) | |||
154 | mask |= IN_ISDIR; | 156 | mask |= IN_ISDIR; |
155 | 157 | ||
156 | inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name); | 158 | inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name); |
157 | inotify_inode_queue_event(inode, mask, 0, NULL); | 159 | inotify_inode_queue_event(inode, mask, 0, NULL, NULL); |
158 | } | 160 | } |
159 | 161 | ||
160 | /* | 162 | /* |
@@ -172,7 +174,7 @@ static inline void fsnotify_close(struct file *file) | |||
172 | mask |= IN_ISDIR; | 174 | mask |= IN_ISDIR; |
173 | 175 | ||
174 | inotify_dentry_parent_queue_event(dentry, mask, 0, name); | 176 | inotify_dentry_parent_queue_event(dentry, mask, 0, name); |
175 | inotify_inode_queue_event(inode, mask, 0, NULL); | 177 | inotify_inode_queue_event(inode, mask, 0, NULL, NULL); |
176 | } | 178 | } |
177 | 179 | ||
178 | /* | 180 | /* |
@@ -187,7 +189,7 @@ static inline void fsnotify_xattr(struct dentry *dentry) | |||
187 | mask |= IN_ISDIR; | 189 | mask |= IN_ISDIR; |
188 | 190 | ||
189 | inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name); | 191 | inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name); |
190 | inotify_inode_queue_event(inode, mask, 0, NULL); | 192 | inotify_inode_queue_event(inode, mask, 0, NULL, NULL); |
191 | } | 193 | } |
192 | 194 | ||
193 | /* | 195 | /* |
@@ -234,7 +236,7 @@ static inline void fsnotify_change(struct dentry *dentry, unsigned int ia_valid) | |||
234 | if (in_mask) { | 236 | if (in_mask) { |
235 | if (S_ISDIR(inode->i_mode)) | 237 | if (S_ISDIR(inode->i_mode)) |
236 | in_mask |= IN_ISDIR; | 238 | in_mask |= IN_ISDIR; |
237 | inotify_inode_queue_event(inode, in_mask, 0, NULL); | 239 | inotify_inode_queue_event(inode, in_mask, 0, NULL, NULL); |
238 | inotify_dentry_parent_queue_event(dentry, in_mask, 0, | 240 | inotify_dentry_parent_queue_event(dentry, in_mask, 0, |
239 | dentry->d_name.name); | 241 | dentry->d_name.name); |
240 | } | 242 | } |
diff --git a/include/linux/ftape.h b/include/linux/ftape.h index 72faeec9f6e1..7e7038cba86a 100644 --- a/include/linux/ftape.h +++ b/include/linux/ftape.h | |||
@@ -35,7 +35,6 @@ | |||
35 | #include <linux/mm.h> | 35 | #include <linux/mm.h> |
36 | #endif | 36 | #endif |
37 | #include <linux/types.h> | 37 | #include <linux/types.h> |
38 | #include <linux/config.h> | ||
39 | #include <linux/mtio.h> | 38 | #include <linux/mtio.h> |
40 | 39 | ||
41 | #define FT_SECTOR(x) (x+1) /* sector offset into real sector */ | 40 | #define FT_SECTOR(x) (x+1) /* sector offset into real sector */ |
diff --git a/include/linux/fuse.h b/include/linux/fuse.h index 5425b60021e3..9fc48a674b82 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | FUSE: Filesystem in Userspace | 2 | FUSE: Filesystem in Userspace |
3 | Copyright (C) 2001-2005 Miklos Szeredi <miklos@szeredi.hu> | 3 | Copyright (C) 2001-2006 Miklos Szeredi <miklos@szeredi.hu> |
4 | 4 | ||
5 | This program can be distributed under the terms of the GNU GPL. | 5 | This program can be distributed under the terms of the GNU GPL. |
6 | See the file COPYING. | 6 | See the file COPYING. |
@@ -9,18 +9,19 @@ | |||
9 | /* This file defines the kernel interface of FUSE */ | 9 | /* This file defines the kernel interface of FUSE */ |
10 | 10 | ||
11 | #include <asm/types.h> | 11 | #include <asm/types.h> |
12 | #include <linux/major.h> | ||
12 | 13 | ||
13 | /** Version number of this interface */ | 14 | /** Version number of this interface */ |
14 | #define FUSE_KERNEL_VERSION 7 | 15 | #define FUSE_KERNEL_VERSION 7 |
15 | 16 | ||
16 | /** Minor version number of this interface */ | 17 | /** Minor version number of this interface */ |
17 | #define FUSE_KERNEL_MINOR_VERSION 6 | 18 | #define FUSE_KERNEL_MINOR_VERSION 7 |
18 | 19 | ||
19 | /** The node ID of the root inode */ | 20 | /** The node ID of the root inode */ |
20 | #define FUSE_ROOT_ID 1 | 21 | #define FUSE_ROOT_ID 1 |
21 | 22 | ||
22 | /** The major number of the fuse character device */ | 23 | /** The major number of the fuse character device */ |
23 | #define FUSE_MAJOR 10 | 24 | #define FUSE_MAJOR MISC_MAJOR |
24 | 25 | ||
25 | /** The minor number of the fuse character device */ | 26 | /** The minor number of the fuse character device */ |
26 | #define FUSE_MINOR 229 | 27 | #define FUSE_MINOR 229 |
@@ -58,6 +59,13 @@ struct fuse_kstatfs { | |||
58 | __u32 spare[6]; | 59 | __u32 spare[6]; |
59 | }; | 60 | }; |
60 | 61 | ||
62 | struct fuse_file_lock { | ||
63 | __u64 start; | ||
64 | __u64 end; | ||
65 | __u32 type; | ||
66 | __u32 pid; /* tgid */ | ||
67 | }; | ||
68 | |||
61 | /** | 69 | /** |
62 | * Bitmasks for fuse_setattr_in.valid | 70 | * Bitmasks for fuse_setattr_in.valid |
63 | */ | 71 | */ |
@@ -82,6 +90,7 @@ struct fuse_kstatfs { | |||
82 | * INIT request/reply flags | 90 | * INIT request/reply flags |
83 | */ | 91 | */ |
84 | #define FUSE_ASYNC_READ (1 << 0) | 92 | #define FUSE_ASYNC_READ (1 << 0) |
93 | #define FUSE_POSIX_LOCKS (1 << 1) | ||
85 | 94 | ||
86 | enum fuse_opcode { | 95 | enum fuse_opcode { |
87 | FUSE_LOOKUP = 1, | 96 | FUSE_LOOKUP = 1, |
@@ -112,8 +121,12 @@ enum fuse_opcode { | |||
112 | FUSE_READDIR = 28, | 121 | FUSE_READDIR = 28, |
113 | FUSE_RELEASEDIR = 29, | 122 | FUSE_RELEASEDIR = 29, |
114 | FUSE_FSYNCDIR = 30, | 123 | FUSE_FSYNCDIR = 30, |
124 | FUSE_GETLK = 31, | ||
125 | FUSE_SETLK = 32, | ||
126 | FUSE_SETLKW = 33, | ||
115 | FUSE_ACCESS = 34, | 127 | FUSE_ACCESS = 34, |
116 | FUSE_CREATE = 35 | 128 | FUSE_CREATE = 35, |
129 | FUSE_INTERRUPT = 36, | ||
117 | }; | 130 | }; |
118 | 131 | ||
119 | /* The read buffer is required to be at least 8k, but may be much larger */ | 132 | /* The read buffer is required to be at least 8k, but may be much larger */ |
@@ -199,6 +212,7 @@ struct fuse_flush_in { | |||
199 | __u64 fh; | 212 | __u64 fh; |
200 | __u32 flush_flags; | 213 | __u32 flush_flags; |
201 | __u32 padding; | 214 | __u32 padding; |
215 | __u64 lock_owner; | ||
202 | }; | 216 | }; |
203 | 217 | ||
204 | struct fuse_read_in { | 218 | struct fuse_read_in { |
@@ -247,6 +261,16 @@ struct fuse_getxattr_out { | |||
247 | __u32 padding; | 261 | __u32 padding; |
248 | }; | 262 | }; |
249 | 263 | ||
264 | struct fuse_lk_in { | ||
265 | __u64 fh; | ||
266 | __u64 owner; | ||
267 | struct fuse_file_lock lk; | ||
268 | }; | ||
269 | |||
270 | struct fuse_lk_out { | ||
271 | struct fuse_file_lock lk; | ||
272 | }; | ||
273 | |||
250 | struct fuse_access_in { | 274 | struct fuse_access_in { |
251 | __u32 mask; | 275 | __u32 mask; |
252 | __u32 padding; | 276 | __u32 padding; |
@@ -268,6 +292,10 @@ struct fuse_init_out { | |||
268 | __u32 max_write; | 292 | __u32 max_write; |
269 | }; | 293 | }; |
270 | 294 | ||
295 | struct fuse_interrupt_in { | ||
296 | __u64 unique; | ||
297 | }; | ||
298 | |||
271 | struct fuse_in_header { | 299 | struct fuse_in_header { |
272 | __u32 len; | 300 | __u32 len; |
273 | __u32 opcode; | 301 | __u32 opcode; |
diff --git a/include/linux/futex.h b/include/linux/futex.h index 966a5b3da439..34c3a215f2cd 100644 --- a/include/linux/futex.h +++ b/include/linux/futex.h | |||
@@ -12,6 +12,9 @@ | |||
12 | #define FUTEX_REQUEUE 3 | 12 | #define FUTEX_REQUEUE 3 |
13 | #define FUTEX_CMP_REQUEUE 4 | 13 | #define FUTEX_CMP_REQUEUE 4 |
14 | #define FUTEX_WAKE_OP 5 | 14 | #define FUTEX_WAKE_OP 5 |
15 | #define FUTEX_LOCK_PI 6 | ||
16 | #define FUTEX_UNLOCK_PI 7 | ||
17 | #define FUTEX_TRYLOCK_PI 8 | ||
15 | 18 | ||
16 | /* | 19 | /* |
17 | * Support for robust futexes: the kernel cleans up held futexes at | 20 | * Support for robust futexes: the kernel cleans up held futexes at |
@@ -90,18 +93,21 @@ struct robust_list_head { | |||
90 | */ | 93 | */ |
91 | #define ROBUST_LIST_LIMIT 2048 | 94 | #define ROBUST_LIST_LIMIT 2048 |
92 | 95 | ||
93 | long do_futex(unsigned long uaddr, int op, int val, | 96 | long do_futex(u32 __user *uaddr, int op, u32 val, unsigned long timeout, |
94 | unsigned long timeout, unsigned long uaddr2, int val2, | 97 | u32 __user *uaddr2, u32 val2, u32 val3); |
95 | int val3); | ||
96 | 98 | ||
97 | extern int handle_futex_death(u32 __user *uaddr, struct task_struct *curr); | 99 | extern int handle_futex_death(u32 __user *uaddr, struct task_struct *curr); |
98 | 100 | ||
99 | #ifdef CONFIG_FUTEX | 101 | #ifdef CONFIG_FUTEX |
100 | extern void exit_robust_list(struct task_struct *curr); | 102 | extern void exit_robust_list(struct task_struct *curr); |
103 | extern void exit_pi_state_list(struct task_struct *curr); | ||
101 | #else | 104 | #else |
102 | static inline void exit_robust_list(struct task_struct *curr) | 105 | static inline void exit_robust_list(struct task_struct *curr) |
103 | { | 106 | { |
104 | } | 107 | } |
108 | static inline void exit_pi_state_list(struct task_struct *curr) | ||
109 | { | ||
110 | } | ||
105 | #endif | 111 | #endif |
106 | 112 | ||
107 | #define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */ | 113 | #define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */ |
diff --git a/include/linux/gameport.h b/include/linux/gameport.h index 71e7b2847cb3..2cdba0c23957 100644 --- a/include/linux/gameport.h +++ b/include/linux/gameport.h | |||
@@ -9,6 +9,7 @@ | |||
9 | * the Free Software Foundation. | 9 | * the Free Software Foundation. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #ifdef __KERNEL__ | ||
12 | #include <asm/io.h> | 13 | #include <asm/io.h> |
13 | #include <linux/list.h> | 14 | #include <linux/list.h> |
14 | #include <linux/mutex.h> | 15 | #include <linux/mutex.h> |
@@ -154,6 +155,8 @@ static inline void gameport_register_driver(struct gameport_driver *drv) | |||
154 | 155 | ||
155 | void gameport_unregister_driver(struct gameport_driver *drv); | 156 | void gameport_unregister_driver(struct gameport_driver *drv); |
156 | 157 | ||
158 | #endif /* __KERNEL__ */ | ||
159 | |||
157 | #define GAMEPORT_MODE_DISABLED 0 | 160 | #define GAMEPORT_MODE_DISABLED 0 |
158 | #define GAMEPORT_MODE_RAW 1 | 161 | #define GAMEPORT_MODE_RAW 1 |
159 | #define GAMEPORT_MODE_COOKED 2 | 162 | #define GAMEPORT_MODE_COOKED 2 |
@@ -169,6 +172,8 @@ void gameport_unregister_driver(struct gameport_driver *drv); | |||
169 | #define GAMEPORT_ID_VENDOR_GRAVIS 0x0009 | 172 | #define GAMEPORT_ID_VENDOR_GRAVIS 0x0009 |
170 | #define GAMEPORT_ID_VENDOR_GUILLEMOT 0x000a | 173 | #define GAMEPORT_ID_VENDOR_GUILLEMOT 0x000a |
171 | 174 | ||
175 | #ifdef __KERNEL__ | ||
176 | |||
172 | static inline void gameport_trigger(struct gameport *gameport) | 177 | static inline void gameport_trigger(struct gameport *gameport) |
173 | { | 178 | { |
174 | if (gameport->trigger) | 179 | if (gameport->trigger) |
@@ -219,4 +224,5 @@ static inline void gameport_set_poll_interval(struct gameport *gameport, unsigne | |||
219 | void gameport_start_polling(struct gameport *gameport); | 224 | void gameport_start_polling(struct gameport *gameport); |
220 | void gameport_stop_polling(struct gameport *gameport); | 225 | void gameport_stop_polling(struct gameport *gameport); |
221 | 226 | ||
227 | #endif /* __KERNEL__ */ | ||
222 | #endif | 228 | #endif |
diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h index 7fd0576a4454..690c42803d2e 100644 --- a/include/linux/genalloc.h +++ b/include/linux/genalloc.h | |||
@@ -4,37 +4,32 @@ | |||
4 | * Uses for this includes on-device special memory, uncached memory | 4 | * Uses for this includes on-device special memory, uncached memory |
5 | * etc. | 5 | * etc. |
6 | * | 6 | * |
7 | * This code is based on the buddy allocator found in the sym53c8xx_2 | ||
8 | * driver, adapted for general purpose use. | ||
9 | * | ||
10 | * This source code is licensed under the GNU General Public License, | 7 | * This source code is licensed under the GNU General Public License, |
11 | * Version 2. See the file COPYING for more details. | 8 | * Version 2. See the file COPYING for more details. |
12 | */ | 9 | */ |
13 | 10 | ||
14 | #include <linux/spinlock.h> | ||
15 | 11 | ||
16 | #define ALLOC_MIN_SHIFT 5 /* 32 bytes minimum */ | ||
17 | /* | 12 | /* |
18 | * Link between free memory chunks of a given size. | 13 | * General purpose special memory pool descriptor. |
19 | */ | 14 | */ |
20 | struct gen_pool_link { | 15 | struct gen_pool { |
21 | struct gen_pool_link *next; | 16 | rwlock_t lock; |
17 | struct list_head chunks; /* list of chunks in this pool */ | ||
18 | int min_alloc_order; /* minimum allocation order */ | ||
22 | }; | 19 | }; |
23 | 20 | ||
24 | /* | 21 | /* |
25 | * Memory pool descriptor. | 22 | * General purpose special memory pool chunk descriptor. |
26 | */ | 23 | */ |
27 | struct gen_pool { | 24 | struct gen_pool_chunk { |
28 | spinlock_t lock; | 25 | spinlock_t lock; |
29 | unsigned long (*get_new_chunk)(struct gen_pool *); | 26 | struct list_head next_chunk; /* next chunk in pool */ |
30 | struct gen_pool *next; | 27 | unsigned long start_addr; /* starting address of memory chunk */ |
31 | struct gen_pool_link *h; | 28 | unsigned long end_addr; /* ending address of memory chunk */ |
32 | unsigned long private; | 29 | unsigned long bits[0]; /* bitmap for allocating memory chunk */ |
33 | int max_chunk_shift; | ||
34 | }; | 30 | }; |
35 | 31 | ||
36 | unsigned long gen_pool_alloc(struct gen_pool *poolp, int size); | 32 | extern struct gen_pool *gen_pool_create(int, int); |
37 | void gen_pool_free(struct gen_pool *mp, unsigned long ptr, int size); | 33 | extern int gen_pool_add(struct gen_pool *, unsigned long, size_t, int); |
38 | struct gen_pool *gen_pool_create(int nr_chunks, int max_chunk_shift, | 34 | extern unsigned long gen_pool_alloc(struct gen_pool *, size_t); |
39 | unsigned long (*fp)(struct gen_pool *), | 35 | extern void gen_pool_free(struct gen_pool *, unsigned long, size_t); |
40 | unsigned long data); | ||
diff --git a/include/linux/generic_serial.h b/include/linux/generic_serial.h index 652611a4bdcd..e25384561955 100644 --- a/include/linux/generic_serial.h +++ b/include/linux/generic_serial.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #ifndef GENERIC_SERIAL_H | 12 | #ifndef GENERIC_SERIAL_H |
13 | #define GENERIC_SERIAL_H | 13 | #define GENERIC_SERIAL_H |
14 | 14 | ||
15 | #ifdef __KERNEL__ | ||
15 | #include <linux/mutex.h> | 16 | #include <linux/mutex.h> |
16 | 17 | ||
17 | struct real_driver { | 18 | struct real_driver { |
@@ -54,6 +55,7 @@ struct gs_port { | |||
54 | spinlock_t driver_lock; | 55 | spinlock_t driver_lock; |
55 | }; | 56 | }; |
56 | 57 | ||
58 | #endif /* __KERNEL__ */ | ||
57 | 59 | ||
58 | /* Flags */ | 60 | /* Flags */ |
59 | /* Warning: serial.h defines some ASYNC_ flags, they say they are "only" | 61 | /* Warning: serial.h defines some ASYNC_ flags, they say they are "only" |
@@ -75,7 +77,7 @@ struct gs_port { | |||
75 | #define GS_DEBUG_FLOW 0x00000020 | 77 | #define GS_DEBUG_FLOW 0x00000020 |
76 | #define GS_DEBUG_WRITE 0x00000040 | 78 | #define GS_DEBUG_WRITE 0x00000040 |
77 | 79 | ||
78 | 80 | #ifdef __KERNEL__ | |
79 | void gs_put_char(struct tty_struct *tty, unsigned char ch); | 81 | void gs_put_char(struct tty_struct *tty, unsigned char ch); |
80 | int gs_write(struct tty_struct *tty, | 82 | int gs_write(struct tty_struct *tty, |
81 | const unsigned char *buf, int count); | 83 | const unsigned char *buf, int count); |
@@ -94,5 +96,5 @@ int gs_init_port(struct gs_port *port); | |||
94 | int gs_setserial(struct gs_port *port, struct serial_struct __user *sp); | 96 | int gs_setserial(struct gs_port *port, struct serial_struct __user *sp); |
95 | int gs_getserial(struct gs_port *port, struct serial_struct __user *sp); | 97 | int gs_getserial(struct gs_port *port, struct serial_struct __user *sp); |
96 | void gs_got_break(struct gs_port *port); | 98 | void gs_got_break(struct gs_port *port); |
97 | 99 | #endif /* __KERNEL__ */ | |
98 | #endif | 100 | #endif |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 2ef845b35175..e4af57e87c17 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -9,13 +9,7 @@ | |||
9 | * <drew@colorado.edu> | 9 | * <drew@colorado.edu> |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/config.h> | ||
13 | #include <linux/types.h> | 12 | #include <linux/types.h> |
14 | #include <linux/major.h> | ||
15 | #include <linux/device.h> | ||
16 | #include <linux/smp.h> | ||
17 | #include <linux/string.h> | ||
18 | #include <linux/fs.h> | ||
19 | 13 | ||
20 | enum { | 14 | enum { |
21 | /* These three have identical behaviour; use the second one if DOS FDISK gets | 15 | /* These three have identical behaviour; use the second one if DOS FDISK gets |
@@ -61,6 +55,12 @@ struct partition { | |||
61 | #endif | 55 | #endif |
62 | 56 | ||
63 | #ifdef __KERNEL__ | 57 | #ifdef __KERNEL__ |
58 | #include <linux/major.h> | ||
59 | #include <linux/device.h> | ||
60 | #include <linux/smp.h> | ||
61 | #include <linux/string.h> | ||
62 | #include <linux/fs.h> | ||
63 | |||
64 | struct partition { | 64 | struct partition { |
65 | unsigned char boot_ind; /* 0x80 - active */ | 65 | unsigned char boot_ind; /* 0x80 - active */ |
66 | unsigned char head; /* starting head */ | 66 | unsigned char head; /* starting head */ |
@@ -112,8 +112,6 @@ struct gendisk { | |||
112 | sector_t capacity; | 112 | sector_t capacity; |
113 | 113 | ||
114 | int flags; | 114 | int flags; |
115 | char devfs_name[64]; /* devfs crap */ | ||
116 | int number; /* more of the same */ | ||
117 | struct device *driverfs_dev; | 115 | struct device *driverfs_dev; |
118 | struct kobject kobj; | 116 | struct kobject kobj; |
119 | struct kobject *holder_dir; | 117 | struct kobject *holder_dir; |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 3ac452945a7d..cc9e60844484 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -4,7 +4,6 @@ | |||
4 | #include <linux/mmzone.h> | 4 | #include <linux/mmzone.h> |
5 | #include <linux/stddef.h> | 5 | #include <linux/stddef.h> |
6 | #include <linux/linkage.h> | 6 | #include <linux/linkage.h> |
7 | #include <linux/config.h> | ||
8 | 7 | ||
9 | struct vm_area_struct; | 8 | struct vm_area_struct; |
10 | 9 | ||
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index eab537091f2a..114ae583cca9 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef LINUX_HARDIRQ_H | 1 | #ifndef LINUX_HARDIRQ_H |
2 | #define LINUX_HARDIRQ_H | 2 | #define LINUX_HARDIRQ_H |
3 | 3 | ||
4 | #include <linux/config.h> | ||
5 | #include <linux/preempt.h> | 4 | #include <linux/preempt.h> |
6 | #include <linux/smp_lock.h> | 5 | #include <linux/smp_lock.h> |
7 | #include <asm/hardirq.h> | 6 | #include <asm/hardirq.h> |
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h index df695e9ae327..4513f9e40937 100644 --- a/include/linux/hdlc.h +++ b/include/linux/hdlc.h | |||
@@ -188,7 +188,7 @@ int hdlc_x25_ioctl(struct net_device *dev, struct ifreq *ifr); | |||
188 | int hdlc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); | 188 | int hdlc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); |
189 | 189 | ||
190 | /* Must be used by hardware driver on module startup/exit */ | 190 | /* Must be used by hardware driver on module startup/exit */ |
191 | int register_hdlc_device(struct net_device *dev); | 191 | #define register_hdlc_device(dev) register_netdev(dev) |
192 | void unregister_hdlc_device(struct net_device *dev); | 192 | void unregister_hdlc_device(struct net_device *dev); |
193 | 193 | ||
194 | struct net_device *alloc_hdlcdev(void *priv); | 194 | struct net_device *alloc_hdlcdev(void *priv); |
diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 892c4ea1b425..85ce7ef9a512 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _LINUX_HIGHMEM_H | 1 | #ifndef _LINUX_HIGHMEM_H |
2 | #define _LINUX_HIGHMEM_H | 2 | #define _LINUX_HIGHMEM_H |
3 | 3 | ||
4 | #include <linux/config.h> | ||
5 | #include <linux/fs.h> | 4 | #include <linux/fs.h> |
6 | #include <linux/mm.h> | 5 | #include <linux/mm.h> |
7 | 6 | ||
diff --git a/include/linux/highuid.h b/include/linux/highuid.h index 53ecac3905e8..434e56246f67 100644 --- a/include/linux/highuid.h +++ b/include/linux/highuid.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _LINUX_HIGHUID_H | 1 | #ifndef _LINUX_HIGHUID_H |
2 | #define _LINUX_HIGHUID_H | 2 | #define _LINUX_HIGHUID_H |
3 | 3 | ||
4 | #include <linux/config.h> | ||
5 | #include <linux/types.h> | 4 | #include <linux/types.h> |
6 | 5 | ||
7 | /* | 6 | /* |
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 306acf1dc6d5..07d7305f131e 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -40,7 +40,6 @@ struct hrtimer_base; | |||
40 | 40 | ||
41 | /** | 41 | /** |
42 | * struct hrtimer - the basic hrtimer structure | 42 | * struct hrtimer - the basic hrtimer structure |
43 | * | ||
44 | * @node: red black tree node for time ordered insertion | 43 | * @node: red black tree node for time ordered insertion |
45 | * @expires: the absolute expiry time in the hrtimers internal | 44 | * @expires: the absolute expiry time in the hrtimers internal |
46 | * representation. The time is related to the clock on | 45 | * representation. The time is related to the clock on |
@@ -59,7 +58,6 @@ struct hrtimer { | |||
59 | 58 | ||
60 | /** | 59 | /** |
61 | * struct hrtimer_sleeper - simple sleeper structure | 60 | * struct hrtimer_sleeper - simple sleeper structure |
62 | * | ||
63 | * @timer: embedded timer structure | 61 | * @timer: embedded timer structure |
64 | * @task: task to wake up | 62 | * @task: task to wake up |
65 | * | 63 | * |
@@ -72,7 +70,6 @@ struct hrtimer_sleeper { | |||
72 | 70 | ||
73 | /** | 71 | /** |
74 | * struct hrtimer_base - the timer base for a specific clock | 72 | * struct hrtimer_base - the timer base for a specific clock |
75 | * | ||
76 | * @index: clock type index for per_cpu support when moving a timer | 73 | * @index: clock type index for per_cpu support when moving a timer |
77 | * to a base on another cpu. | 74 | * to a base on another cpu. |
78 | * @lock: lock protecting the base and associated timers | 75 | * @lock: lock protecting the base and associated timers |
@@ -127,7 +124,7 @@ extern ktime_t hrtimer_get_next_event(void); | |||
127 | 124 | ||
128 | static inline int hrtimer_active(const struct hrtimer *timer) | 125 | static inline int hrtimer_active(const struct hrtimer *timer) |
129 | { | 126 | { |
130 | return timer->node.rb_parent != HRTIMER_INACTIVE; | 127 | return rb_parent(&timer->node) != &timer->node; |
131 | } | 128 | } |
132 | 129 | ||
133 | /* Forward a hrtimer so it expires after now: */ | 130 | /* Forward a hrtimer so it expires after now: */ |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 4c5e610fe442..c25a38d8f600 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -23,6 +23,8 @@ int hugetlb_report_node_meminfo(int, char *); | |||
23 | unsigned long hugetlb_total_pages(void); | 23 | unsigned long hugetlb_total_pages(void); |
24 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, | 24 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, |
25 | unsigned long address, int write_access); | 25 | unsigned long address, int write_access); |
26 | int hugetlb_reserve_pages(struct inode *inode, long from, long to); | ||
27 | void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); | ||
26 | 28 | ||
27 | extern unsigned long max_huge_pages; | 29 | extern unsigned long max_huge_pages; |
28 | extern const unsigned long hugetlb_zero, hugetlb_infinity; | 30 | extern const unsigned long hugetlb_zero, hugetlb_infinity; |
@@ -139,8 +141,6 @@ struct hugetlbfs_sb_info { | |||
139 | 141 | ||
140 | struct hugetlbfs_inode_info { | 142 | struct hugetlbfs_inode_info { |
141 | struct shared_policy policy; | 143 | struct shared_policy policy; |
142 | /* Protected by the (global) hugetlb_lock */ | ||
143 | unsigned long prereserved_hpages; | ||
144 | struct inode vfs_inode; | 144 | struct inode vfs_inode; |
145 | }; | 145 | }; |
146 | 146 | ||
@@ -157,10 +157,6 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb) | |||
157 | extern const struct file_operations hugetlbfs_file_operations; | 157 | extern const struct file_operations hugetlbfs_file_operations; |
158 | extern struct vm_operations_struct hugetlb_vm_ops; | 158 | extern struct vm_operations_struct hugetlb_vm_ops; |
159 | struct file *hugetlb_zero_setup(size_t); | 159 | struct file *hugetlb_zero_setup(size_t); |
160 | int hugetlb_extend_reservation(struct hugetlbfs_inode_info *info, | ||
161 | unsigned long atleast_hpages); | ||
162 | void hugetlb_truncate_reservation(struct hugetlbfs_inode_info *info, | ||
163 | unsigned long atmost_hpages); | ||
164 | int hugetlb_get_quota(struct address_space *mapping); | 160 | int hugetlb_get_quota(struct address_space *mapping); |
165 | void hugetlb_put_quota(struct address_space *mapping); | 161 | void hugetlb_put_quota(struct address_space *mapping); |
166 | 162 | ||
diff --git a/include/linux/hw_random.h b/include/linux/hw_random.h new file mode 100644 index 000000000000..21ea7610e177 --- /dev/null +++ b/include/linux/hw_random.h | |||
@@ -0,0 +1,50 @@ | |||
1 | /* | ||
2 | Hardware Random Number Generator | ||
3 | |||
4 | Please read Documentation/hw_random.txt for details on use. | ||
5 | |||
6 | ---------------------------------------------------------- | ||
7 | This software may be used and distributed according to the terms | ||
8 | of the GNU General Public License, incorporated herein by reference. | ||
9 | |||
10 | */ | ||
11 | |||
12 | #ifndef LINUX_HWRANDOM_H_ | ||
13 | #define LINUX_HWRANDOM_H_ | ||
14 | #ifdef __KERNEL__ | ||
15 | |||
16 | #include <linux/types.h> | ||
17 | #include <linux/list.h> | ||
18 | |||
19 | /** | ||
20 | * struct hwrng - Hardware Random Number Generator driver | ||
21 | * @name: Unique RNG name. | ||
22 | * @init: Initialization callback (can be NULL). | ||
23 | * @cleanup: Cleanup callback (can be NULL). | ||
24 | * @data_present: Callback to determine if data is available | ||
25 | * on the RNG. If NULL, it is assumed that | ||
26 | * there is always data available. | ||
27 | * @data_read: Read data from the RNG device. | ||
28 | * Returns the number of lower random bytes in "data". | ||
29 | * Must not be NULL. | ||
30 | * @priv: Private data, for use by the RNG driver. | ||
31 | */ | ||
32 | struct hwrng { | ||
33 | const char *name; | ||
34 | int (*init)(struct hwrng *rng); | ||
35 | void (*cleanup)(struct hwrng *rng); | ||
36 | int (*data_present)(struct hwrng *rng); | ||
37 | int (*data_read)(struct hwrng *rng, u32 *data); | ||
38 | unsigned long priv; | ||
39 | |||
40 | /* internal. */ | ||
41 | struct list_head list; | ||
42 | }; | ||
43 | |||
44 | /** Register a new Hardware Random Number Generator driver. */ | ||
45 | extern int hwrng_register(struct hwrng *rng); | ||
46 | /** Unregister a Hardware Random Number Generator driver. */ | ||
47 | extern void hwrng_unregister(struct hwrng *rng); | ||
48 | |||
49 | #endif /* __KERNEL__ */ | ||
50 | #endif /* LINUX_HWRANDOM_H_ */ | ||
diff --git a/include/linux/i2c-algo-ite.h b/include/linux/i2c-algo-ite.h index 26a8b89855f1..0073fe96c76e 100644 --- a/include/linux/i2c-algo-ite.h +++ b/include/linux/i2c-algo-ite.h | |||
@@ -29,7 +29,7 @@ | |||
29 | #ifndef I2C_ALGO_ITE_H | 29 | #ifndef I2C_ALGO_ITE_H |
30 | #define I2C_ALGO_ITE_H 1 | 30 | #define I2C_ALGO_ITE_H 1 |
31 | 31 | ||
32 | #include <linux/i2c.h> | 32 | #include <linux/types.h> |
33 | 33 | ||
34 | /* Example of a sequential read request: | 34 | /* Example of a sequential read request: |
35 | struct i2c_iic_msg s_msg; | 35 | struct i2c_iic_msg s_msg; |
@@ -49,6 +49,9 @@ struct i2c_iic_msg { | |||
49 | char *buf; /* pointer to msg data */ | 49 | char *buf; /* pointer to msg data */ |
50 | }; | 50 | }; |
51 | 51 | ||
52 | #ifdef __KERNEL__ | ||
53 | struct i2c_adapter; | ||
54 | |||
52 | struct i2c_algo_iic_data { | 55 | struct i2c_algo_iic_data { |
53 | void *data; /* private data for lolevel routines */ | 56 | void *data; /* private data for lolevel routines */ |
54 | void (*setiic) (void *data, int ctl, int val); | 57 | void (*setiic) (void *data, int ctl, int val); |
@@ -65,5 +68,5 @@ struct i2c_algo_iic_data { | |||
65 | 68 | ||
66 | int i2c_iic_add_bus(struct i2c_adapter *); | 69 | int i2c_iic_add_bus(struct i2c_adapter *); |
67 | int i2c_iic_del_bus(struct i2c_adapter *); | 70 | int i2c_iic_del_bus(struct i2c_adapter *); |
68 | 71 | #endif /* __KERNEL__ */ | |
69 | #endif /* I2C_ALGO_ITE_H */ | 72 | #endif /* I2C_ALGO_ITE_H */ |
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index c8b81f419fd8..21338bb3441d 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
@@ -112,6 +112,9 @@ | |||
112 | #define I2C_DRIVERID_X1205 82 /* Xicor/Intersil X1205 RTC */ | 112 | #define I2C_DRIVERID_X1205 82 /* Xicor/Intersil X1205 RTC */ |
113 | #define I2C_DRIVERID_PCF8563 83 /* Philips PCF8563 RTC */ | 113 | #define I2C_DRIVERID_PCF8563 83 /* Philips PCF8563 RTC */ |
114 | #define I2C_DRIVERID_RS5C372 84 /* Ricoh RS5C372 RTC */ | 114 | #define I2C_DRIVERID_RS5C372 84 /* Ricoh RS5C372 RTC */ |
115 | #define I2C_DRIVERID_BT866 85 /* Conexant bt866 video encoder */ | ||
116 | #define I2C_DRIVERID_KS0127 86 /* Samsung ks0127 video decoder */ | ||
117 | #define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */ | ||
115 | 118 | ||
116 | #define I2C_DRIVERID_I2CDEV 900 | 119 | #define I2C_DRIVERID_I2CDEV 900 |
117 | #define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */ | 120 | #define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */ |
diff --git a/include/linux/i2c-ocores.h b/include/linux/i2c-ocores.h new file mode 100644 index 000000000000..8ed591b0887e --- /dev/null +++ b/include/linux/i2c-ocores.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * i2c-ocores.h - definitions for the i2c-ocores interface | ||
3 | * | ||
4 | * Peter Korsgaard <jacmet@sunsite.dk> | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public License | ||
7 | * version 2. This program is licensed "as is" without any warranty of any | ||
8 | * kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #ifndef _LINUX_I2C_OCORES_H | ||
12 | #define _LINUX_I2C_OCORES_H | ||
13 | |||
14 | struct ocores_i2c_platform_data { | ||
15 | u32 regstep; /* distance between registers */ | ||
16 | u32 clock_khz; /* input clock in kHz */ | ||
17 | }; | ||
18 | |||
19 | #endif /* _LINUX_I2C_OCORES_H */ | ||
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 1635ee25918f..526ddc8eecfb 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -20,14 +20,15 @@ | |||
20 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | 20 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ |
21 | /* ------------------------------------------------------------------------- */ | 21 | /* ------------------------------------------------------------------------- */ |
22 | 22 | ||
23 | /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and | 23 | /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and |
24 | Frodo Looijaard <frodol@dds.nl> */ | 24 | Frodo Looijaard <frodol@dds.nl> */ |
25 | 25 | ||
26 | #ifndef _LINUX_I2C_H | 26 | #ifndef _LINUX_I2C_H |
27 | #define _LINUX_I2C_H | 27 | #define _LINUX_I2C_H |
28 | 28 | ||
29 | #include <linux/module.h> | ||
30 | #include <linux/types.h> | 29 | #include <linux/types.h> |
30 | #ifdef __KERNEL__ | ||
31 | #include <linux/module.h> | ||
31 | #include <linux/i2c-id.h> | 32 | #include <linux/i2c-id.h> |
32 | #include <linux/mod_devicetable.h> | 33 | #include <linux/mod_devicetable.h> |
33 | #include <linux/device.h> /* for struct device */ | 34 | #include <linux/device.h> /* for struct device */ |
@@ -96,13 +97,13 @@ extern s32 i2c_smbus_write_word_data(struct i2c_client * client, | |||
96 | u8 command, u16 value); | 97 | u8 command, u16 value); |
97 | extern s32 i2c_smbus_write_block_data(struct i2c_client * client, | 98 | extern s32 i2c_smbus_write_block_data(struct i2c_client * client, |
98 | u8 command, u8 length, | 99 | u8 command, u8 length, |
99 | u8 *values); | 100 | const u8 *values); |
100 | /* Returns the number of read bytes */ | 101 | /* Returns the number of read bytes */ |
101 | extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, | 102 | extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, |
102 | u8 command, u8 *values); | 103 | u8 command, u8 *values); |
103 | extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client, | 104 | extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client, |
104 | u8 command, u8 length, | 105 | u8 command, u8 length, |
105 | u8 *values); | 106 | const u8 *values); |
106 | 107 | ||
107 | /* | 108 | /* |
108 | * A driver is capable of handling one or more physical devices present on | 109 | * A driver is capable of handling one or more physical devices present on |
@@ -354,6 +355,7 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap) | |||
354 | { | 355 | { |
355 | return adap->nr; | 356 | return adap->nr; |
356 | } | 357 | } |
358 | #endif /* __KERNEL__ */ | ||
357 | 359 | ||
358 | /* | 360 | /* |
359 | * I2C Message - used for pure i2c transaction, also from /dev interface | 361 | * I2C Message - used for pure i2c transaction, also from /dev interface |
@@ -469,6 +471,7 @@ union i2c_smbus_data { | |||
469 | #define I2C_SMBUS 0x0720 /* SMBus-level access */ | 471 | #define I2C_SMBUS 0x0720 /* SMBus-level access */ |
470 | 472 | ||
471 | /* ----- I2C-DEV: char device interface stuff ------------------------- */ | 473 | /* ----- I2C-DEV: char device interface stuff ------------------------- */ |
474 | #ifdef __KERNEL__ | ||
472 | 475 | ||
473 | #define I2C_MAJOR 89 /* Device major number */ | 476 | #define I2C_MAJOR 89 /* Device major number */ |
474 | 477 | ||
@@ -646,5 +649,5 @@ static unsigned short *forces[] = { force, force_##chip1, \ | |||
646 | force_##chip6, force_##chip7, \ | 649 | force_##chip6, force_##chip7, \ |
647 | force_##chip8, NULL }; \ | 650 | force_##chip8, NULL }; \ |
648 | I2C_CLIENT_INSMOD_COMMON | 651 | I2C_CLIENT_INSMOD_COMMON |
649 | 652 | #endif /* __KERNEL__ */ | |
650 | #endif /* _LINUX_I2C_H */ | 653 | #endif /* _LINUX_I2C_H */ |
diff --git a/include/linux/i2o-dev.h b/include/linux/i2o-dev.h index 36fd18cdad28..c2519df1b6dc 100644 --- a/include/linux/i2o-dev.h +++ b/include/linux/i2o-dev.h | |||
@@ -13,7 +13,7 @@ | |||
13 | * This header file defines the I2O APIs that are available to both | 13 | * This header file defines the I2O APIs that are available to both |
14 | * the kernel and user level applications. Kernel specific structures | 14 | * the kernel and user level applications. Kernel specific structures |
15 | * are defined in i2o_osm. OSMs should include _only_ i2o_osm.h which | 15 | * are defined in i2o_osm. OSMs should include _only_ i2o_osm.h which |
16 | * automatically includs this file. | 16 | * automatically includes this file. |
17 | * | 17 | * |
18 | */ | 18 | */ |
19 | 19 | ||
@@ -23,14 +23,7 @@ | |||
23 | /* How many controllers are we allowing */ | 23 | /* How many controllers are we allowing */ |
24 | #define MAX_I2O_CONTROLLERS 32 | 24 | #define MAX_I2O_CONTROLLERS 32 |
25 | 25 | ||
26 | //#include <linux/ioctl.h> | 26 | #include <linux/ioctl.h> |
27 | #ifndef __KERNEL__ | ||
28 | |||
29 | typedef unsigned char u8; | ||
30 | typedef unsigned short u16; | ||
31 | typedef unsigned int u32; | ||
32 | |||
33 | #endif /* __KERNEL__ */ | ||
34 | 27 | ||
35 | /* | 28 | /* |
36 | * I2O Control IOCTLs and structures | 29 | * I2O Control IOCTLs and structures |
@@ -53,7 +46,7 @@ typedef unsigned int u32; | |||
53 | 46 | ||
54 | struct i2o_cmd_passthru32 { | 47 | struct i2o_cmd_passthru32 { |
55 | unsigned int iop; /* IOP unit number */ | 48 | unsigned int iop; /* IOP unit number */ |
56 | u32 msg; /* message */ | 49 | __u32 msg; /* message */ |
57 | }; | 50 | }; |
58 | 51 | ||
59 | struct i2o_cmd_passthru { | 52 | struct i2o_cmd_passthru { |
@@ -138,53 +131,53 @@ typedef struct i2o_sg_io_hdr { | |||
138 | #define I2O_BUS_UNKNOWN 0x80 | 131 | #define I2O_BUS_UNKNOWN 0x80 |
139 | 132 | ||
140 | typedef struct _i2o_pci_bus { | 133 | typedef struct _i2o_pci_bus { |
141 | u8 PciFunctionNumber; | 134 | __u8 PciFunctionNumber; |
142 | u8 PciDeviceNumber; | 135 | __u8 PciDeviceNumber; |
143 | u8 PciBusNumber; | 136 | __u8 PciBusNumber; |
144 | u8 reserved; | 137 | __u8 reserved; |
145 | u16 PciVendorID; | 138 | __u16 PciVendorID; |
146 | u16 PciDeviceID; | 139 | __u16 PciDeviceID; |
147 | } i2o_pci_bus; | 140 | } i2o_pci_bus; |
148 | 141 | ||
149 | typedef struct _i2o_local_bus { | 142 | typedef struct _i2o_local_bus { |
150 | u16 LbBaseIOPort; | 143 | __u16 LbBaseIOPort; |
151 | u16 reserved; | 144 | __u16 reserved; |
152 | u32 LbBaseMemoryAddress; | 145 | __u32 LbBaseMemoryAddress; |
153 | } i2o_local_bus; | 146 | } i2o_local_bus; |
154 | 147 | ||
155 | typedef struct _i2o_isa_bus { | 148 | typedef struct _i2o_isa_bus { |
156 | u16 IsaBaseIOPort; | 149 | __u16 IsaBaseIOPort; |
157 | u8 CSN; | 150 | __u8 CSN; |
158 | u8 reserved; | 151 | __u8 reserved; |
159 | u32 IsaBaseMemoryAddress; | 152 | __u32 IsaBaseMemoryAddress; |
160 | } i2o_isa_bus; | 153 | } i2o_isa_bus; |
161 | 154 | ||
162 | typedef struct _i2o_eisa_bus_info { | 155 | typedef struct _i2o_eisa_bus_info { |
163 | u16 EisaBaseIOPort; | 156 | __u16 EisaBaseIOPort; |
164 | u8 reserved; | 157 | __u8 reserved; |
165 | u8 EisaSlotNumber; | 158 | __u8 EisaSlotNumber; |
166 | u32 EisaBaseMemoryAddress; | 159 | __u32 EisaBaseMemoryAddress; |
167 | } i2o_eisa_bus; | 160 | } i2o_eisa_bus; |
168 | 161 | ||
169 | typedef struct _i2o_mca_bus { | 162 | typedef struct _i2o_mca_bus { |
170 | u16 McaBaseIOPort; | 163 | __u16 McaBaseIOPort; |
171 | u8 reserved; | 164 | __u8 reserved; |
172 | u8 McaSlotNumber; | 165 | __u8 McaSlotNumber; |
173 | u32 McaBaseMemoryAddress; | 166 | __u32 McaBaseMemoryAddress; |
174 | } i2o_mca_bus; | 167 | } i2o_mca_bus; |
175 | 168 | ||
176 | typedef struct _i2o_other_bus { | 169 | typedef struct _i2o_other_bus { |
177 | u16 BaseIOPort; | 170 | __u16 BaseIOPort; |
178 | u16 reserved; | 171 | __u16 reserved; |
179 | u32 BaseMemoryAddress; | 172 | __u32 BaseMemoryAddress; |
180 | } i2o_other_bus; | 173 | } i2o_other_bus; |
181 | 174 | ||
182 | typedef struct _i2o_hrt_entry { | 175 | typedef struct _i2o_hrt_entry { |
183 | u32 adapter_id; | 176 | __u32 adapter_id; |
184 | u32 parent_tid:12; | 177 | __u32 parent_tid:12; |
185 | u32 state:4; | 178 | __u32 state:4; |
186 | u32 bus_num:8; | 179 | __u32 bus_num:8; |
187 | u32 bus_type:8; | 180 | __u32 bus_type:8; |
188 | union { | 181 | union { |
189 | i2o_pci_bus pci_bus; | 182 | i2o_pci_bus pci_bus; |
190 | i2o_local_bus local_bus; | 183 | i2o_local_bus local_bus; |
@@ -196,66 +189,66 @@ typedef struct _i2o_hrt_entry { | |||
196 | } i2o_hrt_entry; | 189 | } i2o_hrt_entry; |
197 | 190 | ||
198 | typedef struct _i2o_hrt { | 191 | typedef struct _i2o_hrt { |
199 | u16 num_entries; | 192 | __u16 num_entries; |
200 | u8 entry_len; | 193 | __u8 entry_len; |
201 | u8 hrt_version; | 194 | __u8 hrt_version; |
202 | u32 change_ind; | 195 | __u32 change_ind; |
203 | i2o_hrt_entry hrt_entry[1]; | 196 | i2o_hrt_entry hrt_entry[1]; |
204 | } i2o_hrt; | 197 | } i2o_hrt; |
205 | 198 | ||
206 | typedef struct _i2o_lct_entry { | 199 | typedef struct _i2o_lct_entry { |
207 | u32 entry_size:16; | 200 | __u32 entry_size:16; |
208 | u32 tid:12; | 201 | __u32 tid:12; |
209 | u32 reserved:4; | 202 | __u32 reserved:4; |
210 | u32 change_ind; | 203 | __u32 change_ind; |
211 | u32 device_flags; | 204 | __u32 device_flags; |
212 | u32 class_id:12; | 205 | __u32 class_id:12; |
213 | u32 version:4; | 206 | __u32 version:4; |
214 | u32 vendor_id:16; | 207 | __u32 vendor_id:16; |
215 | u32 sub_class; | 208 | __u32 sub_class; |
216 | u32 user_tid:12; | 209 | __u32 user_tid:12; |
217 | u32 parent_tid:12; | 210 | __u32 parent_tid:12; |
218 | u32 bios_info:8; | 211 | __u32 bios_info:8; |
219 | u8 identity_tag[8]; | 212 | __u8 identity_tag[8]; |
220 | u32 event_capabilities; | 213 | __u32 event_capabilities; |
221 | } i2o_lct_entry; | 214 | } i2o_lct_entry; |
222 | 215 | ||
223 | typedef struct _i2o_lct { | 216 | typedef struct _i2o_lct { |
224 | u32 table_size:16; | 217 | __u32 table_size:16; |
225 | u32 boot_tid:12; | 218 | __u32 boot_tid:12; |
226 | u32 lct_ver:4; | 219 | __u32 lct_ver:4; |
227 | u32 iop_flags; | 220 | __u32 iop_flags; |
228 | u32 change_ind; | 221 | __u32 change_ind; |
229 | i2o_lct_entry lct_entry[1]; | 222 | i2o_lct_entry lct_entry[1]; |
230 | } i2o_lct; | 223 | } i2o_lct; |
231 | 224 | ||
232 | typedef struct _i2o_status_block { | 225 | typedef struct _i2o_status_block { |
233 | u16 org_id; | 226 | __u16 org_id; |
234 | u16 reserved; | 227 | __u16 reserved; |
235 | u16 iop_id:12; | 228 | __u16 iop_id:12; |
236 | u16 reserved1:4; | 229 | __u16 reserved1:4; |
237 | u16 host_unit_id; | 230 | __u16 host_unit_id; |
238 | u16 segment_number:12; | 231 | __u16 segment_number:12; |
239 | u16 i2o_version:4; | 232 | __u16 i2o_version:4; |
240 | u8 iop_state; | 233 | __u8 iop_state; |
241 | u8 msg_type; | 234 | __u8 msg_type; |
242 | u16 inbound_frame_size; | 235 | __u16 inbound_frame_size; |
243 | u8 init_code; | 236 | __u8 init_code; |
244 | u8 reserved2; | 237 | __u8 reserved2; |
245 | u32 max_inbound_frames; | 238 | __u32 max_inbound_frames; |
246 | u32 cur_inbound_frames; | 239 | __u32 cur_inbound_frames; |
247 | u32 max_outbound_frames; | 240 | __u32 max_outbound_frames; |
248 | char product_id[24]; | 241 | char product_id[24]; |
249 | u32 expected_lct_size; | 242 | __u32 expected_lct_size; |
250 | u32 iop_capabilities; | 243 | __u32 iop_capabilities; |
251 | u32 desired_mem_size; | 244 | __u32 desired_mem_size; |
252 | u32 current_mem_size; | 245 | __u32 current_mem_size; |
253 | u32 current_mem_base; | 246 | __u32 current_mem_base; |
254 | u32 desired_io_size; | 247 | __u32 desired_io_size; |
255 | u32 current_io_size; | 248 | __u32 current_io_size; |
256 | u32 current_io_base; | 249 | __u32 current_io_base; |
257 | u32 reserved3:24; | 250 | __u32 reserved3:24; |
258 | u32 cmd_status:8; | 251 | __u32 cmd_status:8; |
259 | } i2o_status_block; | 252 | } i2o_status_block; |
260 | 253 | ||
261 | /* Event indicator mask flags */ | 254 | /* Event indicator mask flags */ |
diff --git a/include/linux/ide.h b/include/linux/ide.h index a8bef1d1371c..285316c836b5 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -6,7 +6,6 @@ | |||
6 | * Copyright (C) 1994-2002 Linus Torvalds & authors | 6 | * Copyright (C) 1994-2002 Linus Torvalds & authors |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <linux/config.h> | ||
10 | #include <linux/init.h> | 9 | #include <linux/init.h> |
11 | #include <linux/ioport.h> | 10 | #include <linux/ioport.h> |
12 | #include <linux/hdreg.h> | 11 | #include <linux/hdreg.h> |
@@ -553,7 +552,6 @@ typedef struct ide_drive_s { | |||
553 | struct hd_driveid *id; /* drive model identification info */ | 552 | struct hd_driveid *id; /* drive model identification info */ |
554 | struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ | 553 | struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ |
555 | struct ide_settings_s *settings;/* /proc/ide/ drive settings */ | 554 | struct ide_settings_s *settings;/* /proc/ide/ drive settings */ |
556 | char devfs_name[64]; /* devfs crap */ | ||
557 | 555 | ||
558 | struct hwif_s *hwif; /* actually (ide_hwif_t *) */ | 556 | struct hwif_s *hwif; /* actually (ide_hwif_t *) */ |
559 | 557 | ||
@@ -631,6 +629,7 @@ typedef struct ide_drive_s { | |||
631 | unsigned int usage; /* current "open()" count for drive */ | 629 | unsigned int usage; /* current "open()" count for drive */ |
632 | unsigned int failures; /* current failure count */ | 630 | unsigned int failures; /* current failure count */ |
633 | unsigned int max_failures; /* maximum allowed failure count */ | 631 | unsigned int max_failures; /* maximum allowed failure count */ |
632 | u64 probed_capacity;/* initial reported media capacity (ide-cd only currently) */ | ||
634 | 633 | ||
635 | u64 capacity64; /* total number of sectors */ | 634 | u64 capacity64; /* total number of sectors */ |
636 | 635 | ||
@@ -793,6 +792,7 @@ typedef struct hwif_s { | |||
793 | unsigned auto_poll : 1; /* supports nop auto-poll */ | 792 | unsigned auto_poll : 1; /* supports nop auto-poll */ |
794 | unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ | 793 | unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ |
795 | unsigned no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */ | 794 | unsigned no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */ |
795 | unsigned err_stops_fifo : 1; /* 1=data FIFO is cleared by an error */ | ||
796 | 796 | ||
797 | struct device gendev; | 797 | struct device gendev; |
798 | struct completion gendev_rel_comp; /* To deal with device release() */ | 798 | struct completion gendev_rel_comp; /* To deal with device release() */ |
@@ -1006,6 +1006,8 @@ extern ide_hwif_t ide_hwifs[]; /* master data repository */ | |||
1006 | extern int noautodma; | 1006 | extern int noautodma; |
1007 | 1007 | ||
1008 | extern int ide_end_request (ide_drive_t *drive, int uptodate, int nrsecs); | 1008 | extern int ide_end_request (ide_drive_t *drive, int uptodate, int nrsecs); |
1009 | int ide_end_dequeued_request(ide_drive_t *drive, struct request *rq, | ||
1010 | int uptodate, int nr_sectors); | ||
1009 | 1011 | ||
1010 | /* | 1012 | /* |
1011 | * This is used on exit from the driver to designate the next irq handler | 1013 | * This is used on exit from the driver to designate the next irq handler |
diff --git a/include/linux/idr.h b/include/linux/idr.h index d37c8d808b0f..f559a719dbe8 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h | |||
@@ -78,6 +78,7 @@ void *idr_find(struct idr *idp, int id); | |||
78 | int idr_pre_get(struct idr *idp, gfp_t gfp_mask); | 78 | int idr_pre_get(struct idr *idp, gfp_t gfp_mask); |
79 | int idr_get_new(struct idr *idp, void *ptr, int *id); | 79 | int idr_get_new(struct idr *idp, void *ptr, int *id); |
80 | int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id); | 80 | int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id); |
81 | void *idr_replace(struct idr *idp, void *ptr, int id); | ||
81 | void idr_remove(struct idr *idp, int id); | 82 | void idr_remove(struct idr *idp, int id); |
82 | void idr_destroy(struct idr *idp); | 83 | void idr_destroy(struct idr *idp); |
83 | void idr_init(struct idr *idp); | 84 | void idr_init(struct idr *idp); |
diff --git a/include/linux/if_fddi.h b/include/linux/if_fddi.h index 1288a161bc0b..e0a150046208 100644 --- a/include/linux/if_fddi.h +++ b/include/linux/if_fddi.h | |||
@@ -102,6 +102,7 @@ struct fddihdr | |||
102 | } hdr; | 102 | } hdr; |
103 | } __attribute__ ((packed)); | 103 | } __attribute__ ((packed)); |
104 | 104 | ||
105 | #ifdef __KERNEL__ | ||
105 | /* Define FDDI statistics structure */ | 106 | /* Define FDDI statistics structure */ |
106 | struct fddi_statistics { | 107 | struct fddi_statistics { |
107 | 108 | ||
@@ -193,5 +194,6 @@ struct fddi_statistics { | |||
193 | __u32 port_ler_flag[2]; | 194 | __u32 port_ler_flag[2]; |
194 | __u32 port_hardware_present[2]; | 195 | __u32 port_hardware_present[2]; |
195 | }; | 196 | }; |
197 | #endif /* __KERNEL__ */ | ||
196 | 198 | ||
197 | #endif /* _LINUX_IF_FDDI_H */ | 199 | #endif /* _LINUX_IF_FDDI_H */ |
diff --git a/include/linux/if_frad.h b/include/linux/if_frad.h index 395f0aad9cbf..f272a80caa3e 100644 --- a/include/linux/if_frad.h +++ b/include/linux/if_frad.h | |||
@@ -24,7 +24,6 @@ | |||
24 | #ifndef _FRAD_H_ | 24 | #ifndef _FRAD_H_ |
25 | #define _FRAD_H_ | 25 | #define _FRAD_H_ |
26 | 26 | ||
27 | #include <linux/config.h> | ||
28 | #include <linux/if.h> | 27 | #include <linux/if.h> |
29 | 28 | ||
30 | #if defined(CONFIG_DLCI) || defined(CONFIG_DLCI_MODULE) | 29 | #if defined(CONFIG_DLCI) || defined(CONFIG_DLCI_MODULE) |
diff --git a/include/linux/if_tr.h b/include/linux/if_tr.h index 5502f597cf0e..2f94cf2c7abb 100644 --- a/include/linux/if_tr.h +++ b/include/linux/if_tr.h | |||
@@ -43,7 +43,6 @@ struct trh_hdr { | |||
43 | }; | 43 | }; |
44 | 44 | ||
45 | #ifdef __KERNEL__ | 45 | #ifdef __KERNEL__ |
46 | #include <linux/config.h> | ||
47 | #include <linux/skbuff.h> | 46 | #include <linux/skbuff.h> |
48 | 47 | ||
49 | static inline struct trh_hdr *tr_hdr(const struct sk_buff *skb) | 48 | static inline struct trh_hdr *tr_hdr(const struct sk_buff *skb) |
diff --git a/include/linux/init.h b/include/linux/init.h index 93dcbe1abb4c..6667785dd1ff 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _LINUX_INIT_H | 1 | #ifndef _LINUX_INIT_H |
2 | #define _LINUX_INIT_H | 2 | #define _LINUX_INIT_H |
3 | 3 | ||
4 | #include <linux/config.h> | ||
5 | #include <linux/compiler.h> | 4 | #include <linux/compiler.h> |
6 | 5 | ||
7 | /* These macros are used to mark some functions or | 6 | /* These macros are used to mark some functions or |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 41ecbb847f32..3a256957fb56 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -87,6 +87,7 @@ extern struct group_info init_groups; | |||
87 | .lock_depth = -1, \ | 87 | .lock_depth = -1, \ |
88 | .prio = MAX_PRIO-20, \ | 88 | .prio = MAX_PRIO-20, \ |
89 | .static_prio = MAX_PRIO-20, \ | 89 | .static_prio = MAX_PRIO-20, \ |
90 | .normal_prio = MAX_PRIO-20, \ | ||
90 | .policy = SCHED_NORMAL, \ | 91 | .policy = SCHED_NORMAL, \ |
91 | .cpus_allowed = CPU_MASK_ALL, \ | 92 | .cpus_allowed = CPU_MASK_ALL, \ |
92 | .mm = NULL, \ | 93 | .mm = NULL, \ |
@@ -119,10 +120,11 @@ extern struct group_info init_groups; | |||
119 | .signal = {{0}}}, \ | 120 | .signal = {{0}}}, \ |
120 | .blocked = {{0}}, \ | 121 | .blocked = {{0}}, \ |
121 | .alloc_lock = SPIN_LOCK_UNLOCKED, \ | 122 | .alloc_lock = SPIN_LOCK_UNLOCKED, \ |
122 | .proc_lock = SPIN_LOCK_UNLOCKED, \ | ||
123 | .journal_info = NULL, \ | 123 | .journal_info = NULL, \ |
124 | .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ | 124 | .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ |
125 | .fs_excl = ATOMIC_INIT(0), \ | 125 | .fs_excl = ATOMIC_INIT(0), \ |
126 | .pi_lock = SPIN_LOCK_UNLOCKED, \ | ||
127 | INIT_RT_MUTEXES(tsk) \ | ||
126 | } | 128 | } |
127 | 129 | ||
128 | 130 | ||
diff --git a/include/linux/inotify.h b/include/linux/inotify.h index 09e00433c78e..d4f48c6402e6 100644 --- a/include/linux/inotify.h +++ b/include/linux/inotify.h | |||
@@ -67,20 +67,66 @@ struct inotify_event { | |||
67 | 67 | ||
68 | #include <linux/dcache.h> | 68 | #include <linux/dcache.h> |
69 | #include <linux/fs.h> | 69 | #include <linux/fs.h> |
70 | #include <linux/config.h> | 70 | |
71 | /* | ||
72 | * struct inotify_watch - represents a watch request on a specific inode | ||
73 | * | ||
74 | * h_list is protected by ih->mutex of the associated inotify_handle. | ||
75 | * i_list, mask are protected by inode->inotify_mutex of the associated inode. | ||
76 | * ih, inode, and wd are never written to once the watch is created. | ||
77 | * | ||
78 | * Callers must use the established inotify interfaces to access inotify_watch | ||
79 | * contents. The content of this structure is private to the inotify | ||
80 | * implementation. | ||
81 | */ | ||
82 | struct inotify_watch { | ||
83 | struct list_head h_list; /* entry in inotify_handle's list */ | ||
84 | struct list_head i_list; /* entry in inode's list */ | ||
85 | atomic_t count; /* reference count */ | ||
86 | struct inotify_handle *ih; /* associated inotify handle */ | ||
87 | struct inode *inode; /* associated inode */ | ||
88 | __s32 wd; /* watch descriptor */ | ||
89 | __u32 mask; /* event mask for this watch */ | ||
90 | }; | ||
91 | |||
92 | struct inotify_operations { | ||
93 | void (*handle_event)(struct inotify_watch *, u32, u32, u32, | ||
94 | const char *, struct inode *); | ||
95 | void (*destroy_watch)(struct inotify_watch *); | ||
96 | }; | ||
71 | 97 | ||
72 | #ifdef CONFIG_INOTIFY | 98 | #ifdef CONFIG_INOTIFY |
73 | 99 | ||
100 | /* Kernel API for producing events */ | ||
101 | |||
74 | extern void inotify_d_instantiate(struct dentry *, struct inode *); | 102 | extern void inotify_d_instantiate(struct dentry *, struct inode *); |
75 | extern void inotify_d_move(struct dentry *); | 103 | extern void inotify_d_move(struct dentry *); |
76 | extern void inotify_inode_queue_event(struct inode *, __u32, __u32, | 104 | extern void inotify_inode_queue_event(struct inode *, __u32, __u32, |
77 | const char *); | 105 | const char *, struct inode *); |
78 | extern void inotify_dentry_parent_queue_event(struct dentry *, __u32, __u32, | 106 | extern void inotify_dentry_parent_queue_event(struct dentry *, __u32, __u32, |
79 | const char *); | 107 | const char *); |
80 | extern void inotify_unmount_inodes(struct list_head *); | 108 | extern void inotify_unmount_inodes(struct list_head *); |
81 | extern void inotify_inode_is_dead(struct inode *); | 109 | extern void inotify_inode_is_dead(struct inode *); |
82 | extern u32 inotify_get_cookie(void); | 110 | extern u32 inotify_get_cookie(void); |
83 | 111 | ||
112 | /* Kernel Consumer API */ | ||
113 | |||
114 | extern struct inotify_handle *inotify_init(const struct inotify_operations *); | ||
115 | extern void inotify_init_watch(struct inotify_watch *); | ||
116 | extern void inotify_destroy(struct inotify_handle *); | ||
117 | extern __s32 inotify_find_watch(struct inotify_handle *, struct inode *, | ||
118 | struct inotify_watch **); | ||
119 | extern __s32 inotify_find_update_watch(struct inotify_handle *, struct inode *, | ||
120 | u32); | ||
121 | extern __s32 inotify_add_watch(struct inotify_handle *, struct inotify_watch *, | ||
122 | struct inode *, __u32); | ||
123 | extern int inotify_rm_watch(struct inotify_handle *, struct inotify_watch *); | ||
124 | extern int inotify_rm_wd(struct inotify_handle *, __u32); | ||
125 | extern void inotify_remove_watch_locked(struct inotify_handle *, | ||
126 | struct inotify_watch *); | ||
127 | extern void get_inotify_watch(struct inotify_watch *); | ||
128 | extern void put_inotify_watch(struct inotify_watch *); | ||
129 | |||
84 | #else | 130 | #else |
85 | 131 | ||
86 | static inline void inotify_d_instantiate(struct dentry *dentry, | 132 | static inline void inotify_d_instantiate(struct dentry *dentry, |
@@ -94,7 +140,8 @@ static inline void inotify_d_move(struct dentry *dentry) | |||
94 | 140 | ||
95 | static inline void inotify_inode_queue_event(struct inode *inode, | 141 | static inline void inotify_inode_queue_event(struct inode *inode, |
96 | __u32 mask, __u32 cookie, | 142 | __u32 mask, __u32 cookie, |
97 | const char *filename) | 143 | const char *filename, |
144 | struct inode *n_inode) | ||
98 | { | 145 | { |
99 | } | 146 | } |
100 | 147 | ||
@@ -117,6 +164,62 @@ static inline u32 inotify_get_cookie(void) | |||
117 | return 0; | 164 | return 0; |
118 | } | 165 | } |
119 | 166 | ||
167 | static inline struct inotify_handle *inotify_init(const struct inotify_operations *ops) | ||
168 | { | ||
169 | return ERR_PTR(-EOPNOTSUPP); | ||
170 | } | ||
171 | |||
172 | static inline void inotify_init_watch(struct inotify_watch *watch) | ||
173 | { | ||
174 | } | ||
175 | |||
176 | static inline void inotify_destroy(struct inotify_handle *ih) | ||
177 | { | ||
178 | } | ||
179 | |||
180 | static inline __s32 inotify_find_watch(struct inotify_handle *ih, struct inode *inode, | ||
181 | struct inotify_watch **watchp) | ||
182 | { | ||
183 | return -EOPNOTSUPP; | ||
184 | } | ||
185 | |||
186 | static inline __s32 inotify_find_update_watch(struct inotify_handle *ih, | ||
187 | struct inode *inode, u32 mask) | ||
188 | { | ||
189 | return -EOPNOTSUPP; | ||
190 | } | ||
191 | |||
192 | static inline __s32 inotify_add_watch(struct inotify_handle *ih, | ||
193 | struct inotify_watch *watch, | ||
194 | struct inode *inode, __u32 mask) | ||
195 | { | ||
196 | return -EOPNOTSUPP; | ||
197 | } | ||
198 | |||
199 | static inline int inotify_rm_watch(struct inotify_handle *ih, | ||
200 | struct inotify_watch *watch) | ||
201 | { | ||
202 | return -EOPNOTSUPP; | ||
203 | } | ||
204 | |||
205 | static inline int inotify_rm_wd(struct inotify_handle *ih, __u32 wd) | ||
206 | { | ||
207 | return -EOPNOTSUPP; | ||
208 | } | ||
209 | |||
210 | static inline void inotify_remove_watch_locked(struct inotify_handle *ih, | ||
211 | struct inotify_watch *watch) | ||
212 | { | ||
213 | } | ||
214 | |||
215 | static inline void get_inotify_watch(struct inotify_watch *watch) | ||
216 | { | ||
217 | } | ||
218 | |||
219 | static inline void put_inotify_watch(struct inotify_watch *watch) | ||
220 | { | ||
221 | } | ||
222 | |||
120 | #endif /* CONFIG_INOTIFY */ | 223 | #endif /* CONFIG_INOTIFY */ |
121 | 224 | ||
122 | #endif /* __KERNEL __ */ | 225 | #endif /* __KERNEL __ */ |
diff --git a/include/linux/input.h b/include/linux/input.h index ce1a756c4c30..56f1e0e1e598 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #else | 15 | #else |
16 | #include <sys/time.h> | 16 | #include <sys/time.h> |
17 | #include <sys/ioctl.h> | 17 | #include <sys/ioctl.h> |
18 | #include <sys/types.h> | ||
18 | #include <asm/types.h> | 19 | #include <asm/types.h> |
19 | #endif | 20 | #endif |
20 | 21 | ||
@@ -231,7 +232,8 @@ struct input_absinfo { | |||
231 | #define KEY_PAUSE 119 | 232 | #define KEY_PAUSE 119 |
232 | 233 | ||
233 | #define KEY_KPCOMMA 121 | 234 | #define KEY_KPCOMMA 121 |
234 | #define KEY_HANGUEL 122 | 235 | #define KEY_HANGEUL 122 |
236 | #define KEY_HANGUEL KEY_HANGEUL | ||
235 | #define KEY_HANJA 123 | 237 | #define KEY_HANJA 123 |
236 | #define KEY_YEN 124 | 238 | #define KEY_YEN 124 |
237 | #define KEY_LEFTMETA 125 | 239 | #define KEY_LEFTMETA 125 |
@@ -1004,6 +1006,7 @@ static inline void init_input_dev(struct input_dev *dev) | |||
1004 | } | 1006 | } |
1005 | 1007 | ||
1006 | struct input_dev *input_allocate_device(void); | 1008 | struct input_dev *input_allocate_device(void); |
1009 | void input_free_device(struct input_dev *dev); | ||
1007 | 1010 | ||
1008 | static inline struct input_dev *input_get_device(struct input_dev *dev) | 1011 | static inline struct input_dev *input_get_device(struct input_dev *dev) |
1009 | { | 1012 | { |
@@ -1015,12 +1018,6 @@ static inline void input_put_device(struct input_dev *dev) | |||
1015 | class_device_put(&dev->cdev); | 1018 | class_device_put(&dev->cdev); |
1016 | } | 1019 | } |
1017 | 1020 | ||
1018 | static inline void input_free_device(struct input_dev *dev) | ||
1019 | { | ||
1020 | if (dev) | ||
1021 | input_put_device(dev); | ||
1022 | } | ||
1023 | |||
1024 | int input_register_device(struct input_dev *); | 1021 | int input_register_device(struct input_dev *); |
1025 | void input_unregister_device(struct input_dev *); | 1022 | void input_unregister_device(struct input_dev *); |
1026 | 1023 | ||
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 2c08fdc2bdf7..da3e0dbe61d4 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -2,12 +2,12 @@ | |||
2 | #ifndef _LINUX_INTERRUPT_H | 2 | #ifndef _LINUX_INTERRUPT_H |
3 | #define _LINUX_INTERRUPT_H | 3 | #define _LINUX_INTERRUPT_H |
4 | 4 | ||
5 | #include <linux/config.h> | ||
6 | #include <linux/kernel.h> | 5 | #include <linux/kernel.h> |
7 | #include <linux/linkage.h> | 6 | #include <linux/linkage.h> |
8 | #include <linux/bitops.h> | 7 | #include <linux/bitops.h> |
9 | #include <linux/preempt.h> | 8 | #include <linux/preempt.h> |
10 | #include <linux/cpumask.h> | 9 | #include <linux/cpumask.h> |
10 | #include <linux/irqreturn.h> | ||
11 | #include <linux/hardirq.h> | 11 | #include <linux/hardirq.h> |
12 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
13 | #include <asm/atomic.h> | 13 | #include <asm/atomic.h> |
@@ -15,24 +15,53 @@ | |||
15 | #include <asm/system.h> | 15 | #include <asm/system.h> |
16 | 16 | ||
17 | /* | 17 | /* |
18 | * For 2.4.x compatibility, 2.4.x can use | 18 | * These correspond to the IORESOURCE_IRQ_* defines in |
19 | * | 19 | * linux/ioport.h to select the interrupt line behaviour. When |
20 | * typedef void irqreturn_t; | 20 | * requesting an interrupt without specifying a IRQF_TRIGGER, the |
21 | * #define IRQ_NONE | 21 | * setting should be assumed to be "as already configured", which |
22 | * #define IRQ_HANDLED | 22 | * may be as per machine or firmware initialisation. |
23 | * #define IRQ_RETVAL(x) | 23 | */ |
24 | * | 24 | #define IRQF_TRIGGER_NONE 0x00000000 |
25 | * To mix old-style and new-style irq handler returns. | 25 | #define IRQF_TRIGGER_RISING 0x00000001 |
26 | #define IRQF_TRIGGER_FALLING 0x00000002 | ||
27 | #define IRQF_TRIGGER_HIGH 0x00000004 | ||
28 | #define IRQF_TRIGGER_LOW 0x00000008 | ||
29 | #define IRQF_TRIGGER_MASK (IRQF_TRIGGER_HIGH | IRQF_TRIGGER_LOW | \ | ||
30 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING) | ||
31 | #define IRQF_TRIGGER_PROBE 0x00000010 | ||
32 | |||
33 | /* | ||
34 | * These flags used only by the kernel as part of the | ||
35 | * irq handling routines. | ||
26 | * | 36 | * |
27 | * IRQ_NONE means we didn't handle it. | 37 | * IRQF_DISABLED - keep irqs disabled when calling the action handler |
28 | * IRQ_HANDLED means that we did have a valid interrupt and handled it. | 38 | * IRQF_SAMPLE_RANDOM - irq is used to feed the random generator |
29 | * IRQ_RETVAL(x) selects on the two depending on x being non-zero (for handled) | 39 | * IRQF_SHARED - allow sharing the irq among several devices |
40 | * IRQF_PROBE_SHARED - set by callers when they expect sharing mismatches to occur | ||
41 | * IRQF_TIMER - Flag to mark this interrupt as timer interrupt | ||
30 | */ | 42 | */ |
31 | typedef int irqreturn_t; | 43 | #define IRQF_DISABLED 0x00000020 |
44 | #define IRQF_SAMPLE_RANDOM 0x00000040 | ||
45 | #define IRQF_SHARED 0x00000080 | ||
46 | #define IRQF_PROBE_SHARED 0x00000100 | ||
47 | #define IRQF_TIMER 0x00000200 | ||
48 | #define IRQF_PERCPU 0x00000400 | ||
32 | 49 | ||
33 | #define IRQ_NONE (0) | 50 | /* |
34 | #define IRQ_HANDLED (1) | 51 | * Migration helpers. Scheduled for removal in 1/2007 |
35 | #define IRQ_RETVAL(x) ((x) != 0) | 52 | * Do not use for new code ! |
53 | */ | ||
54 | #define SA_INTERRUPT IRQF_DISABLED | ||
55 | #define SA_SAMPLE_RANDOM IRQF_SAMPLE_RANDOM | ||
56 | #define SA_SHIRQ IRQF_SHARED | ||
57 | #define SA_PROBEIRQ IRQF_PROBE_SHARED | ||
58 | #define SA_PERCPU IRQF_PERCPU | ||
59 | |||
60 | #define SA_TRIGGER_LOW IRQF_TRIGGER_LOW | ||
61 | #define SA_TRIGGER_HIGH IRQF_TRIGGER_HIGH | ||
62 | #define SA_TRIGGER_FALLING IRQF_TRIGGER_FALLING | ||
63 | #define SA_TRIGGER_RISING IRQF_TRIGGER_RISING | ||
64 | #define SA_TRIGGER_MASK IRQF_TRIGGER_MASK | ||
36 | 65 | ||
37 | struct irqaction { | 66 | struct irqaction { |
38 | irqreturn_t (*handler)(int, void *, struct pt_regs *); | 67 | irqreturn_t (*handler)(int, void *, struct pt_regs *); |
@@ -56,6 +85,20 @@ extern void free_irq(unsigned int, void *); | |||
56 | extern void disable_irq_nosync(unsigned int irq); | 85 | extern void disable_irq_nosync(unsigned int irq); |
57 | extern void disable_irq(unsigned int irq); | 86 | extern void disable_irq(unsigned int irq); |
58 | extern void enable_irq(unsigned int irq); | 87 | extern void enable_irq(unsigned int irq); |
88 | |||
89 | /* IRQ wakeup (PM) control: */ | ||
90 | extern int set_irq_wake(unsigned int irq, unsigned int on); | ||
91 | |||
92 | static inline int enable_irq_wake(unsigned int irq) | ||
93 | { | ||
94 | return set_irq_wake(irq, 1); | ||
95 | } | ||
96 | |||
97 | static inline int disable_irq_wake(unsigned int irq) | ||
98 | { | ||
99 | return set_irq_wake(irq, 0); | ||
100 | } | ||
101 | |||
59 | #endif | 102 | #endif |
60 | 103 | ||
61 | #ifndef __ARCH_SET_SOFTIRQ_PENDING | 104 | #ifndef __ARCH_SET_SOFTIRQ_PENDING |
diff --git a/include/linux/io.h b/include/linux/io.h index 85533ec5aaa1..420e2fdf26f6 100644 --- a/include/linux/io.h +++ b/include/linux/io.h | |||
@@ -21,5 +21,6 @@ | |||
21 | #include <asm/io.h> | 21 | #include <asm/io.h> |
22 | 22 | ||
23 | void __iowrite32_copy(void __iomem *to, const void *from, size_t count); | 23 | void __iowrite32_copy(void __iomem *to, const void *from, size_t count); |
24 | void __iowrite64_copy(void __iomem *to, const void *from, size_t count); | ||
24 | 25 | ||
25 | #endif /* _LINUX_IO_H */ | 26 | #endif /* _LINUX_IO_H */ |
diff --git a/include/linux/ioc4.h b/include/linux/ioc4.h index 3dd18b785ebd..de73a3289cc2 100644 --- a/include/linux/ioc4.h +++ b/include/linux/ioc4.h | |||
@@ -147,6 +147,10 @@ struct ioc4_misc_regs { | |||
147 | #define IOC4_GPCR_EDGE_6 0x40 | 147 | #define IOC4_GPCR_EDGE_6 0x40 |
148 | #define IOC4_GPCR_EDGE_7 0x80 | 148 | #define IOC4_GPCR_EDGE_7 0x80 |
149 | 149 | ||
150 | #define IOC4_VARIANT_IO9 0x0900 | ||
151 | #define IOC4_VARIANT_PCI_RT 0x0901 | ||
152 | #define IOC4_VARIANT_IO10 0x1000 | ||
153 | |||
150 | /* One of these per IOC4 */ | 154 | /* One of these per IOC4 */ |
151 | struct ioc4_driver_data { | 155 | struct ioc4_driver_data { |
152 | struct list_head idd_list; | 156 | struct list_head idd_list; |
@@ -156,6 +160,7 @@ struct ioc4_driver_data { | |||
156 | struct __iomem ioc4_misc_regs *idd_misc_regs; | 160 | struct __iomem ioc4_misc_regs *idd_misc_regs; |
157 | unsigned long count_period; | 161 | unsigned long count_period; |
158 | void *idd_serial_data; | 162 | void *idd_serial_data; |
163 | unsigned int idd_variant; | ||
159 | }; | 164 | }; |
160 | 165 | ||
161 | /* One per submodule */ | 166 | /* One per submodule */ |
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index cd6bd001ba4e..87a9fc039b47 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -9,13 +9,15 @@ | |||
9 | #define _LINUX_IOPORT_H | 9 | #define _LINUX_IOPORT_H |
10 | 10 | ||
11 | #include <linux/compiler.h> | 11 | #include <linux/compiler.h> |
12 | #include <linux/types.h> | ||
12 | /* | 13 | /* |
13 | * Resources are tree-like, allowing | 14 | * Resources are tree-like, allowing |
14 | * nesting etc.. | 15 | * nesting etc.. |
15 | */ | 16 | */ |
16 | struct resource { | 17 | struct resource { |
18 | resource_size_t start; | ||
19 | resource_size_t end; | ||
17 | const char *name; | 20 | const char *name; |
18 | unsigned long start, end; | ||
19 | unsigned long flags; | 21 | unsigned long flags; |
20 | struct resource *parent, *sibling, *child; | 22 | struct resource *parent, *sibling, *child; |
21 | }; | 23 | }; |
@@ -96,31 +98,37 @@ extern struct resource * ____request_resource(struct resource *root, struct reso | |||
96 | extern int release_resource(struct resource *new); | 98 | extern int release_resource(struct resource *new); |
97 | extern __deprecated_for_modules int insert_resource(struct resource *parent, struct resource *new); | 99 | extern __deprecated_for_modules int insert_resource(struct resource *parent, struct resource *new); |
98 | extern int allocate_resource(struct resource *root, struct resource *new, | 100 | extern int allocate_resource(struct resource *root, struct resource *new, |
99 | unsigned long size, | 101 | resource_size_t size, resource_size_t min, |
100 | unsigned long min, unsigned long max, | 102 | resource_size_t max, resource_size_t align, |
101 | unsigned long align, | ||
102 | void (*alignf)(void *, struct resource *, | 103 | void (*alignf)(void *, struct resource *, |
103 | unsigned long, unsigned long), | 104 | resource_size_t, resource_size_t), |
104 | void *alignf_data); | 105 | void *alignf_data); |
105 | int adjust_resource(struct resource *res, unsigned long start, | 106 | int adjust_resource(struct resource *res, resource_size_t start, |
106 | unsigned long size); | 107 | resource_size_t size); |
108 | |||
109 | /* get registered SYSTEM_RAM resources in specified area */ | ||
110 | extern int find_next_system_ram(struct resource *res); | ||
107 | 111 | ||
108 | /* Convenience shorthand with allocation */ | 112 | /* Convenience shorthand with allocation */ |
109 | #define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name)) | 113 | #define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name)) |
110 | #define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name)) | 114 | #define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name)) |
111 | #define rename_region(region, newname) do { (region)->name = (newname); } while (0) | 115 | #define rename_region(region, newname) do { (region)->name = (newname); } while (0) |
112 | 116 | ||
113 | extern struct resource * __request_region(struct resource *, unsigned long start, unsigned long n, const char *name); | 117 | extern struct resource * __request_region(struct resource *, |
118 | resource_size_t start, | ||
119 | resource_size_t n, const char *name); | ||
114 | 120 | ||
115 | /* Compatibility cruft */ | 121 | /* Compatibility cruft */ |
116 | #define release_region(start,n) __release_region(&ioport_resource, (start), (n)) | 122 | #define release_region(start,n) __release_region(&ioport_resource, (start), (n)) |
117 | #define check_mem_region(start,n) __check_region(&iomem_resource, (start), (n)) | 123 | #define check_mem_region(start,n) __check_region(&iomem_resource, (start), (n)) |
118 | #define release_mem_region(start,n) __release_region(&iomem_resource, (start), (n)) | 124 | #define release_mem_region(start,n) __release_region(&iomem_resource, (start), (n)) |
119 | 125 | ||
120 | extern int __check_region(struct resource *, unsigned long, unsigned long); | 126 | extern int __check_region(struct resource *, resource_size_t, resource_size_t); |
121 | extern void __release_region(struct resource *, unsigned long, unsigned long); | 127 | extern void __release_region(struct resource *, resource_size_t, |
128 | resource_size_t); | ||
122 | 129 | ||
123 | static inline int __deprecated check_region(unsigned long s, unsigned long n) | 130 | static inline int __deprecated check_region(resource_size_t s, |
131 | resource_size_t n) | ||
124 | { | 132 | { |
125 | return __check_region(&ioport_resource, s, n); | 133 | return __check_region(&ioport_resource, s, n); |
126 | } | 134 | } |
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h index 0a84b56935c2..d09fbeabf1dc 100644 --- a/include/linux/ipmi.h +++ b/include/linux/ipmi.h | |||
@@ -36,7 +36,6 @@ | |||
36 | 36 | ||
37 | #include <linux/ipmi_msgdefs.h> | 37 | #include <linux/ipmi_msgdefs.h> |
38 | #include <linux/compiler.h> | 38 | #include <linux/compiler.h> |
39 | #include <linux/device.h> | ||
40 | 39 | ||
41 | /* | 40 | /* |
42 | * This file describes an interface to an IPMI driver. You have to | 41 | * This file describes an interface to an IPMI driver. You have to |
@@ -210,11 +209,8 @@ struct kernel_ipmi_msg | |||
210 | */ | 209 | */ |
211 | #include <linux/list.h> | 210 | #include <linux/list.h> |
212 | #include <linux/module.h> | 211 | #include <linux/module.h> |
213 | 212 | #include <linux/device.h> | |
214 | #ifdef CONFIG_PROC_FS | ||
215 | #include <linux/proc_fs.h> | 213 | #include <linux/proc_fs.h> |
216 | extern struct proc_dir_entry *proc_ipmi_root; | ||
217 | #endif /* CONFIG_PROC_FS */ | ||
218 | 214 | ||
219 | /* Opaque type for a IPMI message user. One of these is needed to | 215 | /* Opaque type for a IPMI message user. One of these is needed to |
220 | send and receive messages. */ | 216 | send and receive messages. */ |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 1263d8cb3c18..297853c841b4 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _IPV6_H | 1 | #ifndef _IPV6_H |
2 | #define _IPV6_H | 2 | #define _IPV6_H |
3 | 3 | ||
4 | #include <linux/config.h> | ||
5 | #include <linux/in6.h> | 4 | #include <linux/in6.h> |
6 | #include <asm/byteorder.h> | 5 | #include <asm/byteorder.h> |
7 | 6 | ||
diff --git a/include/linux/irq.h b/include/linux/irq.h index ee2a82a572f7..b48eae32dc61 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef __irq_h | 1 | #ifndef _LINUX_IRQ_H |
2 | #define __irq_h | 2 | #define _LINUX_IRQ_H |
3 | 3 | ||
4 | /* | 4 | /* |
5 | * Please do not include this file in generic code. There is currently | 5 | * Please do not include this file in generic code. There is currently |
@@ -9,99 +9,187 @@ | |||
9 | * Thanks. --rmk | 9 | * Thanks. --rmk |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/config.h> | ||
13 | #include <linux/smp.h> | 12 | #include <linux/smp.h> |
14 | 13 | ||
15 | #if !defined(CONFIG_S390) | 14 | #ifndef CONFIG_S390 |
16 | 15 | ||
17 | #include <linux/linkage.h> | 16 | #include <linux/linkage.h> |
18 | #include <linux/cache.h> | 17 | #include <linux/cache.h> |
19 | #include <linux/spinlock.h> | 18 | #include <linux/spinlock.h> |
20 | #include <linux/cpumask.h> | 19 | #include <linux/cpumask.h> |
20 | #include <linux/irqreturn.h> | ||
21 | 21 | ||
22 | #include <asm/irq.h> | 22 | #include <asm/irq.h> |
23 | #include <asm/ptrace.h> | 23 | #include <asm/ptrace.h> |
24 | 24 | ||
25 | /* | 25 | /* |
26 | * IRQ line status. | 26 | * IRQ line status. |
27 | * | ||
28 | * Bits 0-16 are reserved for the IRQF_* bits in linux/interrupt.h | ||
29 | * | ||
30 | * IRQ types | ||
27 | */ | 31 | */ |
28 | #define IRQ_INPROGRESS 1 /* IRQ handler active - do not enter! */ | 32 | #define IRQ_TYPE_NONE 0x00000000 /* Default, unspecified type */ |
29 | #define IRQ_DISABLED 2 /* IRQ disabled - do not enter! */ | 33 | #define IRQ_TYPE_EDGE_RISING 0x00000001 /* Edge rising type */ |
30 | #define IRQ_PENDING 4 /* IRQ pending - replay on enable */ | 34 | #define IRQ_TYPE_EDGE_FALLING 0x00000002 /* Edge falling type */ |
31 | #define IRQ_REPLAY 8 /* IRQ has been replayed but not acked yet */ | 35 | #define IRQ_TYPE_EDGE_BOTH (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING) |
32 | #define IRQ_AUTODETECT 16 /* IRQ is being autodetected */ | 36 | #define IRQ_TYPE_LEVEL_HIGH 0x00000004 /* Level high type */ |
33 | #define IRQ_WAITING 32 /* IRQ not yet seen - for autodetection */ | 37 | #define IRQ_TYPE_LEVEL_LOW 0x00000008 /* Level low type */ |
34 | #define IRQ_LEVEL 64 /* IRQ level triggered */ | 38 | #define IRQ_TYPE_SENSE_MASK 0x0000000f /* Mask of the above */ |
35 | #define IRQ_MASKED 128 /* IRQ masked - shouldn't be seen again */ | 39 | #define IRQ_TYPE_PROBE 0x00000010 /* Probing in progress */ |
36 | #if defined(ARCH_HAS_IRQ_PER_CPU) | 40 | |
37 | # define IRQ_PER_CPU 256 /* IRQ is per CPU */ | 41 | /* Internal flags */ |
42 | #define IRQ_INPROGRESS 0x00010000 /* IRQ handler active - do not enter! */ | ||
43 | #define IRQ_DISABLED 0x00020000 /* IRQ disabled - do not enter! */ | ||
44 | #define IRQ_PENDING 0x00040000 /* IRQ pending - replay on enable */ | ||
45 | #define IRQ_REPLAY 0x00080000 /* IRQ has been replayed but not acked yet */ | ||
46 | #define IRQ_AUTODETECT 0x00100000 /* IRQ is being autodetected */ | ||
47 | #define IRQ_WAITING 0x00200000 /* IRQ not yet seen - for autodetection */ | ||
48 | #define IRQ_LEVEL 0x00400000 /* IRQ level triggered */ | ||
49 | #define IRQ_MASKED 0x00800000 /* IRQ masked - shouldn't be seen again */ | ||
50 | #ifdef CONFIG_IRQ_PER_CPU | ||
51 | # define IRQ_PER_CPU 0x01000000 /* IRQ is per CPU */ | ||
38 | # define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) | 52 | # define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) |
39 | #else | 53 | #else |
40 | # define CHECK_IRQ_PER_CPU(var) 0 | 54 | # define CHECK_IRQ_PER_CPU(var) 0 |
41 | #endif | 55 | #endif |
42 | 56 | ||
43 | /* | 57 | #define IRQ_NOPROBE 0x02000000 /* IRQ is not valid for probing */ |
44 | * Interrupt controller descriptor. This is all we need | 58 | #define IRQ_NOREQUEST 0x04000000 /* IRQ cannot be requested */ |
45 | * to describe about the low-level hardware. | 59 | #define IRQ_NOAUTOEN 0x08000000 /* IRQ will not be enabled on request irq */ |
60 | #define IRQ_DELAYED_DISABLE 0x10000000 /* IRQ disable (masking) happens delayed. */ | ||
61 | |||
62 | struct proc_dir_entry; | ||
63 | |||
64 | /** | ||
65 | * struct irq_chip - hardware interrupt chip descriptor | ||
66 | * | ||
67 | * @name: name for /proc/interrupts | ||
68 | * @startup: start up the interrupt (defaults to ->enable if NULL) | ||
69 | * @shutdown: shut down the interrupt (defaults to ->disable if NULL) | ||
70 | * @enable: enable the interrupt (defaults to chip->unmask if NULL) | ||
71 | * @disable: disable the interrupt (defaults to chip->mask if NULL) | ||
72 | * @ack: start of a new interrupt | ||
73 | * @mask: mask an interrupt source | ||
74 | * @mask_ack: ack and mask an interrupt source | ||
75 | * @unmask: unmask an interrupt source | ||
76 | * @eoi: end of interrupt - chip level | ||
77 | * @end: end of interrupt - flow level | ||
78 | * @set_affinity: set the CPU affinity on SMP machines | ||
79 | * @retrigger: resend an IRQ to the CPU | ||
80 | * @set_type: set the flow type (IRQ_TYPE_LEVEL/etc.) of an IRQ | ||
81 | * @set_wake: enable/disable power-management wake-on of an IRQ | ||
82 | * | ||
83 | * @release: release function solely used by UML | ||
84 | * @typename: obsoleted by name, kept as migration helper | ||
46 | */ | 85 | */ |
47 | struct hw_interrupt_type { | 86 | struct irq_chip { |
48 | const char * typename; | 87 | const char *name; |
49 | unsigned int (*startup)(unsigned int irq); | 88 | unsigned int (*startup)(unsigned int irq); |
50 | void (*shutdown)(unsigned int irq); | 89 | void (*shutdown)(unsigned int irq); |
51 | void (*enable)(unsigned int irq); | 90 | void (*enable)(unsigned int irq); |
52 | void (*disable)(unsigned int irq); | 91 | void (*disable)(unsigned int irq); |
53 | void (*ack)(unsigned int irq); | 92 | |
54 | void (*end)(unsigned int irq); | 93 | void (*ack)(unsigned int irq); |
55 | void (*set_affinity)(unsigned int irq, cpumask_t dest); | 94 | void (*mask)(unsigned int irq); |
95 | void (*mask_ack)(unsigned int irq); | ||
96 | void (*unmask)(unsigned int irq); | ||
97 | void (*eoi)(unsigned int irq); | ||
98 | |||
99 | void (*end)(unsigned int irq); | ||
100 | void (*set_affinity)(unsigned int irq, cpumask_t dest); | ||
101 | int (*retrigger)(unsigned int irq); | ||
102 | int (*set_type)(unsigned int irq, unsigned int flow_type); | ||
103 | int (*set_wake)(unsigned int irq, unsigned int on); | ||
104 | |||
56 | /* Currently used only by UML, might disappear one day.*/ | 105 | /* Currently used only by UML, might disappear one day.*/ |
57 | #ifdef CONFIG_IRQ_RELEASE_METHOD | 106 | #ifdef CONFIG_IRQ_RELEASE_METHOD |
58 | void (*release)(unsigned int irq, void *dev_id); | 107 | void (*release)(unsigned int irq, void *dev_id); |
59 | #endif | 108 | #endif |
109 | /* | ||
110 | * For compatibility, ->typename is copied into ->name. | ||
111 | * Will disappear. | ||
112 | */ | ||
113 | const char *typename; | ||
60 | }; | 114 | }; |
61 | 115 | ||
62 | typedef struct hw_interrupt_type hw_irq_controller; | 116 | /** |
63 | 117 | * struct irq_desc - interrupt descriptor | |
64 | /* | 118 | * |
65 | * This is the "IRQ descriptor", which contains various information | 119 | * @handle_irq: highlevel irq-events handler [if NULL, __do_IRQ()] |
66 | * about the irq, including what kind of hardware handling it has, | 120 | * @chip: low level interrupt hardware access |
67 | * whether it is disabled etc etc. | 121 | * @handler_data: per-IRQ data for the irq_chip methods |
122 | * @chip_data: platform-specific per-chip private data for the chip | ||
123 | * methods, to allow shared chip implementations | ||
124 | * @action: the irq action chain | ||
125 | * @status: status information | ||
126 | * @depth: disable-depth, for nested irq_disable() calls | ||
127 | * @irq_count: stats field to detect stalled irqs | ||
128 | * @irqs_unhandled: stats field for spurious unhandled interrupts | ||
129 | * @lock: locking for SMP | ||
130 | * @affinity: IRQ affinity on SMP | ||
131 | * @cpu: cpu index useful for balancing | ||
132 | * @pending_mask: pending rebalanced interrupts | ||
133 | * @move_irq: need to re-target IRQ destination | ||
134 | * @dir: /proc/irq/ procfs entry | ||
135 | * @affinity_entry: /proc/irq/smp_affinity procfs entry on SMP | ||
68 | * | 136 | * |
69 | * Pad this out to 32 bytes for cache and indexing reasons. | 137 | * Pad this out to 32 bytes for cache and indexing reasons. |
70 | */ | 138 | */ |
71 | typedef struct irq_desc { | 139 | struct irq_desc { |
72 | hw_irq_controller *handler; | 140 | void fastcall (*handle_irq)(unsigned int irq, |
73 | void *handler_data; | 141 | struct irq_desc *desc, |
74 | struct irqaction *action; /* IRQ action list */ | 142 | struct pt_regs *regs); |
75 | unsigned int status; /* IRQ status */ | 143 | struct irq_chip *chip; |
76 | unsigned int depth; /* nested irq disables */ | 144 | void *handler_data; |
77 | unsigned int irq_count; /* For detecting broken interrupts */ | 145 | void *chip_data; |
78 | unsigned int irqs_unhandled; | 146 | struct irqaction *action; /* IRQ action list */ |
79 | spinlock_t lock; | 147 | unsigned int status; /* IRQ status */ |
80 | #if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE) | 148 | |
81 | unsigned int move_irq; /* Flag need to re-target intr dest*/ | 149 | unsigned int depth; /* nested irq disables */ |
150 | unsigned int irq_count; /* For detecting broken IRQs */ | ||
151 | unsigned int irqs_unhandled; | ||
152 | spinlock_t lock; | ||
153 | #ifdef CONFIG_SMP | ||
154 | cpumask_t affinity; | ||
155 | unsigned int cpu; | ||
156 | #endif | ||
157 | #if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE) | ||
158 | cpumask_t pending_mask; | ||
159 | unsigned int move_irq; /* need to re-target IRQ dest */ | ||
160 | #endif | ||
161 | #ifdef CONFIG_PROC_FS | ||
162 | struct proc_dir_entry *dir; | ||
82 | #endif | 163 | #endif |
83 | } ____cacheline_aligned irq_desc_t; | 164 | } ____cacheline_aligned; |
84 | 165 | ||
85 | extern irq_desc_t irq_desc [NR_IRQS]; | 166 | extern struct irq_desc irq_desc[NR_IRQS]; |
86 | 167 | ||
87 | /* Return a pointer to the irq descriptor for IRQ. */ | 168 | /* |
88 | static inline irq_desc_t * | 169 | * Migration helpers for obsolete names, they will go away: |
89 | irq_descp (int irq) | 170 | */ |
90 | { | 171 | #define hw_interrupt_type irq_chip |
91 | return irq_desc + irq; | 172 | typedef struct irq_chip hw_irq_controller; |
92 | } | 173 | #define no_irq_type no_irq_chip |
174 | typedef struct irq_desc irq_desc_t; | ||
93 | 175 | ||
94 | #include <asm/hw_irq.h> /* the arch dependent stuff */ | 176 | /* |
177 | * Pick up the arch-dependent methods: | ||
178 | */ | ||
179 | #include <asm/hw_irq.h> | ||
95 | 180 | ||
96 | extern int setup_irq(unsigned int irq, struct irqaction * new); | 181 | extern int setup_irq(unsigned int irq, struct irqaction *new); |
97 | 182 | ||
98 | #ifdef CONFIG_GENERIC_HARDIRQS | 183 | #ifdef CONFIG_GENERIC_HARDIRQS |
99 | extern cpumask_t irq_affinity[NR_IRQS]; | 184 | |
185 | #ifndef handle_dynamic_tick | ||
186 | # define handle_dynamic_tick(a) do { } while (0) | ||
187 | #endif | ||
100 | 188 | ||
101 | #ifdef CONFIG_SMP | 189 | #ifdef CONFIG_SMP |
102 | static inline void set_native_irq_info(int irq, cpumask_t mask) | 190 | static inline void set_native_irq_info(int irq, cpumask_t mask) |
103 | { | 191 | { |
104 | irq_affinity[irq] = mask; | 192 | irq_desc[irq].affinity = mask; |
105 | } | 193 | } |
106 | #else | 194 | #else |
107 | static inline void set_native_irq_info(int irq, cpumask_t mask) | 195 | static inline void set_native_irq_info(int irq, cpumask_t mask) |
@@ -111,8 +199,7 @@ static inline void set_native_irq_info(int irq, cpumask_t mask) | |||
111 | 199 | ||
112 | #ifdef CONFIG_SMP | 200 | #ifdef CONFIG_SMP |
113 | 201 | ||
114 | #if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE) | 202 | #if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE) |
115 | extern cpumask_t pending_irq_cpumask[NR_IRQS]; | ||
116 | 203 | ||
117 | void set_pending_irq(unsigned int irq, cpumask_t mask); | 204 | void set_pending_irq(unsigned int irq, cpumask_t mask); |
118 | void move_native_irq(int irq); | 205 | void move_native_irq(int irq); |
@@ -133,7 +220,7 @@ static inline void set_irq_info(int irq, cpumask_t mask) | |||
133 | { | 220 | { |
134 | } | 221 | } |
135 | 222 | ||
136 | #else // CONFIG_PCI_MSI | 223 | #else /* CONFIG_PCI_MSI */ |
137 | 224 | ||
138 | static inline void move_irq(int irq) | 225 | static inline void move_irq(int irq) |
139 | { | 226 | { |
@@ -144,53 +231,178 @@ static inline void set_irq_info(int irq, cpumask_t mask) | |||
144 | { | 231 | { |
145 | set_native_irq_info(irq, mask); | 232 | set_native_irq_info(irq, mask); |
146 | } | 233 | } |
147 | #endif // CONFIG_PCI_MSI | ||
148 | 234 | ||
149 | #else // CONFIG_GENERIC_PENDING_IRQ || CONFIG_IRQBALANCE | 235 | #endif /* CONFIG_PCI_MSI */ |
236 | |||
237 | #else /* CONFIG_GENERIC_PENDING_IRQ || CONFIG_IRQBALANCE */ | ||
238 | |||
239 | static inline void move_irq(int irq) | ||
240 | { | ||
241 | } | ||
242 | |||
243 | static inline void move_native_irq(int irq) | ||
244 | { | ||
245 | } | ||
246 | |||
247 | static inline void set_pending_irq(unsigned int irq, cpumask_t mask) | ||
248 | { | ||
249 | } | ||
150 | 250 | ||
151 | #define move_irq(x) | ||
152 | #define move_native_irq(x) | ||
153 | #define set_pending_irq(x,y) | ||
154 | static inline void set_irq_info(int irq, cpumask_t mask) | 251 | static inline void set_irq_info(int irq, cpumask_t mask) |
155 | { | 252 | { |
156 | set_native_irq_info(irq, mask); | 253 | set_native_irq_info(irq, mask); |
157 | } | 254 | } |
158 | 255 | ||
159 | #endif // CONFIG_GENERIC_PENDING_IRQ | 256 | #endif /* CONFIG_GENERIC_PENDING_IRQ */ |
160 | 257 | ||
161 | #else // CONFIG_SMP | 258 | #else /* CONFIG_SMP */ |
162 | 259 | ||
163 | #define move_irq(x) | 260 | #define move_irq(x) |
164 | #define move_native_irq(x) | 261 | #define move_native_irq(x) |
165 | 262 | ||
166 | #endif // CONFIG_SMP | 263 | #endif /* CONFIG_SMP */ |
167 | |||
168 | extern int no_irq_affinity; | ||
169 | extern int noirqdebug_setup(char *str); | ||
170 | 264 | ||
171 | extern fastcall int handle_IRQ_event(unsigned int irq, struct pt_regs *regs, | 265 | #ifdef CONFIG_IRQBALANCE |
172 | struct irqaction *action); | 266 | extern void set_balance_irq_affinity(unsigned int irq, cpumask_t mask); |
173 | extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs); | 267 | #else |
174 | extern void note_interrupt(unsigned int irq, irq_desc_t *desc, | 268 | static inline void set_balance_irq_affinity(unsigned int irq, cpumask_t mask) |
175 | int action_ret, struct pt_regs *regs); | 269 | { |
176 | extern int can_request_irq(unsigned int irq, unsigned long irqflags); | 270 | } |
177 | 271 | #endif | |
178 | extern void init_irq_proc(void); | ||
179 | 272 | ||
180 | #ifdef CONFIG_AUTO_IRQ_AFFINITY | 273 | #ifdef CONFIG_AUTO_IRQ_AFFINITY |
181 | extern int select_smp_affinity(unsigned int irq); | 274 | extern int select_smp_affinity(unsigned int irq); |
182 | #else | 275 | #else |
183 | static inline int | 276 | static inline int select_smp_affinity(unsigned int irq) |
184 | select_smp_affinity(unsigned int irq) | ||
185 | { | 277 | { |
186 | return 1; | 278 | return 1; |
187 | } | 279 | } |
188 | #endif | 280 | #endif |
189 | 281 | ||
190 | #endif | 282 | extern int no_irq_affinity; |
191 | 283 | ||
192 | extern hw_irq_controller no_irq_type; /* needed in every arch ? */ | 284 | /* Handle irq action chains: */ |
285 | extern int handle_IRQ_event(unsigned int irq, struct pt_regs *regs, | ||
286 | struct irqaction *action); | ||
193 | 287 | ||
194 | #endif | 288 | /* |
289 | * Built-in IRQ handlers for various IRQ types, | ||
290 | * callable via desc->chip->handle_irq() | ||
291 | */ | ||
292 | extern void fastcall | ||
293 | handle_level_irq(unsigned int irq, struct irq_desc *desc, struct pt_regs *regs); | ||
294 | extern void fastcall | ||
295 | handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc, | ||
296 | struct pt_regs *regs); | ||
297 | extern void fastcall | ||
298 | handle_edge_irq(unsigned int irq, struct irq_desc *desc, struct pt_regs *regs); | ||
299 | extern void fastcall | ||
300 | handle_simple_irq(unsigned int irq, struct irq_desc *desc, | ||
301 | struct pt_regs *regs); | ||
302 | extern void fastcall | ||
303 | handle_percpu_irq(unsigned int irq, struct irq_desc *desc, | ||
304 | struct pt_regs *regs); | ||
305 | extern void fastcall | ||
306 | handle_bad_irq(unsigned int irq, struct irq_desc *desc, struct pt_regs *regs); | ||
307 | |||
308 | /* | ||
309 | * Get a descriptive string for the highlevel handler, for | ||
310 | * /proc/interrupts output: | ||
311 | */ | ||
312 | extern const char * | ||
313 | handle_irq_name(void fastcall (*handle)(unsigned int, struct irq_desc *, | ||
314 | struct pt_regs *)); | ||
315 | |||
316 | /* | ||
317 | * Monolithic do_IRQ implementation. | ||
318 | * (is an explicit fastcall, because i386 4KSTACKS calls it from assembly) | ||
319 | */ | ||
320 | extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs); | ||
321 | |||
322 | /* | ||
323 | * Architectures call this to let the generic IRQ layer | ||
324 | * handle an interrupt. If the descriptor is attached to an | ||
325 | * irqchip-style controller then we call the ->handle_irq() handler, | ||
326 | * and it calls __do_IRQ() if it's attached to an irqtype-style controller. | ||
327 | */ | ||
328 | static inline void generic_handle_irq(unsigned int irq, struct pt_regs *regs) | ||
329 | { | ||
330 | struct irq_desc *desc = irq_desc + irq; | ||
331 | |||
332 | if (likely(desc->handle_irq)) | ||
333 | desc->handle_irq(irq, desc, regs); | ||
334 | else | ||
335 | __do_IRQ(irq, regs); | ||
336 | } | ||
337 | |||
338 | /* Handling of unhandled and spurious interrupts: */ | ||
339 | extern void note_interrupt(unsigned int irq, struct irq_desc *desc, | ||
340 | int action_ret, struct pt_regs *regs); | ||
341 | |||
342 | /* Resending of interrupts :*/ | ||
343 | void check_irq_resend(struct irq_desc *desc, unsigned int irq); | ||
344 | |||
345 | /* Initialize /proc/irq/ */ | ||
346 | extern void init_irq_proc(void); | ||
347 | |||
348 | /* Enable/disable irq debugging output: */ | ||
349 | extern int noirqdebug_setup(char *str); | ||
350 | |||
351 | /* Checks whether the interrupt can be requested by request_irq(): */ | ||
352 | extern int can_request_irq(unsigned int irq, unsigned long irqflags); | ||
353 | |||
354 | /* Dummy irq-chip implementations: */ | ||
355 | extern struct irq_chip no_irq_chip; | ||
356 | extern struct irq_chip dummy_irq_chip; | ||
357 | |||
358 | extern void | ||
359 | set_irq_chip_and_handler(unsigned int irq, struct irq_chip *chip, | ||
360 | void fastcall (*handle)(unsigned int, | ||
361 | struct irq_desc *, | ||
362 | struct pt_regs *)); | ||
363 | extern void | ||
364 | __set_irq_handler(unsigned int irq, | ||
365 | void fastcall (*handle)(unsigned int, struct irq_desc *, | ||
366 | struct pt_regs *), | ||
367 | int is_chained); | ||
368 | |||
369 | /* | ||
370 | * Set a highlevel flow handler for a given IRQ: | ||
371 | */ | ||
372 | static inline void | ||
373 | set_irq_handler(unsigned int irq, | ||
374 | void fastcall (*handle)(unsigned int, struct irq_desc *, | ||
375 | struct pt_regs *)) | ||
376 | { | ||
377 | __set_irq_handler(irq, handle, 0); | ||
378 | } | ||
379 | |||
380 | /* | ||
381 | * Set a highlevel chained flow handler for a given IRQ. | ||
382 | * (a chained handler is automatically enabled and set to | ||
383 | * IRQ_NOREQUEST and IRQ_NOPROBE) | ||
384 | */ | ||
385 | static inline void | ||
386 | set_irq_chained_handler(unsigned int irq, | ||
387 | void fastcall (*handle)(unsigned int, struct irq_desc *, | ||
388 | struct pt_regs *)) | ||
389 | { | ||
390 | __set_irq_handler(irq, handle, 1); | ||
391 | } | ||
392 | |||
393 | /* Set/get chip/data for an IRQ: */ | ||
394 | |||
395 | extern int set_irq_chip(unsigned int irq, struct irq_chip *chip); | ||
396 | extern int set_irq_data(unsigned int irq, void *data); | ||
397 | extern int set_irq_chip_data(unsigned int irq, void *data); | ||
398 | extern int set_irq_type(unsigned int irq, unsigned int type); | ||
399 | |||
400 | #define get_irq_chip(irq) (irq_desc[irq].chip) | ||
401 | #define get_irq_chip_data(irq) (irq_desc[irq].chip_data) | ||
402 | #define get_irq_data(irq) (irq_desc[irq].handler_data) | ||
403 | |||
404 | #endif /* CONFIG_GENERIC_HARDIRQS */ | ||
405 | |||
406 | #endif /* !CONFIG_S390 */ | ||
195 | 407 | ||
196 | #endif /* __irq_h */ | 408 | #endif /* _LINUX_IRQ_H */ |
diff --git a/include/linux/irq_cpustat.h b/include/linux/irq_cpustat.h index af93505ec2ec..77e4bac29287 100644 --- a/include/linux/irq_cpustat.h +++ b/include/linux/irq_cpustat.h | |||
@@ -9,7 +9,6 @@ | |||
9 | * Keith Owens <kaos@ocs.com.au> July 2000. | 9 | * Keith Owens <kaos@ocs.com.au> July 2000. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/config.h> | ||
13 | 12 | ||
14 | /* | 13 | /* |
15 | * Simple wrappers reducing source bloat. Define all irq_stat fields | 14 | * Simple wrappers reducing source bloat. Define all irq_stat fields |
diff --git a/include/linux/irqreturn.h b/include/linux/irqreturn.h new file mode 100644 index 000000000000..881883c2009d --- /dev/null +++ b/include/linux/irqreturn.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /* irqreturn.h */ | ||
2 | #ifndef _LINUX_IRQRETURN_H | ||
3 | #define _LINUX_IRQRETURN_H | ||
4 | |||
5 | /* | ||
6 | * For 2.4.x compatibility, 2.4.x can use | ||
7 | * | ||
8 | * typedef void irqreturn_t; | ||
9 | * #define IRQ_NONE | ||
10 | * #define IRQ_HANDLED | ||
11 | * #define IRQ_RETVAL(x) | ||
12 | * | ||
13 | * To mix old-style and new-style irq handler returns. | ||
14 | * | ||
15 | * IRQ_NONE means we didn't handle it. | ||
16 | * IRQ_HANDLED means that we did have a valid interrupt and handled it. | ||
17 | * IRQ_RETVAL(x) selects on the two depending on x being non-zero (for handled) | ||
18 | */ | ||
19 | typedef int irqreturn_t; | ||
20 | |||
21 | #define IRQ_NONE (0) | ||
22 | #define IRQ_HANDLED (1) | ||
23 | #define IRQ_RETVAL(x) ((x) != 0) | ||
24 | |||
25 | #endif | ||
diff --git a/include/linux/isa.h b/include/linux/isa.h new file mode 100644 index 000000000000..1b855335cb11 --- /dev/null +++ b/include/linux/isa.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /* | ||
2 | * ISA bus. | ||
3 | */ | ||
4 | |||
5 | #ifndef __LINUX_ISA_H | ||
6 | #define __LINUX_ISA_H | ||
7 | |||
8 | #include <linux/device.h> | ||
9 | #include <linux/kernel.h> | ||
10 | |||
11 | struct isa_driver { | ||
12 | int (*match)(struct device *, unsigned int); | ||
13 | int (*probe)(struct device *, unsigned int); | ||
14 | int (*remove)(struct device *, unsigned int); | ||
15 | void (*shutdown)(struct device *, unsigned int); | ||
16 | int (*suspend)(struct device *, unsigned int, pm_message_t); | ||
17 | int (*resume)(struct device *, unsigned int); | ||
18 | |||
19 | struct device_driver driver; | ||
20 | struct device *devices; | ||
21 | }; | ||
22 | |||
23 | #define to_isa_driver(x) container_of((x), struct isa_driver, driver) | ||
24 | |||
25 | int isa_register_driver(struct isa_driver *, unsigned int); | ||
26 | void isa_unregister_driver(struct isa_driver *); | ||
27 | |||
28 | #endif /* __LINUX_ISA_H */ | ||
diff --git a/include/linux/isapnp.h b/include/linux/isapnp.h index 26c64c286f42..1e8728a9ee8a 100644 --- a/include/linux/isapnp.h +++ b/include/linux/isapnp.h | |||
@@ -22,7 +22,6 @@ | |||
22 | #ifndef LINUX_ISAPNP_H | 22 | #ifndef LINUX_ISAPNP_H |
23 | #define LINUX_ISAPNP_H | 23 | #define LINUX_ISAPNP_H |
24 | 24 | ||
25 | #include <linux/config.h> | ||
26 | #include <linux/errno.h> | 25 | #include <linux/errno.h> |
27 | #include <linux/pnp.h> | 26 | #include <linux/pnp.h> |
28 | 27 | ||
diff --git a/include/linux/isdn.h b/include/linux/isdn.h index 53eaee96065b..62991148d5a5 100644 --- a/include/linux/isdn.h +++ b/include/linux/isdn.h | |||
@@ -146,7 +146,6 @@ typedef struct { | |||
146 | 146 | ||
147 | #ifdef __KERNEL__ | 147 | #ifdef __KERNEL__ |
148 | 148 | ||
149 | #include <linux/config.h> | ||
150 | #include <linux/errno.h> | 149 | #include <linux/errno.h> |
151 | #include <linux/fs.h> | 150 | #include <linux/fs.h> |
152 | #include <linux/major.h> | 151 | #include <linux/major.h> |
diff --git a/include/linux/isdn/tpam.h b/include/linux/isdn/tpam.h deleted file mode 100644 index 9f65bea49d11..000000000000 --- a/include/linux/isdn/tpam.h +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | /* $Id: tpam.h,v 1.1.2.1 2001/06/08 08:23:46 kai Exp $ | ||
2 | * | ||
3 | * Turbo PAM ISDN driver for Linux. (Kernel Driver) | ||
4 | * | ||
5 | * Copyright 2001 Stelian Pop <stelian.pop@fr.alcove.com>, Alcôve | ||
6 | * | ||
7 | * For all support questions please contact: <support@auvertech.fr> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2, or (at your option) | ||
12 | * any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
22 | * | ||
23 | */ | ||
24 | |||
25 | #ifndef _TPAM_H_ | ||
26 | #define _TPAM_H_ | ||
27 | |||
28 | #include <linux/types.h> | ||
29 | #include <linux/pci.h> | ||
30 | |||
31 | /* IOCTL commands */ | ||
32 | #define TPAM_CMD_DSPLOAD 0x0001 | ||
33 | #define TPAM_CMD_DSPSAVE 0x0002 | ||
34 | #define TPAM_CMD_DSPRUN 0x0003 | ||
35 | #define TPAM_CMD_LOOPMODEON 0x0004 | ||
36 | #define TPAM_CMD_LOOPMODEOFF 0x0005 | ||
37 | |||
38 | /* addresses of debug information zones on board */ | ||
39 | #define TPAM_TRAPAUDIT_REGISTER 0x005493e4 | ||
40 | #define TPAM_NCOAUDIT_REGISTER 0x00500000 | ||
41 | #define TPAM_MSGAUDIT_REGISTER 0x008E30F0 | ||
42 | |||
43 | /* length of debug information zones on board */ | ||
44 | #define TPAM_TRAPAUDIT_LENGTH 10000 | ||
45 | #define TPAM_NCOAUDIT_LENGTH 300000 | ||
46 | #define TPAM_NCOAUDIT_COUNT 30 | ||
47 | #define TPAM_MSGAUDIT_LENGTH 60000 | ||
48 | |||
49 | /* IOCTL load/save parameter */ | ||
50 | typedef struct tpam_dsp_ioctl { | ||
51 | __u32 address; /* address to load/save data */ | ||
52 | __u32 data_len; /* size of data to be loaded/saved */ | ||
53 | __u8 data[0]; /* data */ | ||
54 | } tpam_dsp_ioctl; | ||
55 | |||
56 | #endif /* _TPAM_H_ */ | ||
diff --git a/include/linux/isdn_ppp.h b/include/linux/isdn_ppp.h index 26b00a76e135..8687a7dc0632 100644 --- a/include/linux/isdn_ppp.h +++ b/include/linux/isdn_ppp.h | |||
@@ -67,7 +67,6 @@ struct isdn_ppp_comp_data { | |||
67 | #ifdef __KERNEL__ | 67 | #ifdef __KERNEL__ |
68 | 68 | ||
69 | 69 | ||
70 | #include <linux/config.h> | ||
71 | 70 | ||
72 | #ifdef CONFIG_IPPP_FILTER | 71 | #ifdef CONFIG_IPPP_FILTER |
73 | #include <linux/filter.h> | 72 | #include <linux/filter.h> |
diff --git a/include/linux/isdnif.h b/include/linux/isdnif.h index 04e10f9f14f8..b9b5a684ed69 100644 --- a/include/linux/isdnif.h +++ b/include/linux/isdnif.h | |||
@@ -54,7 +54,6 @@ | |||
54 | 54 | ||
55 | #ifdef __KERNEL__ | 55 | #ifdef __KERNEL__ |
56 | 56 | ||
57 | #include <linux/config.h> | ||
58 | #include <linux/skbuff.h> | 57 | #include <linux/skbuff.h> |
59 | 58 | ||
60 | /***************************************************************************/ | 59 | /***************************************************************************/ |
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index 6a425e370cb3..20eb34403d0c 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
@@ -501,6 +501,12 @@ struct transaction_s | |||
501 | struct journal_head *t_checkpoint_list; | 501 | struct journal_head *t_checkpoint_list; |
502 | 502 | ||
503 | /* | 503 | /* |
504 | * Doubly-linked circular list of all buffers submitted for IO while | ||
505 | * checkpointing. [j_list_lock] | ||
506 | */ | ||
507 | struct journal_head *t_checkpoint_io_list; | ||
508 | |||
509 | /* | ||
504 | * Doubly-linked circular list of temporary buffers currently undergoing | 510 | * Doubly-linked circular list of temporary buffers currently undergoing |
505 | * IO in the log [j_list_lock] | 511 | * IO in the log [j_list_lock] |
506 | */ | 512 | */ |
@@ -849,7 +855,7 @@ extern void journal_commit_transaction(journal_t *); | |||
849 | 855 | ||
850 | /* Checkpoint list management */ | 856 | /* Checkpoint list management */ |
851 | int __journal_clean_checkpoint_list(journal_t *journal); | 857 | int __journal_clean_checkpoint_list(journal_t *journal); |
852 | void __journal_remove_checkpoint(struct journal_head *); | 858 | int __journal_remove_checkpoint(struct journal_head *); |
853 | void __journal_insert_checkpoint(struct journal_head *, transaction_t *); | 859 | void __journal_insert_checkpoint(struct journal_head *, transaction_t *); |
854 | 860 | ||
855 | /* Buffer IO */ | 861 | /* Buffer IO */ |
diff --git a/include/linux/jffs2.h b/include/linux/jffs2.h index cf792bb3c726..c9c760700bc3 100644 --- a/include/linux/jffs2.h +++ b/include/linux/jffs2.h | |||
@@ -65,6 +65,18 @@ | |||
65 | 65 | ||
66 | #define JFFS2_NODETYPE_SUMMARY (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 6) | 66 | #define JFFS2_NODETYPE_SUMMARY (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 6) |
67 | 67 | ||
68 | #define JFFS2_NODETYPE_XATTR (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 8) | ||
69 | #define JFFS2_NODETYPE_XREF (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 9) | ||
70 | |||
71 | /* XATTR Related */ | ||
72 | #define JFFS2_XPREFIX_USER 1 /* for "user." */ | ||
73 | #define JFFS2_XPREFIX_SECURITY 2 /* for "security." */ | ||
74 | #define JFFS2_XPREFIX_ACL_ACCESS 3 /* for "system.posix_acl_access" */ | ||
75 | #define JFFS2_XPREFIX_ACL_DEFAULT 4 /* for "system.posix_acl_default" */ | ||
76 | #define JFFS2_XPREFIX_TRUSTED 5 /* for "trusted.*" */ | ||
77 | |||
78 | #define JFFS2_ACL_VERSION 0x0001 | ||
79 | |||
68 | // Maybe later... | 80 | // Maybe later... |
69 | //#define JFFS2_NODETYPE_CHECKPOINT (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3) | 81 | //#define JFFS2_NODETYPE_CHECKPOINT (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3) |
70 | //#define JFFS2_NODETYPE_OPTIONS (JFFS2_FEATURE_RWCOMPAT_COPY | JFFS2_NODE_ACCURATE | 4) | 82 | //#define JFFS2_NODETYPE_OPTIONS (JFFS2_FEATURE_RWCOMPAT_COPY | JFFS2_NODE_ACCURATE | 4) |
@@ -82,11 +94,11 @@ | |||
82 | 94 | ||
83 | typedef struct { | 95 | typedef struct { |
84 | uint32_t v32; | 96 | uint32_t v32; |
85 | } __attribute__((packed)) jint32_t; | 97 | } __attribute__((packed)) jint32_t; |
86 | 98 | ||
87 | typedef struct { | 99 | typedef struct { |
88 | uint32_t m; | 100 | uint32_t m; |
89 | } __attribute__((packed)) jmode_t; | 101 | } __attribute__((packed)) jmode_t; |
90 | 102 | ||
91 | typedef struct { | 103 | typedef struct { |
92 | uint16_t v16; | 104 | uint16_t v16; |
@@ -99,7 +111,7 @@ struct jffs2_unknown_node | |||
99 | jint16_t nodetype; | 111 | jint16_t nodetype; |
100 | jint32_t totlen; /* So we can skip over nodes we don't grok */ | 112 | jint32_t totlen; /* So we can skip over nodes we don't grok */ |
101 | jint32_t hdr_crc; | 113 | jint32_t hdr_crc; |
102 | } __attribute__((packed)); | 114 | }; |
103 | 115 | ||
104 | struct jffs2_raw_dirent | 116 | struct jffs2_raw_dirent |
105 | { | 117 | { |
@@ -117,7 +129,7 @@ struct jffs2_raw_dirent | |||
117 | jint32_t node_crc; | 129 | jint32_t node_crc; |
118 | jint32_t name_crc; | 130 | jint32_t name_crc; |
119 | uint8_t name[0]; | 131 | uint8_t name[0]; |
120 | } __attribute__((packed)); | 132 | }; |
121 | 133 | ||
122 | /* The JFFS2 raw inode structure: Used for storage on physical media. */ | 134 | /* The JFFS2 raw inode structure: Used for storage on physical media. */ |
123 | /* The uid, gid, atime, mtime and ctime members could be longer, but | 135 | /* The uid, gid, atime, mtime and ctime members could be longer, but |
@@ -149,6 +161,33 @@ struct jffs2_raw_inode | |||
149 | jint32_t data_crc; /* CRC for the (compressed) data. */ | 161 | jint32_t data_crc; /* CRC for the (compressed) data. */ |
150 | jint32_t node_crc; /* CRC for the raw inode (excluding data) */ | 162 | jint32_t node_crc; /* CRC for the raw inode (excluding data) */ |
151 | uint8_t data[0]; | 163 | uint8_t data[0]; |
164 | }; | ||
165 | |||
166 | struct jffs2_raw_xattr { | ||
167 | jint16_t magic; | ||
168 | jint16_t nodetype; /* = JFFS2_NODETYPE_XATTR */ | ||
169 | jint32_t totlen; | ||
170 | jint32_t hdr_crc; | ||
171 | jint32_t xid; /* XATTR identifier number */ | ||
172 | jint32_t version; | ||
173 | uint8_t xprefix; | ||
174 | uint8_t name_len; | ||
175 | jint16_t value_len; | ||
176 | jint32_t data_crc; | ||
177 | jint32_t node_crc; | ||
178 | uint8_t data[0]; | ||
179 | } __attribute__((packed)); | ||
180 | |||
181 | struct jffs2_raw_xref | ||
182 | { | ||
183 | jint16_t magic; | ||
184 | jint16_t nodetype; /* = JFFS2_NODETYPE_XREF */ | ||
185 | jint32_t totlen; | ||
186 | jint32_t hdr_crc; | ||
187 | jint32_t ino; /* inode number */ | ||
188 | jint32_t xid; /* XATTR identifier number */ | ||
189 | jint32_t xseqno; /* xref sequencial number */ | ||
190 | jint32_t node_crc; | ||
152 | } __attribute__((packed)); | 191 | } __attribute__((packed)); |
153 | 192 | ||
154 | struct jffs2_raw_summary | 193 | struct jffs2_raw_summary |
@@ -163,14 +202,22 @@ struct jffs2_raw_summary | |||
163 | jint32_t sum_crc; /* summary information crc */ | 202 | jint32_t sum_crc; /* summary information crc */ |
164 | jint32_t node_crc; /* node crc */ | 203 | jint32_t node_crc; /* node crc */ |
165 | jint32_t sum[0]; /* inode summary info */ | 204 | jint32_t sum[0]; /* inode summary info */ |
166 | } __attribute__((packed)); | 205 | }; |
167 | 206 | ||
168 | union jffs2_node_union | 207 | union jffs2_node_union |
169 | { | 208 | { |
170 | struct jffs2_raw_inode i; | 209 | struct jffs2_raw_inode i; |
171 | struct jffs2_raw_dirent d; | 210 | struct jffs2_raw_dirent d; |
211 | struct jffs2_raw_xattr x; | ||
212 | struct jffs2_raw_xref r; | ||
172 | struct jffs2_raw_summary s; | 213 | struct jffs2_raw_summary s; |
173 | struct jffs2_unknown_node u; | 214 | struct jffs2_unknown_node u; |
174 | }; | 215 | }; |
175 | 216 | ||
217 | /* Data payload for device nodes. */ | ||
218 | union jffs2_device_node { | ||
219 | jint16_t old; | ||
220 | jint32_t new; | ||
221 | }; | ||
222 | |||
176 | #endif /* __LINUX_JFFS2_H__ */ | 223 | #endif /* __LINUX_JFFS2_H__ */ |
diff --git a/include/linux/jffs2_fs_i.h b/include/linux/jffs2_fs_i.h deleted file mode 100644 index ad565bf9dcc1..000000000000 --- a/include/linux/jffs2_fs_i.h +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | /* $Id: jffs2_fs_i.h,v 1.19 2005/11/07 11:14:52 gleixner Exp $ */ | ||
2 | |||
3 | #ifndef _JFFS2_FS_I | ||
4 | #define _JFFS2_FS_I | ||
5 | |||
6 | #include <linux/version.h> | ||
7 | #include <linux/rbtree.h> | ||
8 | #include <asm/semaphore.h> | ||
9 | |||
10 | struct jffs2_inode_info { | ||
11 | /* We need an internal mutex similar to inode->i_mutex. | ||
12 | Unfortunately, we can't used the existing one, because | ||
13 | either the GC would deadlock, or we'd have to release it | ||
14 | before letting GC proceed. Or we'd have to put ugliness | ||
15 | into the GC code so it didn't attempt to obtain the i_mutex | ||
16 | for the inode(s) which are already locked */ | ||
17 | struct semaphore sem; | ||
18 | |||
19 | /* The highest (datanode) version number used for this ino */ | ||
20 | uint32_t highest_version; | ||
21 | |||
22 | /* List of data fragments which make up the file */ | ||
23 | struct rb_root fragtree; | ||
24 | |||
25 | /* There may be one datanode which isn't referenced by any of the | ||
26 | above fragments, if it contains a metadata update but no actual | ||
27 | data - or if this is a directory inode */ | ||
28 | /* This also holds the _only_ dnode for symlinks/device nodes, | ||
29 | etc. */ | ||
30 | struct jffs2_full_dnode *metadata; | ||
31 | |||
32 | /* Directory entries */ | ||
33 | struct jffs2_full_dirent *dents; | ||
34 | |||
35 | /* The target path if this is the inode of a symlink */ | ||
36 | unsigned char *target; | ||
37 | |||
38 | /* Some stuff we just have to keep in-core at all times, for each inode. */ | ||
39 | struct jffs2_inode_cache *inocache; | ||
40 | |||
41 | uint16_t flags; | ||
42 | uint8_t usercompr; | ||
43 | #if !defined (__ECOS) | ||
44 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,2) | ||
45 | struct inode vfs_inode; | ||
46 | #endif | ||
47 | #endif | ||
48 | }; | ||
49 | |||
50 | #endif /* _JFFS2_FS_I */ | ||
diff --git a/include/linux/jffs2_fs_sb.h b/include/linux/jffs2_fs_sb.h deleted file mode 100644 index 4bcfb5570221..000000000000 --- a/include/linux/jffs2_fs_sb.h +++ /dev/null | |||
@@ -1,122 +0,0 @@ | |||
1 | /* $Id: jffs2_fs_sb.h,v 1.54 2005/09/21 13:37:34 dedekind Exp $ */ | ||
2 | |||
3 | #ifndef _JFFS2_FS_SB | ||
4 | #define _JFFS2_FS_SB | ||
5 | |||
6 | #include <linux/types.h> | ||
7 | #include <linux/spinlock.h> | ||
8 | #include <linux/workqueue.h> | ||
9 | #include <linux/completion.h> | ||
10 | #include <asm/semaphore.h> | ||
11 | #include <linux/timer.h> | ||
12 | #include <linux/wait.h> | ||
13 | #include <linux/list.h> | ||
14 | #include <linux/rwsem.h> | ||
15 | |||
16 | #define JFFS2_SB_FLAG_RO 1 | ||
17 | #define JFFS2_SB_FLAG_SCANNING 2 /* Flash scanning is in progress */ | ||
18 | #define JFFS2_SB_FLAG_BUILDING 4 /* File system building is in progress */ | ||
19 | |||
20 | struct jffs2_inodirty; | ||
21 | |||
22 | /* A struct for the overall file system control. Pointers to | ||
23 | jffs2_sb_info structs are named `c' in the source code. | ||
24 | Nee jffs_control | ||
25 | */ | ||
26 | struct jffs2_sb_info { | ||
27 | struct mtd_info *mtd; | ||
28 | |||
29 | uint32_t highest_ino; | ||
30 | uint32_t checked_ino; | ||
31 | |||
32 | unsigned int flags; | ||
33 | |||
34 | struct task_struct *gc_task; /* GC task struct */ | ||
35 | struct completion gc_thread_start; /* GC thread start completion */ | ||
36 | struct completion gc_thread_exit; /* GC thread exit completion port */ | ||
37 | |||
38 | struct semaphore alloc_sem; /* Used to protect all the following | ||
39 | fields, and also to protect against | ||
40 | out-of-order writing of nodes. And GC. */ | ||
41 | uint32_t cleanmarker_size; /* Size of an _inline_ CLEANMARKER | ||
42 | (i.e. zero for OOB CLEANMARKER */ | ||
43 | |||
44 | uint32_t flash_size; | ||
45 | uint32_t used_size; | ||
46 | uint32_t dirty_size; | ||
47 | uint32_t wasted_size; | ||
48 | uint32_t free_size; | ||
49 | uint32_t erasing_size; | ||
50 | uint32_t bad_size; | ||
51 | uint32_t sector_size; | ||
52 | uint32_t unchecked_size; | ||
53 | |||
54 | uint32_t nr_free_blocks; | ||
55 | uint32_t nr_erasing_blocks; | ||
56 | |||
57 | /* Number of free blocks there must be before we... */ | ||
58 | uint8_t resv_blocks_write; /* ... allow a normal filesystem write */ | ||
59 | uint8_t resv_blocks_deletion; /* ... allow a normal filesystem deletion */ | ||
60 | uint8_t resv_blocks_gctrigger; /* ... wake up the GC thread */ | ||
61 | uint8_t resv_blocks_gcbad; /* ... pick a block from the bad_list to GC */ | ||
62 | uint8_t resv_blocks_gcmerge; /* ... merge pages when garbage collecting */ | ||
63 | |||
64 | uint32_t nospc_dirty_size; | ||
65 | |||
66 | uint32_t nr_blocks; | ||
67 | struct jffs2_eraseblock *blocks; /* The whole array of blocks. Used for getting blocks | ||
68 | * from the offset (blocks[ofs / sector_size]) */ | ||
69 | struct jffs2_eraseblock *nextblock; /* The block we're currently filling */ | ||
70 | |||
71 | struct jffs2_eraseblock *gcblock; /* The block we're currently garbage-collecting */ | ||
72 | |||
73 | struct list_head clean_list; /* Blocks 100% full of clean data */ | ||
74 | struct list_head very_dirty_list; /* Blocks with lots of dirty space */ | ||
75 | struct list_head dirty_list; /* Blocks with some dirty space */ | ||
76 | struct list_head erasable_list; /* Blocks which are completely dirty, and need erasing */ | ||
77 | struct list_head erasable_pending_wbuf_list; /* Blocks which need erasing but only after the current wbuf is flushed */ | ||
78 | struct list_head erasing_list; /* Blocks which are currently erasing */ | ||
79 | struct list_head erase_pending_list; /* Blocks which need erasing now */ | ||
80 | struct list_head erase_complete_list; /* Blocks which are erased and need the clean marker written to them */ | ||
81 | struct list_head free_list; /* Blocks which are free and ready to be used */ | ||
82 | struct list_head bad_list; /* Bad blocks. */ | ||
83 | struct list_head bad_used_list; /* Bad blocks with valid data in. */ | ||
84 | |||
85 | spinlock_t erase_completion_lock; /* Protect free_list and erasing_list | ||
86 | against erase completion handler */ | ||
87 | wait_queue_head_t erase_wait; /* For waiting for erases to complete */ | ||
88 | |||
89 | wait_queue_head_t inocache_wq; | ||
90 | struct jffs2_inode_cache **inocache_list; | ||
91 | spinlock_t inocache_lock; | ||
92 | |||
93 | /* Sem to allow jffs2_garbage_collect_deletion_dirent to | ||
94 | drop the erase_completion_lock while it's holding a pointer | ||
95 | to an obsoleted node. I don't like this. Alternatives welcomed. */ | ||
96 | struct semaphore erase_free_sem; | ||
97 | |||
98 | uint32_t wbuf_pagesize; /* 0 for NOR and other flashes with no wbuf */ | ||
99 | |||
100 | #ifdef CONFIG_JFFS2_FS_WRITEBUFFER | ||
101 | /* Write-behind buffer for NAND flash */ | ||
102 | unsigned char *wbuf; | ||
103 | uint32_t wbuf_ofs; | ||
104 | uint32_t wbuf_len; | ||
105 | struct jffs2_inodirty *wbuf_inodes; | ||
106 | |||
107 | struct rw_semaphore wbuf_sem; /* Protects the write buffer */ | ||
108 | |||
109 | /* Information about out-of-band area usage... */ | ||
110 | struct nand_oobinfo *oobinfo; | ||
111 | uint32_t badblock_pos; | ||
112 | uint32_t fsdata_pos; | ||
113 | uint32_t fsdata_len; | ||
114 | #endif | ||
115 | |||
116 | struct jffs2_summary *summary; /* Summary information */ | ||
117 | |||
118 | /* OS-private pointer for getting back to master superblock info */ | ||
119 | void *os_priv; | ||
120 | }; | ||
121 | |||
122 | #endif /* _JFFS2_FB_SB */ | ||
diff --git a/include/linux/joystick.h b/include/linux/joystick.h index 5fd20ddd7ae3..e2d3a18af456 100644 --- a/include/linux/joystick.h +++ b/include/linux/joystick.h | |||
@@ -111,25 +111,25 @@ struct js_corr { | |||
111 | #define JS_SET_ALL 8 | 111 | #define JS_SET_ALL 8 |
112 | 112 | ||
113 | struct JS_DATA_TYPE { | 113 | struct JS_DATA_TYPE { |
114 | int32_t buttons; | 114 | __s32 buttons; |
115 | int32_t x; | 115 | __s32 x; |
116 | int32_t y; | 116 | __s32 y; |
117 | }; | 117 | }; |
118 | 118 | ||
119 | struct JS_DATA_SAVE_TYPE_32 { | 119 | struct JS_DATA_SAVE_TYPE_32 { |
120 | int32_t JS_TIMEOUT; | 120 | __s32 JS_TIMEOUT; |
121 | int32_t BUSY; | 121 | __s32 BUSY; |
122 | int32_t JS_EXPIRETIME; | 122 | __s32 JS_EXPIRETIME; |
123 | int32_t JS_TIMELIMIT; | 123 | __s32 JS_TIMELIMIT; |
124 | struct JS_DATA_TYPE JS_SAVE; | 124 | struct JS_DATA_TYPE JS_SAVE; |
125 | struct JS_DATA_TYPE JS_CORR; | 125 | struct JS_DATA_TYPE JS_CORR; |
126 | }; | 126 | }; |
127 | 127 | ||
128 | struct JS_DATA_SAVE_TYPE_64 { | 128 | struct JS_DATA_SAVE_TYPE_64 { |
129 | int32_t JS_TIMEOUT; | 129 | __s32 JS_TIMEOUT; |
130 | int32_t BUSY; | 130 | __s32 BUSY; |
131 | int64_t JS_EXPIRETIME; | 131 | __s64 JS_EXPIRETIME; |
132 | int64_t JS_TIMELIMIT; | 132 | __s64 JS_TIMELIMIT; |
133 | struct JS_DATA_TYPE JS_SAVE; | 133 | struct JS_DATA_TYPE JS_SAVE; |
134 | struct JS_DATA_TYPE JS_CORR; | 134 | struct JS_DATA_TYPE JS_CORR; |
135 | }; | 135 | }; |
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h index 9bbd04092365..54e2549f96ba 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h | |||
@@ -5,7 +5,6 @@ | |||
5 | #ifndef _LINUX_KALLSYMS_H | 5 | #ifndef _LINUX_KALLSYMS_H |
6 | #define _LINUX_KALLSYMS_H | 6 | #define _LINUX_KALLSYMS_H |
7 | 7 | ||
8 | #include <linux/config.h> | ||
9 | 8 | ||
10 | #define KSYM_NAME_LEN 127 | 9 | #define KSYM_NAME_LEN 127 |
11 | 10 | ||
diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h index 4eb851ece080..efe0ee4cc80b 100644 --- a/include/linux/kbd_kern.h +++ b/include/linux/kbd_kern.h | |||
@@ -155,10 +155,8 @@ static inline void con_schedule_flip(struct tty_struct *t) | |||
155 | { | 155 | { |
156 | unsigned long flags; | 156 | unsigned long flags; |
157 | spin_lock_irqsave(&t->buf.lock, flags); | 157 | spin_lock_irqsave(&t->buf.lock, flags); |
158 | if (t->buf.tail != NULL) { | 158 | if (t->buf.tail != NULL) |
159 | t->buf.tail->active = 0; | ||
160 | t->buf.tail->commit = t->buf.tail->used; | 159 | t->buf.tail->commit = t->buf.tail->used; |
161 | } | ||
162 | spin_unlock_irqrestore(&t->buf.lock, flags); | 160 | spin_unlock_irqrestore(&t->buf.lock, flags); |
163 | schedule_work(&t->buf.work); | 161 | schedule_work(&t->buf.work); |
164 | } | 162 | } |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index c217e99d5073..c3958ea8d126 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -24,12 +24,16 @@ extern const char linux_banner[]; | |||
24 | #define LONG_MAX ((long)(~0UL>>1)) | 24 | #define LONG_MAX ((long)(~0UL>>1)) |
25 | #define LONG_MIN (-LONG_MAX - 1) | 25 | #define LONG_MIN (-LONG_MAX - 1) |
26 | #define ULONG_MAX (~0UL) | 26 | #define ULONG_MAX (~0UL) |
27 | #define LLONG_MAX ((long long)(~0ULL>>1)) | ||
28 | #define LLONG_MIN (-LLONG_MAX - 1) | ||
29 | #define ULLONG_MAX (~0ULL) | ||
27 | 30 | ||
28 | #define STACK_MAGIC 0xdeadbeef | 31 | #define STACK_MAGIC 0xdeadbeef |
29 | 32 | ||
30 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) | 33 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) |
31 | #define ALIGN(x,a) (((x)+(a)-1)&~((a)-1)) | 34 | #define ALIGN(x,a) (((x)+(a)-1)&~((a)-1)) |
32 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) | 35 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) |
36 | #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) | ||
33 | 37 | ||
34 | #define KERN_EMERG "<0>" /* system is unusable */ | 38 | #define KERN_EMERG "<0>" /* system is unusable */ |
35 | #define KERN_ALERT "<1>" /* action must be taken immediately */ | 39 | #define KERN_ALERT "<1>" /* action must be taken immediately */ |
@@ -76,7 +80,7 @@ extern int cond_resched(void); | |||
76 | # define might_sleep() do { might_resched(); } while (0) | 80 | # define might_sleep() do { might_resched(); } while (0) |
77 | #endif | 81 | #endif |
78 | 82 | ||
79 | #define might_sleep_if(cond) do { if (unlikely(cond)) might_sleep(); } while (0) | 83 | #define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0) |
80 | 84 | ||
81 | #define abs(x) ({ \ | 85 | #define abs(x) ({ \ |
82 | int __x = (x); \ | 86 | int __x = (x); \ |
@@ -115,6 +119,8 @@ extern int scnprintf(char * buf, size_t size, const char * fmt, ...) | |||
115 | __attribute__ ((format (printf, 3, 4))); | 119 | __attribute__ ((format (printf, 3, 4))); |
116 | extern int vscnprintf(char *buf, size_t size, const char *fmt, va_list args) | 120 | extern int vscnprintf(char *buf, size_t size, const char *fmt, va_list args) |
117 | __attribute__ ((format (printf, 3, 0))); | 121 | __attribute__ ((format (printf, 3, 0))); |
122 | extern char *kasprintf(gfp_t gfp, const char *fmt, ...) | ||
123 | __attribute__ ((format (printf, 2, 3))); | ||
118 | 124 | ||
119 | extern int sscanf(const char *, const char *, ...) | 125 | extern int sscanf(const char *, const char *, ...) |
120 | __attribute__ ((format (scanf, 2, 3))); | 126 | __attribute__ ((format (scanf, 2, 3))); |
@@ -332,6 +338,12 @@ struct sysinfo { | |||
332 | /* Force a compilation error if condition is true */ | 338 | /* Force a compilation error if condition is true */ |
333 | #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) | 339 | #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) |
334 | 340 | ||
341 | /* Force a compilation error if condition is true, but also produce a | ||
342 | result (of value 0 and type size_t), so the expression can be used | ||
343 | e.g. in a structure initializer (or where-ever else comma expressions | ||
344 | aren't permitted). */ | ||
345 | #define BUILD_BUG_ON_ZERO(e) (sizeof(char[1 - 2 * !!(e)]) - 1) | ||
346 | |||
335 | /* Trap pasters of __FUNCTION__ at compile-time */ | 347 | /* Trap pasters of __FUNCTION__ at compile-time */ |
336 | #define __FUNCTION__ (__func__) | 348 | #define __FUNCTION__ (__func__) |
337 | 349 | ||
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index b46249082cca..43e895f1cabe 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _LINUX_KERNEL_STAT_H | 1 | #ifndef _LINUX_KERNEL_STAT_H |
2 | #define _LINUX_KERNEL_STAT_H | 2 | #define _LINUX_KERNEL_STAT_H |
3 | 3 | ||
4 | #include <linux/config.h> | ||
5 | #include <asm/irq.h> | 4 | #include <asm/irq.h> |
6 | #include <linux/smp.h> | 5 | #include <linux/smp.h> |
7 | #include <linux/threads.h> | 6 | #include <linux/threads.h> |
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index cfb3410e32b1..6427949ddf99 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
@@ -106,6 +106,7 @@ extern struct page *kimage_alloc_control_pages(struct kimage *image, | |||
106 | extern void crash_kexec(struct pt_regs *); | 106 | extern void crash_kexec(struct pt_regs *); |
107 | int kexec_should_crash(struct task_struct *); | 107 | int kexec_should_crash(struct task_struct *); |
108 | extern struct kimage *kexec_image; | 108 | extern struct kimage *kexec_image; |
109 | extern struct kimage *kexec_crash_image; | ||
109 | 110 | ||
110 | #define KEXEC_ON_CRASH 0x00000001 | 111 | #define KEXEC_ON_CRASH 0x00000001 |
111 | #define KEXEC_ARCH_MASK 0xffff0000 | 112 | #define KEXEC_ARCH_MASK 0xffff0000 |
diff --git a/include/linux/key.h b/include/linux/key.h index cbf464ad9589..169f05e4863e 100644 --- a/include/linux/key.h +++ b/include/linux/key.h | |||
@@ -177,7 +177,8 @@ struct key { | |||
177 | /* | 177 | /* |
178 | * kernel managed key type definition | 178 | * kernel managed key type definition |
179 | */ | 179 | */ |
180 | typedef int (*request_key_actor_t)(struct key *key, struct key *authkey, const char *op); | 180 | typedef int (*request_key_actor_t)(struct key *key, struct key *authkey, |
181 | const char *op, void *aux); | ||
181 | 182 | ||
182 | struct key_type { | 183 | struct key_type { |
183 | /* name of the type */ | 184 | /* name of the type */ |
@@ -205,6 +206,11 @@ struct key_type { | |||
205 | /* match a key against a description */ | 206 | /* match a key against a description */ |
206 | int (*match)(const struct key *key, const void *desc); | 207 | int (*match)(const struct key *key, const void *desc); |
207 | 208 | ||
209 | /* clear some of the data from a key on revokation (optional) | ||
210 | * - the key's semaphore will be write-locked by the caller | ||
211 | */ | ||
212 | void (*revoke)(struct key *key); | ||
213 | |||
208 | /* clear the data from a key (optional) */ | 214 | /* clear the data from a key (optional) */ |
209 | void (*destroy)(struct key *key); | 215 | void (*destroy)(struct key *key); |
210 | 216 | ||
@@ -241,8 +247,16 @@ extern void unregister_key_type(struct key_type *ktype); | |||
241 | 247 | ||
242 | extern struct key *key_alloc(struct key_type *type, | 248 | extern struct key *key_alloc(struct key_type *type, |
243 | const char *desc, | 249 | const char *desc, |
244 | uid_t uid, gid_t gid, key_perm_t perm, | 250 | uid_t uid, gid_t gid, |
245 | int not_in_quota); | 251 | struct task_struct *ctx, |
252 | key_perm_t perm, | ||
253 | unsigned long flags); | ||
254 | |||
255 | |||
256 | #define KEY_ALLOC_IN_QUOTA 0x0000 /* add to quota, reject if would overrun */ | ||
257 | #define KEY_ALLOC_QUOTA_OVERRUN 0x0001 /* add to quota, permit even if overrun */ | ||
258 | #define KEY_ALLOC_NOT_IN_QUOTA 0x0002 /* not in quota */ | ||
259 | |||
246 | extern int key_payload_reserve(struct key *key, size_t datalen); | 260 | extern int key_payload_reserve(struct key *key, size_t datalen); |
247 | extern int key_instantiate_and_link(struct key *key, | 261 | extern int key_instantiate_and_link(struct key *key, |
248 | const void *data, | 262 | const void *data, |
@@ -272,6 +286,11 @@ extern struct key *request_key(struct key_type *type, | |||
272 | const char *description, | 286 | const char *description, |
273 | const char *callout_info); | 287 | const char *callout_info); |
274 | 288 | ||
289 | extern struct key *request_key_with_auxdata(struct key_type *type, | ||
290 | const char *description, | ||
291 | const char *callout_info, | ||
292 | void *aux); | ||
293 | |||
275 | extern int key_validate(struct key *key); | 294 | extern int key_validate(struct key *key); |
276 | 295 | ||
277 | extern key_ref_t key_create_or_update(key_ref_t keyring, | 296 | extern key_ref_t key_create_or_update(key_ref_t keyring, |
@@ -279,7 +298,7 @@ extern key_ref_t key_create_or_update(key_ref_t keyring, | |||
279 | const char *description, | 298 | const char *description, |
280 | const void *payload, | 299 | const void *payload, |
281 | size_t plen, | 300 | size_t plen, |
282 | int not_in_quota); | 301 | unsigned long flags); |
283 | 302 | ||
284 | extern int key_update(key_ref_t key, | 303 | extern int key_update(key_ref_t key, |
285 | const void *payload, | 304 | const void *payload, |
@@ -292,7 +311,9 @@ extern int key_unlink(struct key *keyring, | |||
292 | struct key *key); | 311 | struct key *key); |
293 | 312 | ||
294 | extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid, | 313 | extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid, |
295 | int not_in_quota, struct key *dest); | 314 | struct task_struct *ctx, |
315 | unsigned long flags, | ||
316 | struct key *dest); | ||
296 | 317 | ||
297 | extern int keyring_clear(struct key *keyring); | 318 | extern int keyring_clear(struct key *keyring); |
298 | 319 | ||
@@ -313,7 +334,8 @@ extern void keyring_replace_payload(struct key *key, void *replacement); | |||
313 | * the userspace interface | 334 | * the userspace interface |
314 | */ | 335 | */ |
315 | extern struct key root_user_keyring, root_session_keyring; | 336 | extern struct key root_user_keyring, root_session_keyring; |
316 | extern int alloc_uid_keyring(struct user_struct *user); | 337 | extern int alloc_uid_keyring(struct user_struct *user, |
338 | struct task_struct *ctx); | ||
317 | extern void switch_uid_keyring(struct user_struct *new_user); | 339 | extern void switch_uid_keyring(struct user_struct *new_user); |
318 | extern int copy_keys(unsigned long clone_flags, struct task_struct *tsk); | 340 | extern int copy_keys(unsigned long clone_flags, struct task_struct *tsk); |
319 | extern int copy_thread_group_keys(struct task_struct *tsk); | 341 | extern int copy_thread_group_keys(struct task_struct *tsk); |
@@ -342,7 +364,7 @@ extern void key_init(void); | |||
342 | #define make_key_ref(k) ({ NULL; }) | 364 | #define make_key_ref(k) ({ NULL; }) |
343 | #define key_ref_to_ptr(k) ({ NULL; }) | 365 | #define key_ref_to_ptr(k) ({ NULL; }) |
344 | #define is_key_possessed(k) 0 | 366 | #define is_key_possessed(k) 0 |
345 | #define alloc_uid_keyring(u) 0 | 367 | #define alloc_uid_keyring(u,c) 0 |
346 | #define switch_uid_keyring(u) do { } while(0) | 368 | #define switch_uid_keyring(u) do { } while(0) |
347 | #define __install_session_keyring(t, k) ({ NULL; }) | 369 | #define __install_session_keyring(t, k) ({ NULL; }) |
348 | #define copy_keys(f,t) 0 | 370 | #define copy_keys(f,t) 0 |
@@ -355,6 +377,10 @@ extern void key_init(void); | |||
355 | #define key_fsgid_changed(t) do { } while(0) | 377 | #define key_fsgid_changed(t) do { } while(0) |
356 | #define key_init() do { } while(0) | 378 | #define key_init() do { } while(0) |
357 | 379 | ||
380 | /* Initial keyrings */ | ||
381 | extern struct key root_user_keyring; | ||
382 | extern struct key root_session_keyring; | ||
383 | |||
358 | #endif /* CONFIG_KEYS */ | 384 | #endif /* CONFIG_KEYS */ |
359 | #endif /* __KERNEL__ */ | 385 | #endif /* __KERNEL__ */ |
360 | #endif /* _LINUX_KEY_H */ | 386 | #endif /* _LINUX_KEY_H */ |
diff --git a/include/linux/kmod.h b/include/linux/kmod.h index e4a231549407..0db22a1ab474 100644 --- a/include/linux/kmod.h +++ b/include/linux/kmod.h | |||
@@ -20,7 +20,6 @@ | |||
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <linux/stddef.h> | 22 | #include <linux/stddef.h> |
23 | #include <linux/config.h> | ||
24 | #include <linux/errno.h> | 23 | #include <linux/errno.h> |
25 | #include <linux/compiler.h> | 24 | #include <linux/compiler.h> |
26 | 25 | ||
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index c187c53cecd0..0503b2ed8bae 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
@@ -46,6 +46,8 @@ enum kobject_action { | |||
46 | KOBJ_UMOUNT = (__force kobject_action_t) 0x05, /* umount event for block devices (broken) */ | 46 | KOBJ_UMOUNT = (__force kobject_action_t) 0x05, /* umount event for block devices (broken) */ |
47 | KOBJ_OFFLINE = (__force kobject_action_t) 0x06, /* device offline */ | 47 | KOBJ_OFFLINE = (__force kobject_action_t) 0x06, /* device offline */ |
48 | KOBJ_ONLINE = (__force kobject_action_t) 0x07, /* device online */ | 48 | KOBJ_ONLINE = (__force kobject_action_t) 0x07, /* device online */ |
49 | KOBJ_UNDOCK = (__force kobject_action_t) 0x08, /* undocking */ | ||
50 | KOBJ_DOCK = (__force kobject_action_t) 0x09, /* dock */ | ||
49 | }; | 51 | }; |
50 | 52 | ||
51 | struct kobject { | 53 | struct kobject { |
@@ -190,6 +192,8 @@ struct subsystem _varname##_subsys = { \ | |||
190 | 192 | ||
191 | /* The global /sys/kernel/ subsystem for people to chain off of */ | 193 | /* The global /sys/kernel/ subsystem for people to chain off of */ |
192 | extern struct subsystem kernel_subsys; | 194 | extern struct subsystem kernel_subsys; |
195 | /* The global /sys/hypervisor/ subsystem */ | ||
196 | extern struct subsystem hypervisor_subsys; | ||
193 | 197 | ||
194 | /** | 198 | /** |
195 | * Helpers for setting the kset of registered objects. | 199 | * Helpers for setting the kset of registered objects. |
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index 778adc0fa640..8bf6702da2a0 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
@@ -29,7 +29,6 @@ | |||
29 | * <jkenisto@us.ibm.com> and Prasanna S Panchamukhi | 29 | * <jkenisto@us.ibm.com> and Prasanna S Panchamukhi |
30 | * <prasanna@in.ibm.com> added function-return probes. | 30 | * <prasanna@in.ibm.com> added function-return probes. |
31 | */ | 31 | */ |
32 | #include <linux/config.h> | ||
33 | #include <linux/list.h> | 32 | #include <linux/list.h> |
34 | #include <linux/notifier.h> | 33 | #include <linux/notifier.h> |
35 | #include <linux/smp.h> | 34 | #include <linux/smp.h> |
diff --git a/include/linux/kthread.h b/include/linux/kthread.h index ebdd41fd1082..7cce5dfa092f 100644 --- a/include/linux/kthread.h +++ b/include/linux/kthread.h | |||
@@ -4,37 +4,19 @@ | |||
4 | #include <linux/err.h> | 4 | #include <linux/err.h> |
5 | #include <linux/sched.h> | 5 | #include <linux/sched.h> |
6 | 6 | ||
7 | /** | ||
8 | * kthread_create: create a kthread. | ||
9 | * @threadfn: the function to run until signal_pending(current). | ||
10 | * @data: data ptr for @threadfn. | ||
11 | * @namefmt: printf-style name for the thread. | ||
12 | * | ||
13 | * Description: This helper function creates and names a kernel | ||
14 | * thread. The thread will be stopped: use wake_up_process() to start | ||
15 | * it. See also kthread_run(), kthread_create_on_cpu(). | ||
16 | * | ||
17 | * When woken, the thread will run @threadfn() with @data as its | ||
18 | * argument. @threadfn can either call do_exit() directly if it is a | ||
19 | * standalone thread for which noone will call kthread_stop(), or | ||
20 | * return when 'kthread_should_stop()' is true (which means | ||
21 | * kthread_stop() has been called). The return value should be zero | ||
22 | * or a negative error number: it will be passed to kthread_stop(). | ||
23 | * | ||
24 | * Returns a task_struct or ERR_PTR(-ENOMEM). | ||
25 | */ | ||
26 | struct task_struct *kthread_create(int (*threadfn)(void *data), | 7 | struct task_struct *kthread_create(int (*threadfn)(void *data), |
27 | void *data, | 8 | void *data, |
28 | const char namefmt[], ...); | 9 | const char namefmt[], ...); |
29 | 10 | ||
30 | /** | 11 | /** |
31 | * kthread_run: create and wake a thread. | 12 | * kthread_run - create and wake a thread. |
32 | * @threadfn: the function to run until signal_pending(current). | 13 | * @threadfn: the function to run until signal_pending(current). |
33 | * @data: data ptr for @threadfn. | 14 | * @data: data ptr for @threadfn. |
34 | * @namefmt: printf-style name for the thread. | 15 | * @namefmt: printf-style name for the thread. |
35 | * | 16 | * |
36 | * Description: Convenient wrapper for kthread_create() followed by | 17 | * Description: Convenient wrapper for kthread_create() followed by |
37 | * wake_up_process(). Returns the kthread, or ERR_PTR(-ENOMEM). */ | 18 | * wake_up_process(). Returns the kthread or ERR_PTR(-ENOMEM). |
19 | */ | ||
38 | #define kthread_run(threadfn, data, namefmt, ...) \ | 20 | #define kthread_run(threadfn, data, namefmt, ...) \ |
39 | ({ \ | 21 | ({ \ |
40 | struct task_struct *__k \ | 22 | struct task_struct *__k \ |
@@ -44,50 +26,9 @@ struct task_struct *kthread_create(int (*threadfn)(void *data), | |||
44 | __k; \ | 26 | __k; \ |
45 | }) | 27 | }) |
46 | 28 | ||
47 | /** | ||
48 | * kthread_bind: bind a just-created kthread to a cpu. | ||
49 | * @k: thread created by kthread_create(). | ||
50 | * @cpu: cpu (might not be online, must be possible) for @k to run on. | ||
51 | * | ||
52 | * Description: This function is equivalent to set_cpus_allowed(), | ||
53 | * except that @cpu doesn't need to be online, and the thread must be | ||
54 | * stopped (ie. just returned from kthread_create(). | ||
55 | */ | ||
56 | void kthread_bind(struct task_struct *k, unsigned int cpu); | 29 | void kthread_bind(struct task_struct *k, unsigned int cpu); |
57 | |||
58 | /** | ||
59 | * kthread_stop: stop a thread created by kthread_create(). | ||
60 | * @k: thread created by kthread_create(). | ||
61 | * | ||
62 | * Sets kthread_should_stop() for @k to return true, wakes it, and | ||
63 | * waits for it to exit. Your threadfn() must not call do_exit() | ||
64 | * itself if you use this function! This can also be called after | ||
65 | * kthread_create() instead of calling wake_up_process(): the thread | ||
66 | * will exit without calling threadfn(). | ||
67 | * | ||
68 | * Returns the result of threadfn(), or -EINTR if wake_up_process() | ||
69 | * was never called. */ | ||
70 | int kthread_stop(struct task_struct *k); | 30 | int kthread_stop(struct task_struct *k); |
71 | |||
72 | /** | ||
73 | * kthread_stop_sem: stop a thread created by kthread_create(). | ||
74 | * @k: thread created by kthread_create(). | ||
75 | * @s: semaphore that @k waits on while idle. | ||
76 | * | ||
77 | * Does essentially the same thing as kthread_stop() above, but wakes | ||
78 | * @k by calling up(@s). | ||
79 | * | ||
80 | * Returns the result of threadfn(), or -EINTR if wake_up_process() | ||
81 | * was never called. */ | ||
82 | int kthread_stop_sem(struct task_struct *k, struct semaphore *s); | 31 | int kthread_stop_sem(struct task_struct *k, struct semaphore *s); |
83 | |||
84 | /** | ||
85 | * kthread_should_stop: should this kthread return now? | ||
86 | * | ||
87 | * When someone calls kthread_stop on your kthread, it will be woken | ||
88 | * and this will return true. You should then return, and your return | ||
89 | * value will be passed through to kthread_stop(). | ||
90 | */ | ||
91 | int kthread_should_stop(void); | 32 | int kthread_should_stop(void); |
92 | 33 | ||
93 | #endif /* _LINUX_KTHREAD_H */ | 34 | #endif /* _LINUX_KTHREAD_H */ |
diff --git a/include/linux/ktime.h b/include/linux/ktime.h index 62bc57580707..ed3396dcc4f7 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h | |||
@@ -66,7 +66,6 @@ typedef union { | |||
66 | 66 | ||
67 | /** | 67 | /** |
68 | * ktime_set - Set a ktime_t variable from a seconds/nanoseconds value | 68 | * ktime_set - Set a ktime_t variable from a seconds/nanoseconds value |
69 | * | ||
70 | * @secs: seconds to set | 69 | * @secs: seconds to set |
71 | * @nsecs: nanoseconds to set | 70 | * @nsecs: nanoseconds to set |
72 | * | 71 | * |
@@ -138,7 +137,6 @@ static inline ktime_t ktime_set(const long secs, const unsigned long nsecs) | |||
138 | 137 | ||
139 | /** | 138 | /** |
140 | * ktime_sub - subtract two ktime_t variables | 139 | * ktime_sub - subtract two ktime_t variables |
141 | * | ||
142 | * @lhs: minuend | 140 | * @lhs: minuend |
143 | * @rhs: subtrahend | 141 | * @rhs: subtrahend |
144 | * | 142 | * |
@@ -157,7 +155,6 @@ static inline ktime_t ktime_sub(const ktime_t lhs, const ktime_t rhs) | |||
157 | 155 | ||
158 | /** | 156 | /** |
159 | * ktime_add - add two ktime_t variables | 157 | * ktime_add - add two ktime_t variables |
160 | * | ||
161 | * @add1: addend1 | 158 | * @add1: addend1 |
162 | * @add2: addend2 | 159 | * @add2: addend2 |
163 | * | 160 | * |
@@ -184,7 +181,6 @@ static inline ktime_t ktime_add(const ktime_t add1, const ktime_t add2) | |||
184 | 181 | ||
185 | /** | 182 | /** |
186 | * ktime_add_ns - Add a scalar nanoseconds value to a ktime_t variable | 183 | * ktime_add_ns - Add a scalar nanoseconds value to a ktime_t variable |
187 | * | ||
188 | * @kt: addend | 184 | * @kt: addend |
189 | * @nsec: the scalar nsec value to add | 185 | * @nsec: the scalar nsec value to add |
190 | * | 186 | * |
@@ -194,7 +190,6 @@ extern ktime_t ktime_add_ns(const ktime_t kt, u64 nsec); | |||
194 | 190 | ||
195 | /** | 191 | /** |
196 | * timespec_to_ktime - convert a timespec to ktime_t format | 192 | * timespec_to_ktime - convert a timespec to ktime_t format |
197 | * | ||
198 | * @ts: the timespec variable to convert | 193 | * @ts: the timespec variable to convert |
199 | * | 194 | * |
200 | * Returns a ktime_t variable with the converted timespec value | 195 | * Returns a ktime_t variable with the converted timespec value |
@@ -207,7 +202,6 @@ static inline ktime_t timespec_to_ktime(const struct timespec ts) | |||
207 | 202 | ||
208 | /** | 203 | /** |
209 | * timeval_to_ktime - convert a timeval to ktime_t format | 204 | * timeval_to_ktime - convert a timeval to ktime_t format |
210 | * | ||
211 | * @tv: the timeval variable to convert | 205 | * @tv: the timeval variable to convert |
212 | * | 206 | * |
213 | * Returns a ktime_t variable with the converted timeval value | 207 | * Returns a ktime_t variable with the converted timeval value |
@@ -220,7 +214,6 @@ static inline ktime_t timeval_to_ktime(const struct timeval tv) | |||
220 | 214 | ||
221 | /** | 215 | /** |
222 | * ktime_to_timespec - convert a ktime_t variable to timespec format | 216 | * ktime_to_timespec - convert a ktime_t variable to timespec format |
223 | * | ||
224 | * @kt: the ktime_t variable to convert | 217 | * @kt: the ktime_t variable to convert |
225 | * | 218 | * |
226 | * Returns the timespec representation of the ktime value | 219 | * Returns the timespec representation of the ktime value |
@@ -233,7 +226,6 @@ static inline struct timespec ktime_to_timespec(const ktime_t kt) | |||
233 | 226 | ||
234 | /** | 227 | /** |
235 | * ktime_to_timeval - convert a ktime_t variable to timeval format | 228 | * ktime_to_timeval - convert a ktime_t variable to timeval format |
236 | * | ||
237 | * @kt: the ktime_t variable to convert | 229 | * @kt: the ktime_t variable to convert |
238 | * | 230 | * |
239 | * Returns the timeval representation of the ktime value | 231 | * Returns the timeval representation of the ktime value |
diff --git a/include/linux/libata.h b/include/linux/libata.h index b80d2e7fa6d2..f4284bf89758 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -30,9 +30,11 @@ | |||
30 | #include <linux/interrupt.h> | 30 | #include <linux/interrupt.h> |
31 | #include <linux/pci.h> | 31 | #include <linux/pci.h> |
32 | #include <linux/dma-mapping.h> | 32 | #include <linux/dma-mapping.h> |
33 | #include <asm/scatterlist.h> | ||
33 | #include <asm/io.h> | 34 | #include <asm/io.h> |
34 | #include <linux/ata.h> | 35 | #include <linux/ata.h> |
35 | #include <linux/workqueue.h> | 36 | #include <linux/workqueue.h> |
37 | #include <scsi/scsi_host.h> | ||
36 | 38 | ||
37 | /* | 39 | /* |
38 | * compile-time options: to be removed as soon as all the drivers are | 40 | * compile-time options: to be removed as soon as all the drivers are |
@@ -44,7 +46,6 @@ | |||
44 | #undef ATA_NDEBUG /* define to disable quick runtime checks */ | 46 | #undef ATA_NDEBUG /* define to disable quick runtime checks */ |
45 | #undef ATA_ENABLE_PATA /* define to enable PATA support in some | 47 | #undef ATA_ENABLE_PATA /* define to enable PATA support in some |
46 | * low-level drivers */ | 48 | * low-level drivers */ |
47 | #undef ATAPI_ENABLE_DMADIR /* enables ATAPI DMADIR bridge support */ | ||
48 | 49 | ||
49 | 50 | ||
50 | /* note: prints function name for you */ | 51 | /* note: prints function name for you */ |
@@ -108,8 +109,11 @@ enum { | |||
108 | LIBATA_MAX_PRD = ATA_MAX_PRD / 2, | 109 | LIBATA_MAX_PRD = ATA_MAX_PRD / 2, |
109 | ATA_MAX_PORTS = 8, | 110 | ATA_MAX_PORTS = 8, |
110 | ATA_DEF_QUEUE = 1, | 111 | ATA_DEF_QUEUE = 1, |
111 | ATA_MAX_QUEUE = 1, | 112 | /* tag ATA_MAX_QUEUE - 1 is reserved for internal commands */ |
113 | ATA_MAX_QUEUE = 32, | ||
114 | ATA_TAG_INTERNAL = ATA_MAX_QUEUE - 1, | ||
112 | ATA_MAX_SECTORS = 200, /* FIXME */ | 115 | ATA_MAX_SECTORS = 200, /* FIXME */ |
116 | ATA_MAX_SECTORS_LBA48 = 65535, | ||
113 | ATA_MAX_BUS = 2, | 117 | ATA_MAX_BUS = 2, |
114 | ATA_DEF_BUSY_WAIT = 10000, | 118 | ATA_DEF_BUSY_WAIT = 10000, |
115 | ATA_SHORT_PAUSE = (HZ >> 6) + 1, | 119 | ATA_SHORT_PAUSE = (HZ >> 6) + 1, |
@@ -120,9 +124,17 @@ enum { | |||
120 | ATA_SHT_USE_CLUSTERING = 1, | 124 | ATA_SHT_USE_CLUSTERING = 1, |
121 | 125 | ||
122 | /* struct ata_device stuff */ | 126 | /* struct ata_device stuff */ |
123 | ATA_DFLAG_LBA48 = (1 << 0), /* device supports LBA48 */ | 127 | ATA_DFLAG_LBA = (1 << 0), /* device supports LBA */ |
124 | ATA_DFLAG_PIO = (1 << 1), /* device currently in PIO mode */ | 128 | ATA_DFLAG_LBA48 = (1 << 1), /* device supports LBA48 */ |
125 | ATA_DFLAG_LBA = (1 << 2), /* device supports LBA */ | 129 | ATA_DFLAG_CDB_INTR = (1 << 2), /* device asserts INTRQ when ready for CDB */ |
130 | ATA_DFLAG_NCQ = (1 << 3), /* device supports NCQ */ | ||
131 | ATA_DFLAG_CFG_MASK = (1 << 8) - 1, | ||
132 | |||
133 | ATA_DFLAG_PIO = (1 << 8), /* device currently in PIO mode */ | ||
134 | ATA_DFLAG_INIT_MASK = (1 << 16) - 1, | ||
135 | |||
136 | ATA_DFLAG_DETACH = (1 << 16), | ||
137 | ATA_DFLAG_DETACHED = (1 << 17), | ||
126 | 138 | ||
127 | ATA_DEV_UNKNOWN = 0, /* unknown device */ | 139 | ATA_DEV_UNKNOWN = 0, /* unknown device */ |
128 | ATA_DEV_ATA = 1, /* ATA device */ | 140 | ATA_DEV_ATA = 1, /* ATA device */ |
@@ -132,43 +144,57 @@ enum { | |||
132 | ATA_DEV_NONE = 5, /* no device */ | 144 | ATA_DEV_NONE = 5, /* no device */ |
133 | 145 | ||
134 | /* struct ata_port flags */ | 146 | /* struct ata_port flags */ |
135 | ATA_FLAG_SLAVE_POSS = (1 << 1), /* host supports slave dev */ | 147 | ATA_FLAG_SLAVE_POSS = (1 << 0), /* host supports slave dev */ |
136 | /* (doesn't imply presence) */ | 148 | /* (doesn't imply presence) */ |
137 | ATA_FLAG_PORT_DISABLED = (1 << 2), /* port is disabled, ignore it */ | 149 | ATA_FLAG_SATA = (1 << 1), |
138 | ATA_FLAG_SATA = (1 << 3), | 150 | ATA_FLAG_NO_LEGACY = (1 << 2), /* no legacy mode check */ |
139 | ATA_FLAG_NO_LEGACY = (1 << 4), /* no legacy mode check */ | 151 | ATA_FLAG_MMIO = (1 << 3), /* use MMIO, not PIO */ |
140 | ATA_FLAG_SRST = (1 << 5), /* (obsolete) use ATA SRST, not E.D.D. */ | 152 | ATA_FLAG_SRST = (1 << 4), /* (obsolete) use ATA SRST, not E.D.D. */ |
141 | ATA_FLAG_MMIO = (1 << 6), /* use MMIO, not PIO */ | 153 | ATA_FLAG_SATA_RESET = (1 << 5), /* (obsolete) use COMRESET */ |
142 | ATA_FLAG_SATA_RESET = (1 << 7), /* (obsolete) use COMRESET */ | 154 | ATA_FLAG_NO_ATAPI = (1 << 6), /* No ATAPI support */ |
143 | ATA_FLAG_PIO_DMA = (1 << 8), /* PIO cmds via DMA */ | 155 | ATA_FLAG_PIO_DMA = (1 << 7), /* PIO cmds via DMA */ |
144 | ATA_FLAG_NOINTR = (1 << 9), /* FIXME: Remove this once | 156 | ATA_FLAG_PIO_LBA48 = (1 << 8), /* Host DMA engine is LBA28 only */ |
145 | * proper HSM is in place. */ | 157 | ATA_FLAG_PIO_POLLING = (1 << 9), /* use polling PIO if LLD |
146 | ATA_FLAG_DEBUGMSG = (1 << 10), | 158 | * doesn't handle PIO interrupts */ |
147 | ATA_FLAG_NO_ATAPI = (1 << 11), /* No ATAPI support */ | 159 | ATA_FLAG_NCQ = (1 << 10), /* host supports NCQ */ |
148 | 160 | ATA_FLAG_HRST_TO_RESUME = (1 << 11), /* hardreset to resume phy */ | |
149 | ATA_FLAG_SUSPENDED = (1 << 12), /* port is suspended */ | 161 | ATA_FLAG_SKIP_D2H_BSY = (1 << 12), /* can't wait for the first D2H |
150 | 162 | * Register FIS clearing BSY */ | |
151 | ATA_FLAG_PIO_LBA48 = (1 << 13), /* Host DMA engine is LBA28 only */ | 163 | |
152 | ATA_FLAG_IRQ_MASK = (1 << 14), /* Mask IRQ in PIO xfers */ | 164 | ATA_FLAG_DEBUGMSG = (1 << 13), |
153 | 165 | ATA_FLAG_FLUSH_PORT_TASK = (1 << 14), /* flush port task */ | |
154 | ATA_FLAG_FLUSH_PORT_TASK = (1 << 15), /* Flush port task */ | 166 | |
155 | ATA_FLAG_IN_EH = (1 << 16), /* EH in progress */ | 167 | ATA_FLAG_EH_PENDING = (1 << 15), /* EH pending */ |
156 | 168 | ATA_FLAG_EH_IN_PROGRESS = (1 << 16), /* EH in progress */ | |
157 | ATA_QCFLAG_ACTIVE = (1 << 1), /* cmd not yet ack'd to scsi lyer */ | 169 | ATA_FLAG_FROZEN = (1 << 17), /* port is frozen */ |
158 | ATA_QCFLAG_SG = (1 << 3), /* have s/g table? */ | 170 | ATA_FLAG_RECOVERED = (1 << 18), /* recovery action performed */ |
159 | ATA_QCFLAG_SINGLE = (1 << 4), /* no s/g, just a single buffer */ | 171 | ATA_FLAG_LOADING = (1 << 19), /* boot/loading probe */ |
172 | ATA_FLAG_UNLOADING = (1 << 20), /* module is unloading */ | ||
173 | ATA_FLAG_SCSI_HOTPLUG = (1 << 21), /* SCSI hotplug scheduled */ | ||
174 | |||
175 | ATA_FLAG_DISABLED = (1 << 22), /* port is disabled, ignore it */ | ||
176 | ATA_FLAG_SUSPENDED = (1 << 23), /* port is suspended (power) */ | ||
177 | |||
178 | /* bits 24:31 of ap->flags are reserved for LLDD specific flags */ | ||
179 | |||
180 | /* struct ata_queued_cmd flags */ | ||
181 | ATA_QCFLAG_ACTIVE = (1 << 0), /* cmd not yet ack'd to scsi lyer */ | ||
182 | ATA_QCFLAG_SG = (1 << 1), /* have s/g table? */ | ||
183 | ATA_QCFLAG_SINGLE = (1 << 2), /* no s/g, just a single buffer */ | ||
160 | ATA_QCFLAG_DMAMAP = ATA_QCFLAG_SG | ATA_QCFLAG_SINGLE, | 184 | ATA_QCFLAG_DMAMAP = ATA_QCFLAG_SG | ATA_QCFLAG_SINGLE, |
161 | ATA_QCFLAG_EH_SCHEDULED = (1 << 5), /* EH scheduled */ | 185 | ATA_QCFLAG_IO = (1 << 3), /* standard IO command */ |
186 | ATA_QCFLAG_RESULT_TF = (1 << 4), /* result TF requested */ | ||
187 | |||
188 | ATA_QCFLAG_FAILED = (1 << 16), /* cmd failed and is owned by EH */ | ||
189 | ATA_QCFLAG_SENSE_VALID = (1 << 17), /* sense data valid */ | ||
190 | ATA_QCFLAG_EH_SCHEDULED = (1 << 18), /* EH scheduled (obsolete) */ | ||
162 | 191 | ||
163 | /* host set flags */ | 192 | /* host set flags */ |
164 | ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host_set only */ | 193 | ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host_set only */ |
165 | 194 | ||
166 | /* various lengths of time */ | 195 | /* various lengths of time */ |
167 | ATA_TMOUT_PIO = 30 * HZ, | ||
168 | ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */ | 196 | ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */ |
169 | ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */ | 197 | ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */ |
170 | ATA_TMOUT_CDB = 30 * HZ, | ||
171 | ATA_TMOUT_CDB_QUICK = 5 * HZ, | ||
172 | ATA_TMOUT_INTERNAL = 30 * HZ, | 198 | ATA_TMOUT_INTERNAL = 30 * HZ, |
173 | ATA_TMOUT_INTERNAL_QUICK = 5 * HZ, | 199 | ATA_TMOUT_INTERNAL_QUICK = 5 * HZ, |
174 | 200 | ||
@@ -207,21 +233,56 @@ enum { | |||
207 | /* size of buffer to pad xfers ending on unaligned boundaries */ | 233 | /* size of buffer to pad xfers ending on unaligned boundaries */ |
208 | ATA_DMA_PAD_SZ = 4, | 234 | ATA_DMA_PAD_SZ = 4, |
209 | ATA_DMA_PAD_BUF_SZ = ATA_DMA_PAD_SZ * ATA_MAX_QUEUE, | 235 | ATA_DMA_PAD_BUF_SZ = ATA_DMA_PAD_SZ * ATA_MAX_QUEUE, |
210 | 236 | ||
211 | /* Masks for port functions */ | 237 | /* masks for port functions */ |
212 | ATA_PORT_PRIMARY = (1 << 0), | 238 | ATA_PORT_PRIMARY = (1 << 0), |
213 | ATA_PORT_SECONDARY = (1 << 1), | 239 | ATA_PORT_SECONDARY = (1 << 1), |
240 | |||
241 | /* ering size */ | ||
242 | ATA_ERING_SIZE = 32, | ||
243 | |||
244 | /* desc_len for ata_eh_info and context */ | ||
245 | ATA_EH_DESC_LEN = 80, | ||
246 | |||
247 | /* reset / recovery action types */ | ||
248 | ATA_EH_REVALIDATE = (1 << 0), | ||
249 | ATA_EH_SOFTRESET = (1 << 1), | ||
250 | ATA_EH_HARDRESET = (1 << 2), | ||
251 | |||
252 | ATA_EH_RESET_MASK = ATA_EH_SOFTRESET | ATA_EH_HARDRESET, | ||
253 | ATA_EH_PERDEV_MASK = ATA_EH_REVALIDATE, | ||
254 | |||
255 | /* ata_eh_info->flags */ | ||
256 | ATA_EHI_HOTPLUGGED = (1 << 0), /* could have been hotplugged */ | ||
257 | |||
258 | ATA_EHI_DID_RESET = (1 << 16), /* already reset this port */ | ||
259 | |||
260 | /* max repeat if error condition is still set after ->error_handler */ | ||
261 | ATA_EH_MAX_REPEAT = 5, | ||
262 | |||
263 | /* how hard are we gonna try to probe/recover devices */ | ||
264 | ATA_PROBE_MAX_TRIES = 3, | ||
265 | ATA_EH_RESET_TRIES = 3, | ||
266 | ATA_EH_DEV_TRIES = 3, | ||
267 | |||
268 | /* Drive spinup time (time from power-on to the first D2H FIS) | ||
269 | * in msecs - 8s currently. Failing to get ready in this time | ||
270 | * isn't critical. It will result in reset failure for | ||
271 | * controllers which can't wait for the first D2H FIS. libata | ||
272 | * will retry, so it just has to be long enough to spin up | ||
273 | * most devices. | ||
274 | */ | ||
275 | ATA_SPINUP_WAIT = 8000, | ||
214 | }; | 276 | }; |
215 | 277 | ||
216 | enum hsm_task_states { | 278 | enum hsm_task_states { |
217 | HSM_ST_UNKNOWN, | 279 | HSM_ST_UNKNOWN, /* state unknown */ |
218 | HSM_ST_IDLE, | 280 | HSM_ST_IDLE, /* no command on going */ |
219 | HSM_ST_POLL, | 281 | HSM_ST, /* (waiting the device to) transfer data */ |
220 | HSM_ST_TMOUT, | 282 | HSM_ST_LAST, /* (waiting the device to) complete command */ |
221 | HSM_ST, | 283 | HSM_ST_ERR, /* error */ |
222 | HSM_ST_LAST, | 284 | HSM_ST_FIRST, /* (waiting the device to) |
223 | HSM_ST_LAST_POLL, | 285 | write CDB or first data block */ |
224 | HSM_ST_ERR, | ||
225 | }; | 286 | }; |
226 | 287 | ||
227 | enum ata_completion_errors { | 288 | enum ata_completion_errors { |
@@ -244,9 +305,9 @@ struct ata_queued_cmd; | |||
244 | 305 | ||
245 | /* typedefs */ | 306 | /* typedefs */ |
246 | typedef void (*ata_qc_cb_t) (struct ata_queued_cmd *qc); | 307 | typedef void (*ata_qc_cb_t) (struct ata_queued_cmd *qc); |
247 | typedef void (*ata_probeinit_fn_t)(struct ata_port *); | 308 | typedef int (*ata_prereset_fn_t)(struct ata_port *ap); |
248 | typedef int (*ata_reset_fn_t)(struct ata_port *, int, unsigned int *); | 309 | typedef int (*ata_reset_fn_t)(struct ata_port *ap, unsigned int *classes); |
249 | typedef void (*ata_postreset_fn_t)(struct ata_port *ap, unsigned int *); | 310 | typedef void (*ata_postreset_fn_t)(struct ata_port *ap, unsigned int *classes); |
250 | 311 | ||
251 | struct ata_ioports { | 312 | struct ata_ioports { |
252 | unsigned long cmd_addr; | 313 | unsigned long cmd_addr; |
@@ -297,7 +358,8 @@ struct ata_host_set { | |||
297 | unsigned long flags; | 358 | unsigned long flags; |
298 | int simplex_claimed; /* Keep seperate in case we | 359 | int simplex_claimed; /* Keep seperate in case we |
299 | ever need to do this locked */ | 360 | ever need to do this locked */ |
300 | struct ata_port * ports[0]; | 361 | struct ata_host_set *next; /* for legacy mode */ |
362 | struct ata_port *ports[0]; | ||
301 | }; | 363 | }; |
302 | 364 | ||
303 | struct ata_queued_cmd { | 365 | struct ata_queued_cmd { |
@@ -336,7 +398,7 @@ struct ata_queued_cmd { | |||
336 | struct scatterlist *__sg; | 398 | struct scatterlist *__sg; |
337 | 399 | ||
338 | unsigned int err_mask; | 400 | unsigned int err_mask; |
339 | 401 | struct ata_taskfile result_tf; | |
340 | ata_qc_cb_t complete_fn; | 402 | ata_qc_cb_t complete_fn; |
341 | 403 | ||
342 | void *private_data; | 404 | void *private_data; |
@@ -348,12 +410,26 @@ struct ata_host_stats { | |||
348 | unsigned long rw_reqbuf; | 410 | unsigned long rw_reqbuf; |
349 | }; | 411 | }; |
350 | 412 | ||
413 | struct ata_ering_entry { | ||
414 | int is_io; | ||
415 | unsigned int err_mask; | ||
416 | u64 timestamp; | ||
417 | }; | ||
418 | |||
419 | struct ata_ering { | ||
420 | int cursor; | ||
421 | struct ata_ering_entry ring[ATA_ERING_SIZE]; | ||
422 | }; | ||
423 | |||
351 | struct ata_device { | 424 | struct ata_device { |
352 | u64 n_sectors; /* size of device, if ATA */ | 425 | struct ata_port *ap; |
426 | unsigned int devno; /* 0 or 1 */ | ||
353 | unsigned long flags; /* ATA_DFLAG_xxx */ | 427 | unsigned long flags; /* ATA_DFLAG_xxx */ |
428 | struct scsi_device *sdev; /* attached SCSI device */ | ||
429 | /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */ | ||
430 | u64 n_sectors; /* size of device, if ATA */ | ||
354 | unsigned int class; /* ATA_DEV_xxx */ | 431 | unsigned int class; /* ATA_DEV_xxx */ |
355 | unsigned int devno; /* 0 or 1 */ | 432 | u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */ |
356 | u16 *id; /* IDENTIFY xxx DEVICE data */ | ||
357 | u8 pio_mode; | 433 | u8 pio_mode; |
358 | u8 dma_mode; | 434 | u8 dma_mode; |
359 | u8 xfer_mode; | 435 | u8 xfer_mode; |
@@ -373,11 +449,42 @@ struct ata_device { | |||
373 | u16 cylinders; /* Number of cylinders */ | 449 | u16 cylinders; /* Number of cylinders */ |
374 | u16 heads; /* Number of heads */ | 450 | u16 heads; /* Number of heads */ |
375 | u16 sectors; /* Number of sectors per track */ | 451 | u16 sectors; /* Number of sectors per track */ |
452 | |||
453 | /* error history */ | ||
454 | struct ata_ering ering; | ||
455 | }; | ||
456 | |||
457 | /* Offset into struct ata_device. Fields above it are maintained | ||
458 | * acress device init. Fields below are zeroed. | ||
459 | */ | ||
460 | #define ATA_DEVICE_CLEAR_OFFSET offsetof(struct ata_device, n_sectors) | ||
461 | |||
462 | struct ata_eh_info { | ||
463 | struct ata_device *dev; /* offending device */ | ||
464 | u32 serror; /* SError from LLDD */ | ||
465 | unsigned int err_mask; /* port-wide err_mask */ | ||
466 | unsigned int action; /* ATA_EH_* action mask */ | ||
467 | unsigned int dev_action[ATA_MAX_DEVICES]; /* dev EH action */ | ||
468 | unsigned int flags; /* ATA_EHI_* flags */ | ||
469 | |||
470 | unsigned long hotplug_timestamp; | ||
471 | unsigned int probe_mask; | ||
472 | |||
473 | char desc[ATA_EH_DESC_LEN]; | ||
474 | int desc_len; | ||
475 | }; | ||
476 | |||
477 | struct ata_eh_context { | ||
478 | struct ata_eh_info i; | ||
479 | int tries[ATA_MAX_DEVICES]; | ||
480 | unsigned int classes[ATA_MAX_DEVICES]; | ||
481 | unsigned int did_probe_mask; | ||
376 | }; | 482 | }; |
377 | 483 | ||
378 | struct ata_port { | 484 | struct ata_port { |
379 | struct Scsi_Host *host; /* our co-allocated scsi host */ | 485 | struct Scsi_Host *host; /* our co-allocated scsi host */ |
380 | const struct ata_port_operations *ops; | 486 | const struct ata_port_operations *ops; |
487 | spinlock_t *lock; | ||
381 | unsigned long flags; /* ATA_FLAG_xxx */ | 488 | unsigned long flags; /* ATA_FLAG_xxx */ |
382 | unsigned int id; /* unique id req'd by scsi midlyr */ | 489 | unsigned int id; /* unique id req'd by scsi midlyr */ |
383 | unsigned int port_no; /* unique port #; from zero */ | 490 | unsigned int port_no; /* unique port #; from zero */ |
@@ -397,26 +504,40 @@ struct ata_port { | |||
397 | unsigned int mwdma_mask; | 504 | unsigned int mwdma_mask; |
398 | unsigned int udma_mask; | 505 | unsigned int udma_mask; |
399 | unsigned int cbl; /* cable type; ATA_CBL_xxx */ | 506 | unsigned int cbl; /* cable type; ATA_CBL_xxx */ |
507 | unsigned int hw_sata_spd_limit; | ||
508 | unsigned int sata_spd_limit; /* SATA PHY speed limit */ | ||
509 | |||
510 | /* record runtime error info, protected by host_set lock */ | ||
511 | struct ata_eh_info eh_info; | ||
512 | /* EH context owned by EH */ | ||
513 | struct ata_eh_context eh_context; | ||
400 | 514 | ||
401 | struct ata_device device[ATA_MAX_DEVICES]; | 515 | struct ata_device device[ATA_MAX_DEVICES]; |
402 | 516 | ||
403 | struct ata_queued_cmd qcmd[ATA_MAX_QUEUE]; | 517 | struct ata_queued_cmd qcmd[ATA_MAX_QUEUE]; |
404 | unsigned long qactive; | 518 | unsigned long qc_allocated; |
519 | unsigned int qc_active; | ||
520 | |||
405 | unsigned int active_tag; | 521 | unsigned int active_tag; |
522 | u32 sactive; | ||
406 | 523 | ||
407 | struct ata_host_stats stats; | 524 | struct ata_host_stats stats; |
408 | struct ata_host_set *host_set; | 525 | struct ata_host_set *host_set; |
409 | struct device *dev; | 526 | struct device *dev; |
410 | 527 | ||
411 | struct work_struct port_task; | 528 | struct work_struct port_task; |
529 | struct work_struct hotplug_task; | ||
530 | struct work_struct scsi_rescan_task; | ||
412 | 531 | ||
413 | unsigned int hsm_task_state; | 532 | unsigned int hsm_task_state; |
414 | unsigned long pio_task_timeout; | ||
415 | 533 | ||
416 | u32 msg_enable; | 534 | u32 msg_enable; |
417 | struct list_head eh_done_q; | 535 | struct list_head eh_done_q; |
536 | wait_queue_head_t eh_wait_q; | ||
418 | 537 | ||
419 | void *private_data; | 538 | void *private_data; |
539 | |||
540 | u8 sector_buf[ATA_SECT_SIZE]; /* owned by EH */ | ||
420 | }; | 541 | }; |
421 | 542 | ||
422 | struct ata_port_operations { | 543 | struct ata_port_operations { |
@@ -438,7 +559,6 @@ struct ata_port_operations { | |||
438 | 559 | ||
439 | void (*phy_reset) (struct ata_port *ap); /* obsolete */ | 560 | void (*phy_reset) (struct ata_port *ap); /* obsolete */ |
440 | void (*set_mode) (struct ata_port *ap); | 561 | void (*set_mode) (struct ata_port *ap); |
441 | int (*probe_reset) (struct ata_port *ap, unsigned int *classes); | ||
442 | 562 | ||
443 | void (*post_set_mode) (struct ata_port *ap); | 563 | void (*post_set_mode) (struct ata_port *ap); |
444 | 564 | ||
@@ -447,10 +567,20 @@ struct ata_port_operations { | |||
447 | void (*bmdma_setup) (struct ata_queued_cmd *qc); | 567 | void (*bmdma_setup) (struct ata_queued_cmd *qc); |
448 | void (*bmdma_start) (struct ata_queued_cmd *qc); | 568 | void (*bmdma_start) (struct ata_queued_cmd *qc); |
449 | 569 | ||
570 | void (*data_xfer) (struct ata_device *, unsigned char *, unsigned int, int); | ||
571 | |||
450 | void (*qc_prep) (struct ata_queued_cmd *qc); | 572 | void (*qc_prep) (struct ata_queued_cmd *qc); |
451 | unsigned int (*qc_issue) (struct ata_queued_cmd *qc); | 573 | unsigned int (*qc_issue) (struct ata_queued_cmd *qc); |
452 | 574 | ||
453 | void (*eng_timeout) (struct ata_port *ap); | 575 | /* Error handlers. ->error_handler overrides ->eng_timeout and |
576 | * indicates that new-style EH is in place. | ||
577 | */ | ||
578 | void (*eng_timeout) (struct ata_port *ap); /* obsolete */ | ||
579 | |||
580 | void (*freeze) (struct ata_port *ap); | ||
581 | void (*thaw) (struct ata_port *ap); | ||
582 | void (*error_handler) (struct ata_port *ap); | ||
583 | void (*post_internal_cmd) (struct ata_queued_cmd *qc); | ||
454 | 584 | ||
455 | irqreturn_t (*irq_handler)(int, void *, struct pt_regs *); | 585 | irqreturn_t (*irq_handler)(int, void *, struct pt_regs *); |
456 | void (*irq_clear) (struct ata_port *); | 586 | void (*irq_clear) (struct ata_port *); |
@@ -492,22 +622,22 @@ struct ata_timing { | |||
492 | 622 | ||
493 | #define FIT(v,vmin,vmax) max_t(short,min_t(short,v,vmax),vmin) | 623 | #define FIT(v,vmin,vmax) max_t(short,min_t(short,v,vmax),vmin) |
494 | 624 | ||
625 | extern const unsigned long sata_deb_timing_boot[]; | ||
626 | extern const unsigned long sata_deb_timing_eh[]; | ||
627 | extern const unsigned long sata_deb_timing_before_fsrst[]; | ||
628 | |||
495 | extern void ata_port_probe(struct ata_port *); | 629 | extern void ata_port_probe(struct ata_port *); |
496 | extern void __sata_phy_reset(struct ata_port *ap); | 630 | extern void __sata_phy_reset(struct ata_port *ap); |
497 | extern void sata_phy_reset(struct ata_port *ap); | 631 | extern void sata_phy_reset(struct ata_port *ap); |
498 | extern void ata_bus_reset(struct ata_port *ap); | 632 | extern void ata_bus_reset(struct ata_port *ap); |
499 | extern int ata_drive_probe_reset(struct ata_port *ap, | 633 | extern int sata_set_spd(struct ata_port *ap); |
500 | ata_probeinit_fn_t probeinit, | 634 | extern int sata_phy_debounce(struct ata_port *ap, const unsigned long *param); |
501 | ata_reset_fn_t softreset, ata_reset_fn_t hardreset, | 635 | extern int sata_phy_resume(struct ata_port *ap, const unsigned long *param); |
502 | ata_postreset_fn_t postreset, unsigned int *classes); | 636 | extern int ata_std_prereset(struct ata_port *ap); |
503 | extern void ata_std_probeinit(struct ata_port *ap); | 637 | extern int ata_std_softreset(struct ata_port *ap, unsigned int *classes); |
504 | extern int ata_std_softreset(struct ata_port *ap, int verbose, | 638 | extern int sata_std_hardreset(struct ata_port *ap, unsigned int *class); |
505 | unsigned int *classes); | ||
506 | extern int sata_std_hardreset(struct ata_port *ap, int verbose, | ||
507 | unsigned int *class); | ||
508 | extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes); | 639 | extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes); |
509 | extern int ata_dev_revalidate(struct ata_port *ap, struct ata_device *dev, | 640 | extern int ata_dev_revalidate(struct ata_device *dev, int post_reset); |
510 | int post_reset); | ||
511 | extern void ata_port_disable(struct ata_port *); | 641 | extern void ata_port_disable(struct ata_port *); |
512 | extern void ata_std_ports(struct ata_ioports *ioaddr); | 642 | extern void ata_std_ports(struct ata_ioports *ioaddr); |
513 | #ifdef CONFIG_PCI | 643 | #ifdef CONFIG_PCI |
@@ -519,24 +649,32 @@ extern int ata_pci_device_resume(struct pci_dev *pdev); | |||
519 | extern int ata_pci_clear_simplex(struct pci_dev *pdev); | 649 | extern int ata_pci_clear_simplex(struct pci_dev *pdev); |
520 | #endif /* CONFIG_PCI */ | 650 | #endif /* CONFIG_PCI */ |
521 | extern int ata_device_add(const struct ata_probe_ent *ent); | 651 | extern int ata_device_add(const struct ata_probe_ent *ent); |
652 | extern void ata_port_detach(struct ata_port *ap); | ||
522 | extern void ata_host_set_remove(struct ata_host_set *host_set); | 653 | extern void ata_host_set_remove(struct ata_host_set *host_set); |
523 | extern int ata_scsi_detect(struct scsi_host_template *sht); | 654 | extern int ata_scsi_detect(struct scsi_host_template *sht); |
524 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); | 655 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); |
525 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); | 656 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); |
526 | extern void ata_eh_qc_complete(struct ata_queued_cmd *qc); | ||
527 | extern void ata_eh_qc_retry(struct ata_queued_cmd *qc); | ||
528 | extern int ata_scsi_release(struct Scsi_Host *host); | 657 | extern int ata_scsi_release(struct Scsi_Host *host); |
529 | extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); | 658 | extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); |
659 | extern int sata_scr_valid(struct ata_port *ap); | ||
660 | extern int sata_scr_read(struct ata_port *ap, int reg, u32 *val); | ||
661 | extern int sata_scr_write(struct ata_port *ap, int reg, u32 val); | ||
662 | extern int sata_scr_write_flush(struct ata_port *ap, int reg, u32 val); | ||
663 | extern int ata_port_online(struct ata_port *ap); | ||
664 | extern int ata_port_offline(struct ata_port *ap); | ||
530 | extern int ata_scsi_device_resume(struct scsi_device *); | 665 | extern int ata_scsi_device_resume(struct scsi_device *); |
531 | extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t state); | 666 | extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t state); |
532 | extern int ata_device_resume(struct ata_port *, struct ata_device *); | 667 | extern int ata_device_resume(struct ata_device *); |
533 | extern int ata_device_suspend(struct ata_port *, struct ata_device *, pm_message_t state); | 668 | extern int ata_device_suspend(struct ata_device *, pm_message_t state); |
534 | extern int ata_ratelimit(void); | 669 | extern int ata_ratelimit(void); |
535 | extern unsigned int ata_busy_sleep(struct ata_port *ap, | 670 | extern unsigned int ata_busy_sleep(struct ata_port *ap, |
536 | unsigned long timeout_pat, | 671 | unsigned long timeout_pat, |
537 | unsigned long timeout); | 672 | unsigned long timeout); |
538 | extern void ata_port_queue_task(struct ata_port *ap, void (*fn)(void *), | 673 | extern void ata_port_queue_task(struct ata_port *ap, void (*fn)(void *), |
539 | void *data, unsigned long delay); | 674 | void *data, unsigned long delay); |
675 | extern u32 ata_wait_register(void __iomem *reg, u32 mask, u32 val, | ||
676 | unsigned long interval_msec, | ||
677 | unsigned long timeout_msec); | ||
540 | 678 | ||
541 | /* | 679 | /* |
542 | * Default driver ops implementations | 680 | * Default driver ops implementations |
@@ -550,11 +688,16 @@ extern void ata_std_dev_select (struct ata_port *ap, unsigned int device); | |||
550 | extern u8 ata_check_status(struct ata_port *ap); | 688 | extern u8 ata_check_status(struct ata_port *ap); |
551 | extern u8 ata_altstatus(struct ata_port *ap); | 689 | extern u8 ata_altstatus(struct ata_port *ap); |
552 | extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf); | 690 | extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf); |
553 | extern int ata_std_probe_reset(struct ata_port *ap, unsigned int *classes); | ||
554 | extern int ata_port_start (struct ata_port *ap); | 691 | extern int ata_port_start (struct ata_port *ap); |
555 | extern void ata_port_stop (struct ata_port *ap); | 692 | extern void ata_port_stop (struct ata_port *ap); |
556 | extern void ata_host_stop (struct ata_host_set *host_set); | 693 | extern void ata_host_stop (struct ata_host_set *host_set); |
557 | extern irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs); | 694 | extern irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs); |
695 | extern void ata_mmio_data_xfer(struct ata_device *adev, unsigned char *buf, | ||
696 | unsigned int buflen, int write_data); | ||
697 | extern void ata_pio_data_xfer(struct ata_device *adev, unsigned char *buf, | ||
698 | unsigned int buflen, int write_data); | ||
699 | extern void ata_pio_data_xfer_noirq(struct ata_device *adev, unsigned char *buf, | ||
700 | unsigned int buflen, int write_data); | ||
558 | extern void ata_qc_prep(struct ata_queued_cmd *qc); | 701 | extern void ata_qc_prep(struct ata_queued_cmd *qc); |
559 | extern void ata_noop_qc_prep(struct ata_queued_cmd *qc); | 702 | extern void ata_noop_qc_prep(struct ata_queued_cmd *qc); |
560 | extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc); | 703 | extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc); |
@@ -572,17 +715,29 @@ extern void ata_bmdma_start (struct ata_queued_cmd *qc); | |||
572 | extern void ata_bmdma_stop(struct ata_queued_cmd *qc); | 715 | extern void ata_bmdma_stop(struct ata_queued_cmd *qc); |
573 | extern u8 ata_bmdma_status(struct ata_port *ap); | 716 | extern u8 ata_bmdma_status(struct ata_port *ap); |
574 | extern void ata_bmdma_irq_clear(struct ata_port *ap); | 717 | extern void ata_bmdma_irq_clear(struct ata_port *ap); |
575 | extern void __ata_qc_complete(struct ata_queued_cmd *qc); | 718 | extern void ata_bmdma_freeze(struct ata_port *ap); |
576 | extern void ata_eng_timeout(struct ata_port *ap); | 719 | extern void ata_bmdma_thaw(struct ata_port *ap); |
577 | extern void ata_scsi_simulate(struct ata_port *ap, struct ata_device *dev, | 720 | extern void ata_bmdma_drive_eh(struct ata_port *ap, ata_prereset_fn_t prereset, |
578 | struct scsi_cmnd *cmd, | 721 | ata_reset_fn_t softreset, |
722 | ata_reset_fn_t hardreset, | ||
723 | ata_postreset_fn_t postreset); | ||
724 | extern void ata_bmdma_error_handler(struct ata_port *ap); | ||
725 | extern void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc); | ||
726 | extern int ata_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc, | ||
727 | u8 status, int in_wq); | ||
728 | extern void ata_qc_complete(struct ata_queued_cmd *qc); | ||
729 | extern int ata_qc_complete_multiple(struct ata_port *ap, u32 qc_active, | ||
730 | void (*finish_qc)(struct ata_queued_cmd *)); | ||
731 | extern void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd, | ||
579 | void (*done)(struct scsi_cmnd *)); | 732 | void (*done)(struct scsi_cmnd *)); |
580 | extern int ata_std_bios_param(struct scsi_device *sdev, | 733 | extern int ata_std_bios_param(struct scsi_device *sdev, |
581 | struct block_device *bdev, | 734 | struct block_device *bdev, |
582 | sector_t capacity, int geom[]); | 735 | sector_t capacity, int geom[]); |
583 | extern int ata_scsi_slave_config(struct scsi_device *sdev); | 736 | extern int ata_scsi_slave_config(struct scsi_device *sdev); |
584 | extern struct ata_device *ata_dev_pair(struct ata_port *ap, | 737 | extern void ata_scsi_slave_destroy(struct scsi_device *sdev); |
585 | struct ata_device *adev); | 738 | extern int ata_scsi_change_queue_depth(struct scsi_device *sdev, |
739 | int queue_depth); | ||
740 | extern struct ata_device *ata_dev_pair(struct ata_device *adev); | ||
586 | 741 | ||
587 | /* | 742 | /* |
588 | * Timing helpers | 743 | * Timing helpers |
@@ -628,7 +783,64 @@ extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bit | |||
628 | extern unsigned long ata_pci_default_filter(const struct ata_port *, struct ata_device *, unsigned long); | 783 | extern unsigned long ata_pci_default_filter(const struct ata_port *, struct ata_device *, unsigned long); |
629 | #endif /* CONFIG_PCI */ | 784 | #endif /* CONFIG_PCI */ |
630 | 785 | ||
786 | /* | ||
787 | * EH | ||
788 | */ | ||
789 | extern void ata_eng_timeout(struct ata_port *ap); | ||
790 | |||
791 | extern void ata_port_schedule_eh(struct ata_port *ap); | ||
792 | extern int ata_port_abort(struct ata_port *ap); | ||
793 | extern int ata_port_freeze(struct ata_port *ap); | ||
794 | |||
795 | extern void ata_eh_freeze_port(struct ata_port *ap); | ||
796 | extern void ata_eh_thaw_port(struct ata_port *ap); | ||
797 | |||
798 | extern void ata_eh_qc_complete(struct ata_queued_cmd *qc); | ||
799 | extern void ata_eh_qc_retry(struct ata_queued_cmd *qc); | ||
800 | |||
801 | extern void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset, | ||
802 | ata_reset_fn_t softreset, ata_reset_fn_t hardreset, | ||
803 | ata_postreset_fn_t postreset); | ||
804 | |||
805 | /* | ||
806 | * printk helpers | ||
807 | */ | ||
808 | #define ata_port_printk(ap, lv, fmt, args...) \ | ||
809 | printk(lv"ata%u: "fmt, (ap)->id , ##args) | ||
810 | |||
811 | #define ata_dev_printk(dev, lv, fmt, args...) \ | ||
812 | printk(lv"ata%u.%02u: "fmt, (dev)->ap->id, (dev)->devno , ##args) | ||
813 | |||
814 | /* | ||
815 | * ata_eh_info helpers | ||
816 | */ | ||
817 | #define ata_ehi_push_desc(ehi, fmt, args...) do { \ | ||
818 | (ehi)->desc_len += scnprintf((ehi)->desc + (ehi)->desc_len, \ | ||
819 | ATA_EH_DESC_LEN - (ehi)->desc_len, \ | ||
820 | fmt , ##args); \ | ||
821 | } while (0) | ||
822 | |||
823 | #define ata_ehi_clear_desc(ehi) do { \ | ||
824 | (ehi)->desc[0] = '\0'; \ | ||
825 | (ehi)->desc_len = 0; \ | ||
826 | } while (0) | ||
827 | |||
828 | static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi) | ||
829 | { | ||
830 | if (ehi->flags & ATA_EHI_HOTPLUGGED) | ||
831 | return; | ||
832 | |||
833 | ehi->flags |= ATA_EHI_HOTPLUGGED; | ||
834 | ehi->hotplug_timestamp = jiffies; | ||
835 | |||
836 | ehi->err_mask |= AC_ERR_ATA_BUS; | ||
837 | ehi->action |= ATA_EH_SOFTRESET; | ||
838 | ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1; | ||
839 | } | ||
631 | 840 | ||
841 | /* | ||
842 | * qc helpers | ||
843 | */ | ||
632 | static inline int | 844 | static inline int |
633 | ata_sg_is_last(struct scatterlist *sg, struct ata_queued_cmd *qc) | 845 | ata_sg_is_last(struct scatterlist *sg, struct ata_queued_cmd *qc) |
634 | { | 846 | { |
@@ -671,16 +883,55 @@ static inline unsigned int ata_tag_valid(unsigned int tag) | |||
671 | return (tag < ATA_MAX_QUEUE) ? 1 : 0; | 883 | return (tag < ATA_MAX_QUEUE) ? 1 : 0; |
672 | } | 884 | } |
673 | 885 | ||
674 | static inline unsigned int ata_class_present(unsigned int class) | 886 | static inline unsigned int ata_tag_internal(unsigned int tag) |
887 | { | ||
888 | return tag == ATA_MAX_QUEUE - 1; | ||
889 | } | ||
890 | |||
891 | /* | ||
892 | * device helpers | ||
893 | */ | ||
894 | static inline unsigned int ata_class_enabled(unsigned int class) | ||
675 | { | 895 | { |
676 | return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI; | 896 | return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI; |
677 | } | 897 | } |
678 | 898 | ||
679 | static inline unsigned int ata_dev_present(const struct ata_device *dev) | 899 | static inline unsigned int ata_class_disabled(unsigned int class) |
680 | { | 900 | { |
681 | return ata_class_present(dev->class); | 901 | return class == ATA_DEV_ATA_UNSUP || class == ATA_DEV_ATAPI_UNSUP; |
682 | } | 902 | } |
683 | 903 | ||
904 | static inline unsigned int ata_class_absent(unsigned int class) | ||
905 | { | ||
906 | return !ata_class_enabled(class) && !ata_class_disabled(class); | ||
907 | } | ||
908 | |||
909 | static inline unsigned int ata_dev_enabled(const struct ata_device *dev) | ||
910 | { | ||
911 | return ata_class_enabled(dev->class); | ||
912 | } | ||
913 | |||
914 | static inline unsigned int ata_dev_disabled(const struct ata_device *dev) | ||
915 | { | ||
916 | return ata_class_disabled(dev->class); | ||
917 | } | ||
918 | |||
919 | static inline unsigned int ata_dev_absent(const struct ata_device *dev) | ||
920 | { | ||
921 | return ata_class_absent(dev->class); | ||
922 | } | ||
923 | |||
924 | /* | ||
925 | * port helpers | ||
926 | */ | ||
927 | static inline int ata_port_max_devices(const struct ata_port *ap) | ||
928 | { | ||
929 | if (ap->flags & ATA_FLAG_SLAVE_POSS) | ||
930 | return 2; | ||
931 | return 1; | ||
932 | } | ||
933 | |||
934 | |||
684 | static inline u8 ata_chk_status(struct ata_port *ap) | 935 | static inline u8 ata_chk_status(struct ata_port *ap) |
685 | { | 936 | { |
686 | return ap->ops->check_status(ap); | 937 | return ap->ops->check_status(ap); |
@@ -759,20 +1010,35 @@ static inline void ata_qc_set_polling(struct ata_queued_cmd *qc) | |||
759 | qc->tf.ctl |= ATA_NIEN; | 1010 | qc->tf.ctl |= ATA_NIEN; |
760 | } | 1011 | } |
761 | 1012 | ||
762 | static inline struct ata_queued_cmd *ata_qc_from_tag (struct ata_port *ap, | 1013 | static inline struct ata_queued_cmd *__ata_qc_from_tag(struct ata_port *ap, |
763 | unsigned int tag) | 1014 | unsigned int tag) |
764 | { | 1015 | { |
765 | if (likely(ata_tag_valid(tag))) | 1016 | if (likely(ata_tag_valid(tag))) |
766 | return &ap->qcmd[tag]; | 1017 | return &ap->qcmd[tag]; |
767 | return NULL; | 1018 | return NULL; |
768 | } | 1019 | } |
769 | 1020 | ||
770 | static inline void ata_tf_init(struct ata_port *ap, struct ata_taskfile *tf, unsigned int device) | 1021 | static inline struct ata_queued_cmd *ata_qc_from_tag(struct ata_port *ap, |
1022 | unsigned int tag) | ||
1023 | { | ||
1024 | struct ata_queued_cmd *qc = __ata_qc_from_tag(ap, tag); | ||
1025 | |||
1026 | if (unlikely(!qc) || !ap->ops->error_handler) | ||
1027 | return qc; | ||
1028 | |||
1029 | if ((qc->flags & (ATA_QCFLAG_ACTIVE | | ||
1030 | ATA_QCFLAG_FAILED)) == ATA_QCFLAG_ACTIVE) | ||
1031 | return qc; | ||
1032 | |||
1033 | return NULL; | ||
1034 | } | ||
1035 | |||
1036 | static inline void ata_tf_init(struct ata_device *dev, struct ata_taskfile *tf) | ||
771 | { | 1037 | { |
772 | memset(tf, 0, sizeof(*tf)); | 1038 | memset(tf, 0, sizeof(*tf)); |
773 | 1039 | ||
774 | tf->ctl = ap->ctl; | 1040 | tf->ctl = dev->ap->ctl; |
775 | if (device == 0) | 1041 | if (dev->devno == 0) |
776 | tf->device = ATA_DEVICE_OBS; | 1042 | tf->device = ATA_DEVICE_OBS; |
777 | else | 1043 | else |
778 | tf->device = ATA_DEVICE_OBS | ATA_DEV1; | 1044 | tf->device = ATA_DEVICE_OBS | ATA_DEV1; |
@@ -787,26 +1053,11 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc) | |||
787 | qc->nbytes = qc->curbytes = 0; | 1053 | qc->nbytes = qc->curbytes = 0; |
788 | qc->err_mask = 0; | 1054 | qc->err_mask = 0; |
789 | 1055 | ||
790 | ata_tf_init(qc->ap, &qc->tf, qc->dev->devno); | 1056 | ata_tf_init(qc->dev, &qc->tf); |
791 | } | ||
792 | |||
793 | /** | ||
794 | * ata_qc_complete - Complete an active ATA command | ||
795 | * @qc: Command to complete | ||
796 | * @err_mask: ATA Status register contents | ||
797 | * | ||
798 | * Indicate to the mid and upper layers that an ATA | ||
799 | * command has completed, with either an ok or not-ok status. | ||
800 | * | ||
801 | * LOCKING: | ||
802 | * spin_lock_irqsave(host_set lock) | ||
803 | */ | ||
804 | static inline void ata_qc_complete(struct ata_queued_cmd *qc) | ||
805 | { | ||
806 | if (unlikely(qc->flags & ATA_QCFLAG_EH_SCHEDULED)) | ||
807 | return; | ||
808 | 1057 | ||
809 | __ata_qc_complete(qc); | 1058 | /* init result_tf such that it indicates normal completion */ |
1059 | qc->result_tf.command = ATA_DRDY; | ||
1060 | qc->result_tf.feature = 0; | ||
810 | } | 1061 | } |
811 | 1062 | ||
812 | /** | 1063 | /** |
@@ -885,28 +1136,6 @@ static inline u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq) | |||
885 | return status; | 1136 | return status; |
886 | } | 1137 | } |
887 | 1138 | ||
888 | static inline u32 scr_read(struct ata_port *ap, unsigned int reg) | ||
889 | { | ||
890 | return ap->ops->scr_read(ap, reg); | ||
891 | } | ||
892 | |||
893 | static inline void scr_write(struct ata_port *ap, unsigned int reg, u32 val) | ||
894 | { | ||
895 | ap->ops->scr_write(ap, reg, val); | ||
896 | } | ||
897 | |||
898 | static inline void scr_write_flush(struct ata_port *ap, unsigned int reg, | ||
899 | u32 val) | ||
900 | { | ||
901 | ap->ops->scr_write(ap, reg, val); | ||
902 | (void) ap->ops->scr_read(ap, reg); | ||
903 | } | ||
904 | |||
905 | static inline unsigned int sata_dev_present(struct ata_port *ap) | ||
906 | { | ||
907 | return ((scr_read(ap, SCR_STATUS) & 0xf) == 0x3) ? 1 : 0; | ||
908 | } | ||
909 | |||
910 | static inline int ata_try_flush_cache(const struct ata_device *dev) | 1139 | static inline int ata_try_flush_cache(const struct ata_device *dev) |
911 | { | 1140 | { |
912 | return ata_id_wcache_enabled(dev->id) || | 1141 | return ata_id_wcache_enabled(dev->id) || |
@@ -916,7 +1145,7 @@ static inline int ata_try_flush_cache(const struct ata_device *dev) | |||
916 | 1145 | ||
917 | static inline unsigned int ac_err_mask(u8 status) | 1146 | static inline unsigned int ac_err_mask(u8 status) |
918 | { | 1147 | { |
919 | if (status & ATA_BUSY) | 1148 | if (status & (ATA_BUSY | ATA_DRQ)) |
920 | return AC_ERR_HSM; | 1149 | return AC_ERR_HSM; |
921 | if (status & (ATA_ERR | ATA_DF)) | 1150 | if (status & (ATA_ERR | ATA_DF)) |
922 | return AC_ERR_DEV; | 1151 | return AC_ERR_DEV; |
@@ -944,4 +1173,9 @@ static inline void ata_pad_free(struct ata_port *ap, struct device *dev) | |||
944 | dma_free_coherent(dev, ATA_DMA_PAD_BUF_SZ, ap->pad, ap->pad_dma); | 1173 | dma_free_coherent(dev, ATA_DMA_PAD_BUF_SZ, ap->pad, ap->pad_dma); |
945 | } | 1174 | } |
946 | 1175 | ||
1176 | static inline struct ata_port *ata_shost_to_port(struct Scsi_Host *host) | ||
1177 | { | ||
1178 | return (struct ata_port *) &host->hostdata[0]; | ||
1179 | } | ||
1180 | |||
947 | #endif /* __LINUX_LIBATA_H__ */ | 1181 | #endif /* __LINUX_LIBATA_H__ */ |
diff --git a/include/linux/license.h b/include/linux/license.h new file mode 100644 index 000000000000..decdbf43cb5c --- /dev/null +++ b/include/linux/license.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef __LICENSE_H | ||
2 | #define __LICENSE_H | ||
3 | |||
4 | static inline int license_is_gpl_compatible(const char *license) | ||
5 | { | ||
6 | return (strcmp(license, "GPL") == 0 | ||
7 | || strcmp(license, "GPL v2") == 0 | ||
8 | || strcmp(license, "GPL and additional rights") == 0 | ||
9 | || strcmp(license, "Dual BSD/GPL") == 0 | ||
10 | || strcmp(license, "Dual MIT/GPL") == 0 | ||
11 | || strcmp(license, "Dual MPL/GPL") == 0); | ||
12 | } | ||
13 | |||
14 | #endif | ||
diff --git a/include/linux/linkage.h b/include/linux/linkage.h index c08c9983e840..932021f872d5 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _LINUX_LINKAGE_H | 1 | #ifndef _LINUX_LINKAGE_H |
2 | #define _LINUX_LINKAGE_H | 2 | #define _LINUX_LINKAGE_H |
3 | 3 | ||
4 | #include <linux/config.h> | ||
5 | #include <asm/linkage.h> | 4 | #include <asm/linkage.h> |
6 | 5 | ||
7 | #ifdef __cplusplus | 6 | #ifdef __cplusplus |
diff --git a/include/linux/list.h b/include/linux/list.h index 76f05718342c..6b74adf5297f 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -4,18 +4,11 @@ | |||
4 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
5 | 5 | ||
6 | #include <linux/stddef.h> | 6 | #include <linux/stddef.h> |
7 | #include <linux/poison.h> | ||
7 | #include <linux/prefetch.h> | 8 | #include <linux/prefetch.h> |
8 | #include <asm/system.h> | 9 | #include <asm/system.h> |
9 | 10 | ||
10 | /* | 11 | /* |
11 | * These are non-NULL pointers that will result in page faults | ||
12 | * under normal circumstances, used to verify that nobody uses | ||
13 | * non-initialized list entries. | ||
14 | */ | ||
15 | #define LIST_POISON1 ((void *) 0x00100100) | ||
16 | #define LIST_POISON2 ((void *) 0x00200200) | ||
17 | |||
18 | /* | ||
19 | * Simple doubly linked list implementation. | 12 | * Simple doubly linked list implementation. |
20 | * | 13 | * |
21 | * Some of the internal functions ("__xxx") are useful when | 14 | * Some of the internal functions ("__xxx") are useful when |
@@ -197,12 +190,35 @@ static inline void list_del_rcu(struct list_head *entry) | |||
197 | entry->prev = LIST_POISON2; | 190 | entry->prev = LIST_POISON2; |
198 | } | 191 | } |
199 | 192 | ||
193 | /** | ||
194 | * list_replace - replace old entry by new one | ||
195 | * @old : the element to be replaced | ||
196 | * @new : the new element to insert | ||
197 | * Note: if 'old' was empty, it will be overwritten. | ||
198 | */ | ||
199 | static inline void list_replace(struct list_head *old, | ||
200 | struct list_head *new) | ||
201 | { | ||
202 | new->next = old->next; | ||
203 | new->next->prev = new; | ||
204 | new->prev = old->prev; | ||
205 | new->prev->next = new; | ||
206 | } | ||
207 | |||
208 | static inline void list_replace_init(struct list_head *old, | ||
209 | struct list_head *new) | ||
210 | { | ||
211 | list_replace(old, new); | ||
212 | INIT_LIST_HEAD(old); | ||
213 | } | ||
214 | |||
200 | /* | 215 | /* |
201 | * list_replace_rcu - replace old entry by new one | 216 | * list_replace_rcu - replace old entry by new one |
202 | * @old : the element to be replaced | 217 | * @old : the element to be replaced |
203 | * @new : the new element to insert | 218 | * @new : the new element to insert |
204 | * | 219 | * |
205 | * The old entry will be replaced with the new entry atomically. | 220 | * The old entry will be replaced with the new entry atomically. |
221 | * Note: 'old' should not be empty. | ||
206 | */ | 222 | */ |
207 | static inline void list_replace_rcu(struct list_head *old, | 223 | static inline void list_replace_rcu(struct list_head *old, |
208 | struct list_head *new) | 224 | struct list_head *new) |
@@ -258,16 +274,17 @@ static inline int list_empty(const struct list_head *head) | |||
258 | } | 274 | } |
259 | 275 | ||
260 | /** | 276 | /** |
261 | * list_empty_careful - tests whether a list is | 277 | * list_empty_careful - tests whether a list is empty and not being modified |
262 | * empty _and_ checks that no other CPU might be | 278 | * @head: the list to test |
263 | * in the process of still modifying either member | 279 | * |
280 | * Description: | ||
281 | * tests whether a list is empty _and_ checks that no other CPU might be | ||
282 | * in the process of modifying either member (next or prev) | ||
264 | * | 283 | * |
265 | * NOTE: using list_empty_careful() without synchronization | 284 | * NOTE: using list_empty_careful() without synchronization |
266 | * can only be safe if the only activity that can happen | 285 | * can only be safe if the only activity that can happen |
267 | * to the list entry is list_del_init(). Eg. it cannot be used | 286 | * to the list entry is list_del_init(). Eg. it cannot be used |
268 | * if another CPU could re-list_add() it. | 287 | * if another CPU could re-list_add() it. |
269 | * | ||
270 | * @head: the list to test. | ||
271 | */ | 288 | */ |
272 | static inline int list_empty_careful(const struct list_head *head) | 289 | static inline int list_empty_careful(const struct list_head *head) |
273 | { | 290 | { |
@@ -327,7 +344,7 @@ static inline void list_splice_init(struct list_head *list, | |||
327 | 344 | ||
328 | /** | 345 | /** |
329 | * list_for_each - iterate over a list | 346 | * list_for_each - iterate over a list |
330 | * @pos: the &struct list_head to use as a loop counter. | 347 | * @pos: the &struct list_head to use as a loop cursor. |
331 | * @head: the head for your list. | 348 | * @head: the head for your list. |
332 | */ | 349 | */ |
333 | #define list_for_each(pos, head) \ | 350 | #define list_for_each(pos, head) \ |
@@ -336,7 +353,7 @@ static inline void list_splice_init(struct list_head *list, | |||
336 | 353 | ||
337 | /** | 354 | /** |
338 | * __list_for_each - iterate over a list | 355 | * __list_for_each - iterate over a list |
339 | * @pos: the &struct list_head to use as a loop counter. | 356 | * @pos: the &struct list_head to use as a loop cursor. |
340 | * @head: the head for your list. | 357 | * @head: the head for your list. |
341 | * | 358 | * |
342 | * This variant differs from list_for_each() in that it's the | 359 | * This variant differs from list_for_each() in that it's the |
@@ -349,7 +366,7 @@ static inline void list_splice_init(struct list_head *list, | |||
349 | 366 | ||
350 | /** | 367 | /** |
351 | * list_for_each_prev - iterate over a list backwards | 368 | * list_for_each_prev - iterate over a list backwards |
352 | * @pos: the &struct list_head to use as a loop counter. | 369 | * @pos: the &struct list_head to use as a loop cursor. |
353 | * @head: the head for your list. | 370 | * @head: the head for your list. |
354 | */ | 371 | */ |
355 | #define list_for_each_prev(pos, head) \ | 372 | #define list_for_each_prev(pos, head) \ |
@@ -357,8 +374,8 @@ static inline void list_splice_init(struct list_head *list, | |||
357 | pos = pos->prev) | 374 | pos = pos->prev) |
358 | 375 | ||
359 | /** | 376 | /** |
360 | * list_for_each_safe - iterate over a list safe against removal of list entry | 377 | * list_for_each_safe - iterate over a list safe against removal of list entry |
361 | * @pos: the &struct list_head to use as a loop counter. | 378 | * @pos: the &struct list_head to use as a loop cursor. |
362 | * @n: another &struct list_head to use as temporary storage | 379 | * @n: another &struct list_head to use as temporary storage |
363 | * @head: the head for your list. | 380 | * @head: the head for your list. |
364 | */ | 381 | */ |
@@ -368,7 +385,7 @@ static inline void list_splice_init(struct list_head *list, | |||
368 | 385 | ||
369 | /** | 386 | /** |
370 | * list_for_each_entry - iterate over list of given type | 387 | * list_for_each_entry - iterate over list of given type |
371 | * @pos: the type * to use as a loop counter. | 388 | * @pos: the type * to use as a loop cursor. |
372 | * @head: the head for your list. | 389 | * @head: the head for your list. |
373 | * @member: the name of the list_struct within the struct. | 390 | * @member: the name of the list_struct within the struct. |
374 | */ | 391 | */ |
@@ -379,7 +396,7 @@ static inline void list_splice_init(struct list_head *list, | |||
379 | 396 | ||
380 | /** | 397 | /** |
381 | * list_for_each_entry_reverse - iterate backwards over list of given type. | 398 | * list_for_each_entry_reverse - iterate backwards over list of given type. |
382 | * @pos: the type * to use as a loop counter. | 399 | * @pos: the type * to use as a loop cursor. |
383 | * @head: the head for your list. | 400 | * @head: the head for your list. |
384 | * @member: the name of the list_struct within the struct. | 401 | * @member: the name of the list_struct within the struct. |
385 | */ | 402 | */ |
@@ -389,21 +406,24 @@ static inline void list_splice_init(struct list_head *list, | |||
389 | pos = list_entry(pos->member.prev, typeof(*pos), member)) | 406 | pos = list_entry(pos->member.prev, typeof(*pos), member)) |
390 | 407 | ||
391 | /** | 408 | /** |
392 | * list_prepare_entry - prepare a pos entry for use as a start point in | 409 | * list_prepare_entry - prepare a pos entry for use in list_for_each_entry_continue |
393 | * list_for_each_entry_continue | ||
394 | * @pos: the type * to use as a start point | 410 | * @pos: the type * to use as a start point |
395 | * @head: the head of the list | 411 | * @head: the head of the list |
396 | * @member: the name of the list_struct within the struct. | 412 | * @member: the name of the list_struct within the struct. |
413 | * | ||
414 | * Prepares a pos entry for use as a start point in list_for_each_entry_continue. | ||
397 | */ | 415 | */ |
398 | #define list_prepare_entry(pos, head, member) \ | 416 | #define list_prepare_entry(pos, head, member) \ |
399 | ((pos) ? : list_entry(head, typeof(*pos), member)) | 417 | ((pos) ? : list_entry(head, typeof(*pos), member)) |
400 | 418 | ||
401 | /** | 419 | /** |
402 | * list_for_each_entry_continue - iterate over list of given type | 420 | * list_for_each_entry_continue - continue iteration over list of given type |
403 | * continuing after existing point | 421 | * @pos: the type * to use as a loop cursor. |
404 | * @pos: the type * to use as a loop counter. | ||
405 | * @head: the head for your list. | 422 | * @head: the head for your list. |
406 | * @member: the name of the list_struct within the struct. | 423 | * @member: the name of the list_struct within the struct. |
424 | * | ||
425 | * Continue to iterate over list of given type, continuing after | ||
426 | * the current position. | ||
407 | */ | 427 | */ |
408 | #define list_for_each_entry_continue(pos, head, member) \ | 428 | #define list_for_each_entry_continue(pos, head, member) \ |
409 | for (pos = list_entry(pos->member.next, typeof(*pos), member); \ | 429 | for (pos = list_entry(pos->member.next, typeof(*pos), member); \ |
@@ -411,11 +431,12 @@ static inline void list_splice_init(struct list_head *list, | |||
411 | pos = list_entry(pos->member.next, typeof(*pos), member)) | 431 | pos = list_entry(pos->member.next, typeof(*pos), member)) |
412 | 432 | ||
413 | /** | 433 | /** |
414 | * list_for_each_entry_from - iterate over list of given type | 434 | * list_for_each_entry_from - iterate over list of given type from the current point |
415 | * continuing from existing point | 435 | * @pos: the type * to use as a loop cursor. |
416 | * @pos: the type * to use as a loop counter. | ||
417 | * @head: the head for your list. | 436 | * @head: the head for your list. |
418 | * @member: the name of the list_struct within the struct. | 437 | * @member: the name of the list_struct within the struct. |
438 | * | ||
439 | * Iterate over list of given type, continuing from current position. | ||
419 | */ | 440 | */ |
420 | #define list_for_each_entry_from(pos, head, member) \ | 441 | #define list_for_each_entry_from(pos, head, member) \ |
421 | for (; prefetch(pos->member.next), &pos->member != (head); \ | 442 | for (; prefetch(pos->member.next), &pos->member != (head); \ |
@@ -423,7 +444,7 @@ static inline void list_splice_init(struct list_head *list, | |||
423 | 444 | ||
424 | /** | 445 | /** |
425 | * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry | 446 | * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry |
426 | * @pos: the type * to use as a loop counter. | 447 | * @pos: the type * to use as a loop cursor. |
427 | * @n: another type * to use as temporary storage | 448 | * @n: another type * to use as temporary storage |
428 | * @head: the head for your list. | 449 | * @head: the head for your list. |
429 | * @member: the name of the list_struct within the struct. | 450 | * @member: the name of the list_struct within the struct. |
@@ -435,12 +456,14 @@ static inline void list_splice_init(struct list_head *list, | |||
435 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) | 456 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) |
436 | 457 | ||
437 | /** | 458 | /** |
438 | * list_for_each_entry_safe_continue - iterate over list of given type | 459 | * list_for_each_entry_safe_continue |
439 | * continuing after existing point safe against removal of list entry | 460 | * @pos: the type * to use as a loop cursor. |
440 | * @pos: the type * to use as a loop counter. | ||
441 | * @n: another type * to use as temporary storage | 461 | * @n: another type * to use as temporary storage |
442 | * @head: the head for your list. | 462 | * @head: the head for your list. |
443 | * @member: the name of the list_struct within the struct. | 463 | * @member: the name of the list_struct within the struct. |
464 | * | ||
465 | * Iterate over list of given type, continuing after current point, | ||
466 | * safe against removal of list entry. | ||
444 | */ | 467 | */ |
445 | #define list_for_each_entry_safe_continue(pos, n, head, member) \ | 468 | #define list_for_each_entry_safe_continue(pos, n, head, member) \ |
446 | for (pos = list_entry(pos->member.next, typeof(*pos), member), \ | 469 | for (pos = list_entry(pos->member.next, typeof(*pos), member), \ |
@@ -449,12 +472,14 @@ static inline void list_splice_init(struct list_head *list, | |||
449 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) | 472 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) |
450 | 473 | ||
451 | /** | 474 | /** |
452 | * list_for_each_entry_safe_from - iterate over list of given type | 475 | * list_for_each_entry_safe_from |
453 | * from existing point safe against removal of list entry | 476 | * @pos: the type * to use as a loop cursor. |
454 | * @pos: the type * to use as a loop counter. | ||
455 | * @n: another type * to use as temporary storage | 477 | * @n: another type * to use as temporary storage |
456 | * @head: the head for your list. | 478 | * @head: the head for your list. |
457 | * @member: the name of the list_struct within the struct. | 479 | * @member: the name of the list_struct within the struct. |
480 | * | ||
481 | * Iterate over list of given type from current point, safe against | ||
482 | * removal of list entry. | ||
458 | */ | 483 | */ |
459 | #define list_for_each_entry_safe_from(pos, n, head, member) \ | 484 | #define list_for_each_entry_safe_from(pos, n, head, member) \ |
460 | for (n = list_entry(pos->member.next, typeof(*pos), member); \ | 485 | for (n = list_entry(pos->member.next, typeof(*pos), member); \ |
@@ -462,12 +487,14 @@ static inline void list_splice_init(struct list_head *list, | |||
462 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) | 487 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) |
463 | 488 | ||
464 | /** | 489 | /** |
465 | * list_for_each_entry_safe_reverse - iterate backwards over list of given type safe against | 490 | * list_for_each_entry_safe_reverse |
466 | * removal of list entry | 491 | * @pos: the type * to use as a loop cursor. |
467 | * @pos: the type * to use as a loop counter. | ||
468 | * @n: another type * to use as temporary storage | 492 | * @n: another type * to use as temporary storage |
469 | * @head: the head for your list. | 493 | * @head: the head for your list. |
470 | * @member: the name of the list_struct within the struct. | 494 | * @member: the name of the list_struct within the struct. |
495 | * | ||
496 | * Iterate backwards over list of given type, safe against removal | ||
497 | * of list entry. | ||
471 | */ | 498 | */ |
472 | #define list_for_each_entry_safe_reverse(pos, n, head, member) \ | 499 | #define list_for_each_entry_safe_reverse(pos, n, head, member) \ |
473 | for (pos = list_entry((head)->prev, typeof(*pos), member), \ | 500 | for (pos = list_entry((head)->prev, typeof(*pos), member), \ |
@@ -477,7 +504,7 @@ static inline void list_splice_init(struct list_head *list, | |||
477 | 504 | ||
478 | /** | 505 | /** |
479 | * list_for_each_rcu - iterate over an rcu-protected list | 506 | * list_for_each_rcu - iterate over an rcu-protected list |
480 | * @pos: the &struct list_head to use as a loop counter. | 507 | * @pos: the &struct list_head to use as a loop cursor. |
481 | * @head: the head for your list. | 508 | * @head: the head for your list. |
482 | * | 509 | * |
483 | * This list-traversal primitive may safely run concurrently with | 510 | * This list-traversal primitive may safely run concurrently with |
@@ -495,12 +522,13 @@ static inline void list_splice_init(struct list_head *list, | |||
495 | pos = pos->next) | 522 | pos = pos->next) |
496 | 523 | ||
497 | /** | 524 | /** |
498 | * list_for_each_safe_rcu - iterate over an rcu-protected list safe | 525 | * list_for_each_safe_rcu |
499 | * against removal of list entry | 526 | * @pos: the &struct list_head to use as a loop cursor. |
500 | * @pos: the &struct list_head to use as a loop counter. | ||
501 | * @n: another &struct list_head to use as temporary storage | 527 | * @n: another &struct list_head to use as temporary storage |
502 | * @head: the head for your list. | 528 | * @head: the head for your list. |
503 | * | 529 | * |
530 | * Iterate over an rcu-protected list, safe against removal of list entry. | ||
531 | * | ||
504 | * This list-traversal primitive may safely run concurrently with | 532 | * This list-traversal primitive may safely run concurrently with |
505 | * the _rcu list-mutation primitives such as list_add_rcu() | 533 | * the _rcu list-mutation primitives such as list_add_rcu() |
506 | * as long as the traversal is guarded by rcu_read_lock(). | 534 | * as long as the traversal is guarded by rcu_read_lock(). |
@@ -512,7 +540,7 @@ static inline void list_splice_init(struct list_head *list, | |||
512 | 540 | ||
513 | /** | 541 | /** |
514 | * list_for_each_entry_rcu - iterate over rcu list of given type | 542 | * list_for_each_entry_rcu - iterate over rcu list of given type |
515 | * @pos: the type * to use as a loop counter. | 543 | * @pos: the type * to use as a loop cursor. |
516 | * @head: the head for your list. | 544 | * @head: the head for your list. |
517 | * @member: the name of the list_struct within the struct. | 545 | * @member: the name of the list_struct within the struct. |
518 | * | 546 | * |
@@ -528,11 +556,12 @@ static inline void list_splice_init(struct list_head *list, | |||
528 | 556 | ||
529 | 557 | ||
530 | /** | 558 | /** |
531 | * list_for_each_continue_rcu - iterate over an rcu-protected list | 559 | * list_for_each_continue_rcu |
532 | * continuing after existing point. | 560 | * @pos: the &struct list_head to use as a loop cursor. |
533 | * @pos: the &struct list_head to use as a loop counter. | ||
534 | * @head: the head for your list. | 561 | * @head: the head for your list. |
535 | * | 562 | * |
563 | * Iterate over an rcu-protected list, continuing after current point. | ||
564 | * | ||
536 | * This list-traversal primitive may safely run concurrently with | 565 | * This list-traversal primitive may safely run concurrently with |
537 | * the _rcu list-mutation primitives such as list_add_rcu() | 566 | * the _rcu list-mutation primitives such as list_add_rcu() |
538 | * as long as the traversal is guarded by rcu_read_lock(). | 567 | * as long as the traversal is guarded by rcu_read_lock(). |
@@ -658,11 +687,14 @@ static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h) | |||
658 | 687 | ||
659 | 688 | ||
660 | /** | 689 | /** |
661 | * hlist_add_head_rcu - adds the specified element to the specified hlist, | 690 | * hlist_add_head_rcu |
662 | * while permitting racing traversals. | ||
663 | * @n: the element to add to the hash list. | 691 | * @n: the element to add to the hash list. |
664 | * @h: the list to add to. | 692 | * @h: the list to add to. |
665 | * | 693 | * |
694 | * Description: | ||
695 | * Adds the specified element to the specified hlist, | ||
696 | * while permitting racing traversals. | ||
697 | * | ||
666 | * The caller must take whatever precautions are necessary | 698 | * The caller must take whatever precautions are necessary |
667 | * (such as holding appropriate locks) to avoid racing | 699 | * (such as holding appropriate locks) to avoid racing |
668 | * with another list-mutation primitive, such as hlist_add_head_rcu() | 700 | * with another list-mutation primitive, such as hlist_add_head_rcu() |
@@ -707,11 +739,14 @@ static inline void hlist_add_after(struct hlist_node *n, | |||
707 | } | 739 | } |
708 | 740 | ||
709 | /** | 741 | /** |
710 | * hlist_add_before_rcu - adds the specified element to the specified hlist | 742 | * hlist_add_before_rcu |
711 | * before the specified node while permitting racing traversals. | ||
712 | * @n: the new element to add to the hash list. | 743 | * @n: the new element to add to the hash list. |
713 | * @next: the existing element to add the new element before. | 744 | * @next: the existing element to add the new element before. |
714 | * | 745 | * |
746 | * Description: | ||
747 | * Adds the specified element to the specified hlist | ||
748 | * before the specified node while permitting racing traversals. | ||
749 | * | ||
715 | * The caller must take whatever precautions are necessary | 750 | * The caller must take whatever precautions are necessary |
716 | * (such as holding appropriate locks) to avoid racing | 751 | * (such as holding appropriate locks) to avoid racing |
717 | * with another list-mutation primitive, such as hlist_add_head_rcu() | 752 | * with another list-mutation primitive, such as hlist_add_head_rcu() |
@@ -732,11 +767,14 @@ static inline void hlist_add_before_rcu(struct hlist_node *n, | |||
732 | } | 767 | } |
733 | 768 | ||
734 | /** | 769 | /** |
735 | * hlist_add_after_rcu - adds the specified element to the specified hlist | 770 | * hlist_add_after_rcu |
736 | * after the specified node while permitting racing traversals. | ||
737 | * @prev: the existing element to add the new element after. | 771 | * @prev: the existing element to add the new element after. |
738 | * @n: the new element to add to the hash list. | 772 | * @n: the new element to add to the hash list. |
739 | * | 773 | * |
774 | * Description: | ||
775 | * Adds the specified element to the specified hlist | ||
776 | * after the specified node while permitting racing traversals. | ||
777 | * | ||
740 | * The caller must take whatever precautions are necessary | 778 | * The caller must take whatever precautions are necessary |
741 | * (such as holding appropriate locks) to avoid racing | 779 | * (such as holding appropriate locks) to avoid racing |
742 | * with another list-mutation primitive, such as hlist_add_head_rcu() | 780 | * with another list-mutation primitive, such as hlist_add_head_rcu() |
@@ -769,8 +807,8 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
769 | 807 | ||
770 | /** | 808 | /** |
771 | * hlist_for_each_entry - iterate over list of given type | 809 | * hlist_for_each_entry - iterate over list of given type |
772 | * @tpos: the type * to use as a loop counter. | 810 | * @tpos: the type * to use as a loop cursor. |
773 | * @pos: the &struct hlist_node to use as a loop counter. | 811 | * @pos: the &struct hlist_node to use as a loop cursor. |
774 | * @head: the head for your list. | 812 | * @head: the head for your list. |
775 | * @member: the name of the hlist_node within the struct. | 813 | * @member: the name of the hlist_node within the struct. |
776 | */ | 814 | */ |
@@ -781,9 +819,9 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
781 | pos = pos->next) | 819 | pos = pos->next) |
782 | 820 | ||
783 | /** | 821 | /** |
784 | * hlist_for_each_entry_continue - iterate over a hlist continuing after existing point | 822 | * hlist_for_each_entry_continue - iterate over a hlist continuing after current point |
785 | * @tpos: the type * to use as a loop counter. | 823 | * @tpos: the type * to use as a loop cursor. |
786 | * @pos: the &struct hlist_node to use as a loop counter. | 824 | * @pos: the &struct hlist_node to use as a loop cursor. |
787 | * @member: the name of the hlist_node within the struct. | 825 | * @member: the name of the hlist_node within the struct. |
788 | */ | 826 | */ |
789 | #define hlist_for_each_entry_continue(tpos, pos, member) \ | 827 | #define hlist_for_each_entry_continue(tpos, pos, member) \ |
@@ -793,9 +831,9 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
793 | pos = pos->next) | 831 | pos = pos->next) |
794 | 832 | ||
795 | /** | 833 | /** |
796 | * hlist_for_each_entry_from - iterate over a hlist continuing from existing point | 834 | * hlist_for_each_entry_from - iterate over a hlist continuing from current point |
797 | * @tpos: the type * to use as a loop counter. | 835 | * @tpos: the type * to use as a loop cursor. |
798 | * @pos: the &struct hlist_node to use as a loop counter. | 836 | * @pos: the &struct hlist_node to use as a loop cursor. |
799 | * @member: the name of the hlist_node within the struct. | 837 | * @member: the name of the hlist_node within the struct. |
800 | */ | 838 | */ |
801 | #define hlist_for_each_entry_from(tpos, pos, member) \ | 839 | #define hlist_for_each_entry_from(tpos, pos, member) \ |
@@ -805,8 +843,8 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
805 | 843 | ||
806 | /** | 844 | /** |
807 | * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry | 845 | * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry |
808 | * @tpos: the type * to use as a loop counter. | 846 | * @tpos: the type * to use as a loop cursor. |
809 | * @pos: the &struct hlist_node to use as a loop counter. | 847 | * @pos: the &struct hlist_node to use as a loop cursor. |
810 | * @n: another &struct hlist_node to use as temporary storage | 848 | * @n: another &struct hlist_node to use as temporary storage |
811 | * @head: the head for your list. | 849 | * @head: the head for your list. |
812 | * @member: the name of the hlist_node within the struct. | 850 | * @member: the name of the hlist_node within the struct. |
@@ -819,8 +857,8 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
819 | 857 | ||
820 | /** | 858 | /** |
821 | * hlist_for_each_entry_rcu - iterate over rcu list of given type | 859 | * hlist_for_each_entry_rcu - iterate over rcu list of given type |
822 | * @tpos: the type * to use as a loop counter. | 860 | * @tpos: the type * to use as a loop cursor. |
823 | * @pos: the &struct hlist_node to use as a loop counter. | 861 | * @pos: the &struct hlist_node to use as a loop cursor. |
824 | * @head: the head for your list. | 862 | * @head: the head for your list. |
825 | * @member: the name of the hlist_node within the struct. | 863 | * @member: the name of the hlist_node within the struct. |
826 | * | 864 | * |
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index 995f89dc8c04..aa4fe905bb4d 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
@@ -11,7 +11,6 @@ | |||
11 | 11 | ||
12 | #ifdef __KERNEL__ | 12 | #ifdef __KERNEL__ |
13 | 13 | ||
14 | #include <linux/config.h> | ||
15 | #include <linux/in.h> | 14 | #include <linux/in.h> |
16 | #include <linux/fs.h> | 15 | #include <linux/fs.h> |
17 | #include <linux/kref.h> | 16 | #include <linux/kref.h> |
@@ -50,11 +49,12 @@ struct nlm_host { | |||
50 | h_killed : 1, | 49 | h_killed : 1, |
51 | h_monitored : 1; | 50 | h_monitored : 1; |
52 | wait_queue_head_t h_gracewait; /* wait while reclaiming */ | 51 | wait_queue_head_t h_gracewait; /* wait while reclaiming */ |
52 | struct rw_semaphore h_rwsem; /* Reboot recovery lock */ | ||
53 | u32 h_state; /* pseudo-state counter */ | 53 | u32 h_state; /* pseudo-state counter */ |
54 | u32 h_nsmstate; /* true remote NSM state */ | 54 | u32 h_nsmstate; /* true remote NSM state */ |
55 | u32 h_pidcount; /* Pseudopids */ | 55 | u32 h_pidcount; /* Pseudopids */ |
56 | atomic_t h_count; /* reference count */ | 56 | atomic_t h_count; /* reference count */ |
57 | struct semaphore h_sema; /* mutex for pmap binding */ | 57 | struct mutex h_mutex; /* mutex for pmap binding */ |
58 | unsigned long h_nextrebind; /* next portmap call */ | 58 | unsigned long h_nextrebind; /* next portmap call */ |
59 | unsigned long h_expires; /* eligible for GC */ | 59 | unsigned long h_expires; /* eligible for GC */ |
60 | struct list_head h_lockowners; /* Lockowners for the client */ | 60 | struct list_head h_lockowners; /* Lockowners for the client */ |
@@ -220,6 +220,7 @@ static __inline__ int | |||
220 | nlm_compare_locks(const struct file_lock *fl1, const struct file_lock *fl2) | 220 | nlm_compare_locks(const struct file_lock *fl1, const struct file_lock *fl2) |
221 | { | 221 | { |
222 | return fl1->fl_pid == fl2->fl_pid | 222 | return fl1->fl_pid == fl2->fl_pid |
223 | && fl1->fl_owner == fl2->fl_owner | ||
223 | && fl1->fl_start == fl2->fl_start | 224 | && fl1->fl_start == fl2->fl_start |
224 | && fl1->fl_end == fl2->fl_end | 225 | && fl1->fl_end == fl2->fl_end |
225 | &&(fl1->fl_type == fl2->fl_type || fl2->fl_type == F_UNLCK); | 226 | &&(fl1->fl_type == fl2->fl_type || fl2->fl_type == F_UNLCK); |
diff --git a/include/linux/lockd/nlm.h b/include/linux/lockd/nlm.h index 869b630cba24..d9d46e442538 100644 --- a/include/linux/lockd/nlm.h +++ b/include/linux/lockd/nlm.h | |||
@@ -9,7 +9,6 @@ | |||
9 | #ifndef LINUX_LOCKD_NLM_H | 9 | #ifndef LINUX_LOCKD_NLM_H |
10 | #define LINUX_LOCKD_NLM_H | 10 | #define LINUX_LOCKD_NLM_H |
11 | 11 | ||
12 | #include <linux/config.h> | ||
13 | 12 | ||
14 | /* Maximum file offset in file_lock.fl_end */ | 13 | /* Maximum file offset in file_lock.fl_end */ |
15 | # define NLM_OFFSET_MAX ((s32) 0x7fffffff) | 14 | # define NLM_OFFSET_MAX ((s32) 0x7fffffff) |
diff --git a/include/linux/m41t00.h b/include/linux/m41t00.h new file mode 100644 index 000000000000..b423360ca38e --- /dev/null +++ b/include/linux/m41t00.h | |||
@@ -0,0 +1,50 @@ | |||
1 | /* | ||
2 | * Definitions for the ST M41T00 family of i2c rtc chips. | ||
3 | * | ||
4 | * Author: Mark A. Greer <mgreer@mvista.com> | ||
5 | * | ||
6 | * 2005, 2006 (c) MontaVista Software, Inc. This file is licensed under | ||
7 | * the terms of the GNU General Public License version 2. This program | ||
8 | * is licensed "as is" without any warranty of any kind, whether express | ||
9 | * or implied. | ||
10 | */ | ||
11 | |||
12 | #ifndef _M41T00_H | ||
13 | #define _M41T00_H | ||
14 | |||
15 | #define M41T00_DRV_NAME "m41t00" | ||
16 | #define M41T00_I2C_ADDR 0x68 | ||
17 | |||
18 | #define M41T00_TYPE_M41T00 0 | ||
19 | #define M41T00_TYPE_M41T81 81 | ||
20 | #define M41T00_TYPE_M41T85 85 | ||
21 | |||
22 | struct m41t00_platform_data { | ||
23 | u8 type; | ||
24 | u8 i2c_addr; | ||
25 | u8 sqw_freq; | ||
26 | }; | ||
27 | |||
28 | /* SQW output disabled, this is default value by power on */ | ||
29 | #define M41T00_SQW_DISABLE (0) | ||
30 | |||
31 | #define M41T00_SQW_32KHZ (1<<4) /* 32.768 KHz */ | ||
32 | #define M41T00_SQW_8KHZ (2<<4) /* 8.192 KHz */ | ||
33 | #define M41T00_SQW_4KHZ (3<<4) /* 4.096 KHz */ | ||
34 | #define M41T00_SQW_2KHZ (4<<4) /* 2.048 KHz */ | ||
35 | #define M41T00_SQW_1KHZ (5<<4) /* 1.024 KHz */ | ||
36 | #define M41T00_SQW_512HZ (6<<4) /* 512 Hz */ | ||
37 | #define M41T00_SQW_256HZ (7<<4) /* 256 Hz */ | ||
38 | #define M41T00_SQW_128HZ (8<<4) /* 128 Hz */ | ||
39 | #define M41T00_SQW_64HZ (9<<4) /* 64 Hz */ | ||
40 | #define M41T00_SQW_32HZ (10<<4) /* 32 Hz */ | ||
41 | #define M41T00_SQW_16HZ (11<<4) /* 16 Hz */ | ||
42 | #define M41T00_SQW_8HZ (12<<4) /* 8 Hz */ | ||
43 | #define M41T00_SQW_4HZ (13<<4) /* 4 Hz */ | ||
44 | #define M41T00_SQW_2HZ (14<<4) /* 2 Hz */ | ||
45 | #define M41T00_SQW_1HZ (15<<4) /* 1 Hz */ | ||
46 | |||
47 | extern ulong m41t00_get_rtc_time(void); | ||
48 | extern int m41t00_set_rtc_time(ulong nowtime); | ||
49 | |||
50 | #endif /* _M41T00_H */ | ||
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 911206386171..218501cfaeb9 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
@@ -63,6 +63,76 @@ extern int online_pages(unsigned long, unsigned long); | |||
63 | /* reasonably generic interface to expand the physical pages in a zone */ | 63 | /* reasonably generic interface to expand the physical pages in a zone */ |
64 | extern int __add_pages(struct zone *zone, unsigned long start_pfn, | 64 | extern int __add_pages(struct zone *zone, unsigned long start_pfn, |
65 | unsigned long nr_pages); | 65 | unsigned long nr_pages); |
66 | |||
67 | #ifdef CONFIG_NUMA | ||
68 | extern int memory_add_physaddr_to_nid(u64 start); | ||
69 | #else | ||
70 | static inline int memory_add_physaddr_to_nid(u64 start) | ||
71 | { | ||
72 | return 0; | ||
73 | } | ||
74 | #endif | ||
75 | |||
76 | #ifdef CONFIG_HAVE_ARCH_NODEDATA_EXTENSION | ||
77 | /* | ||
78 | * For supporting node-hotadd, we have to allocate a new pgdat. | ||
79 | * | ||
80 | * If an arch has generic style NODE_DATA(), | ||
81 | * node_data[nid] = kzalloc() works well. But it depends on the architecture. | ||
82 | * | ||
83 | * In general, generic_alloc_nodedata() is used. | ||
84 | * Now, arch_free_nodedata() is just defined for error path of node_hot_add. | ||
85 | * | ||
86 | */ | ||
87 | extern pg_data_t *arch_alloc_nodedata(int nid); | ||
88 | extern void arch_free_nodedata(pg_data_t *pgdat); | ||
89 | extern void arch_refresh_nodedata(int nid, pg_data_t *pgdat); | ||
90 | |||
91 | #else /* CONFIG_HAVE_ARCH_NODEDATA_EXTENSION */ | ||
92 | |||
93 | #define arch_alloc_nodedata(nid) generic_alloc_nodedata(nid) | ||
94 | #define arch_free_nodedata(pgdat) generic_free_nodedata(pgdat) | ||
95 | |||
96 | #ifdef CONFIG_NUMA | ||
97 | /* | ||
98 | * If ARCH_HAS_NODEDATA_EXTENSION=n, this func is used to allocate pgdat. | ||
99 | * XXX: kmalloc_node() can't work well to get new node's memory at this time. | ||
100 | * Because, pgdat for the new node is not allocated/initialized yet itself. | ||
101 | * To use new node's memory, more consideration will be necessary. | ||
102 | */ | ||
103 | #define generic_alloc_nodedata(nid) \ | ||
104 | ({ \ | ||
105 | kzalloc(sizeof(pg_data_t), GFP_KERNEL); \ | ||
106 | }) | ||
107 | /* | ||
108 | * This definition is just for error path in node hotadd. | ||
109 | * For node hotremove, we have to replace this. | ||
110 | */ | ||
111 | #define generic_free_nodedata(pgdat) kfree(pgdat) | ||
112 | |||
113 | extern pg_data_t *node_data[]; | ||
114 | static inline void arch_refresh_nodedata(int nid, pg_data_t *pgdat) | ||
115 | { | ||
116 | node_data[nid] = pgdat; | ||
117 | } | ||
118 | |||
119 | #else /* !CONFIG_NUMA */ | ||
120 | |||
121 | /* never called */ | ||
122 | static inline pg_data_t *generic_alloc_nodedata(int nid) | ||
123 | { | ||
124 | BUG(); | ||
125 | return NULL; | ||
126 | } | ||
127 | static inline void generic_free_nodedata(pg_data_t *pgdat) | ||
128 | { | ||
129 | } | ||
130 | static inline void arch_refresh_nodedata(int nid, pg_data_t *pgdat) | ||
131 | { | ||
132 | } | ||
133 | #endif /* CONFIG_NUMA */ | ||
134 | #endif /* CONFIG_HAVE_ARCH_NODEDATA_EXTENSION */ | ||
135 | |||
66 | #else /* ! CONFIG_MEMORY_HOTPLUG */ | 136 | #else /* ! CONFIG_MEMORY_HOTPLUG */ |
67 | /* | 137 | /* |
68 | * Stub functions for when hotplug is off | 138 | * Stub functions for when hotplug is off |
@@ -99,7 +169,8 @@ static inline int __remove_pages(struct zone *zone, unsigned long start_pfn, | |||
99 | return -ENOSYS; | 169 | return -ENOSYS; |
100 | } | 170 | } |
101 | 171 | ||
102 | extern int add_memory(u64 start, u64 size); | 172 | extern int add_memory(int nid, u64 start, u64 size); |
173 | extern int arch_add_memory(int nid, u64 start, u64 size); | ||
103 | extern int remove_memory(u64 start, u64 size); | 174 | extern int remove_memory(u64 start, u64 size); |
104 | 175 | ||
105 | #endif /* __LINUX_MEMORY_HOTPLUG_H */ | 176 | #endif /* __LINUX_MEMORY_HOTPLUG_H */ |
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index f5fdca1d67e6..72440f0a443d 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h | |||
@@ -28,7 +28,6 @@ | |||
28 | 28 | ||
29 | #ifdef __KERNEL__ | 29 | #ifdef __KERNEL__ |
30 | 30 | ||
31 | #include <linux/config.h> | ||
32 | #include <linux/mmzone.h> | 31 | #include <linux/mmzone.h> |
33 | #include <linux/slab.h> | 32 | #include <linux/slab.h> |
34 | #include <linux/rbtree.h> | 33 | #include <linux/rbtree.h> |
diff --git a/include/linux/migrate.h b/include/linux/migrate.h index ff0a64073ebc..48148e0cdbd1 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h | |||
@@ -1,36 +1,44 @@ | |||
1 | #ifndef _LINUX_MIGRATE_H | 1 | #ifndef _LINUX_MIGRATE_H |
2 | #define _LINUX_MIGRATE_H | 2 | #define _LINUX_MIGRATE_H |
3 | 3 | ||
4 | #include <linux/config.h> | ||
5 | #include <linux/mm.h> | 4 | #include <linux/mm.h> |
6 | 5 | ||
6 | typedef struct page *new_page_t(struct page *, unsigned long private, int **); | ||
7 | |||
7 | #ifdef CONFIG_MIGRATION | 8 | #ifdef CONFIG_MIGRATION |
8 | extern int isolate_lru_page(struct page *p, struct list_head *pagelist); | 9 | extern int isolate_lru_page(struct page *p, struct list_head *pagelist); |
9 | extern int putback_lru_pages(struct list_head *l); | 10 | extern int putback_lru_pages(struct list_head *l); |
10 | extern int migrate_page(struct page *, struct page *); | 11 | extern int migrate_page(struct address_space *, |
11 | extern void migrate_page_copy(struct page *, struct page *); | 12 | struct page *, struct page *); |
12 | extern int migrate_page_remove_references(struct page *, struct page *, int); | 13 | extern int migrate_pages(struct list_head *l, new_page_t x, unsigned long); |
13 | extern int migrate_pages(struct list_head *l, struct list_head *t, | ||
14 | struct list_head *moved, struct list_head *failed); | ||
15 | extern int migrate_pages_to(struct list_head *pagelist, | ||
16 | struct vm_area_struct *vma, int dest); | ||
17 | extern int fail_migrate_page(struct page *, struct page *); | ||
18 | 14 | ||
19 | extern int migrate_prep(void); | 15 | extern int fail_migrate_page(struct address_space *, |
16 | struct page *, struct page *); | ||
20 | 17 | ||
18 | extern int migrate_prep(void); | ||
19 | extern int migrate_vmas(struct mm_struct *mm, | ||
20 | const nodemask_t *from, const nodemask_t *to, | ||
21 | unsigned long flags); | ||
21 | #else | 22 | #else |
22 | 23 | ||
23 | static inline int isolate_lru_page(struct page *p, struct list_head *list) | 24 | static inline int isolate_lru_page(struct page *p, struct list_head *list) |
24 | { return -ENOSYS; } | 25 | { return -ENOSYS; } |
25 | static inline int putback_lru_pages(struct list_head *l) { return 0; } | 26 | static inline int putback_lru_pages(struct list_head *l) { return 0; } |
26 | static inline int migrate_pages(struct list_head *l, struct list_head *t, | 27 | static inline int migrate_pages(struct list_head *l, new_page_t x, |
27 | struct list_head *moved, struct list_head *failed) { return -ENOSYS; } | 28 | unsigned long private) { return -ENOSYS; } |
28 | 29 | ||
29 | static inline int migrate_pages_to(struct list_head *pagelist, | 30 | static inline int migrate_pages_to(struct list_head *pagelist, |
30 | struct vm_area_struct *vma, int dest) { return 0; } | 31 | struct vm_area_struct *vma, int dest) { return 0; } |
31 | 32 | ||
32 | static inline int migrate_prep(void) { return -ENOSYS; } | 33 | static inline int migrate_prep(void) { return -ENOSYS; } |
33 | 34 | ||
35 | static inline int migrate_vmas(struct mm_struct *mm, | ||
36 | const nodemask_t *from, const nodemask_t *to, | ||
37 | unsigned long flags) | ||
38 | { | ||
39 | return -ENOSYS; | ||
40 | } | ||
41 | |||
34 | /* Possible settings for the migrate_page() method in address_operations */ | 42 | /* Possible settings for the migrate_page() method in address_operations */ |
35 | #define migrate_page NULL | 43 | #define migrate_page NULL |
36 | #define fail_migrate_page NULL | 44 | #define fail_migrate_page NULL |
diff --git a/include/linux/mii.h b/include/linux/mii.h index 68f5a0f392dd..beddc6d3b0f6 100644 --- a/include/linux/mii.h +++ b/include/linux/mii.h | |||
@@ -9,7 +9,6 @@ | |||
9 | #define __LINUX_MII_H__ | 9 | #define __LINUX_MII_H__ |
10 | 10 | ||
11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
12 | #include <linux/if.h> | ||
13 | 12 | ||
14 | /* Generic MII registers. */ | 13 | /* Generic MII registers. */ |
15 | 14 | ||
@@ -136,6 +135,20 @@ | |||
136 | #define LPA_1000FULL 0x0800 /* Link partner 1000BASE-T full duplex */ | 135 | #define LPA_1000FULL 0x0800 /* Link partner 1000BASE-T full duplex */ |
137 | #define LPA_1000HALF 0x0400 /* Link partner 1000BASE-T half duplex */ | 136 | #define LPA_1000HALF 0x0400 /* Link partner 1000BASE-T half duplex */ |
138 | 137 | ||
138 | /* This structure is used in all SIOCxMIIxxx ioctl calls */ | ||
139 | struct mii_ioctl_data { | ||
140 | __u16 phy_id; | ||
141 | __u16 reg_num; | ||
142 | __u16 val_in; | ||
143 | __u16 val_out; | ||
144 | }; | ||
145 | |||
146 | #ifdef __KERNEL__ | ||
147 | |||
148 | #include <linux/if.h> | ||
149 | |||
150 | struct ethtool_cmd; | ||
151 | |||
139 | struct mii_if_info { | 152 | struct mii_if_info { |
140 | int phy_id; | 153 | int phy_id; |
141 | int advertising; | 154 | int advertising; |
@@ -151,9 +164,6 @@ struct mii_if_info { | |||
151 | void (*mdio_write) (struct net_device *dev, int phy_id, int location, int val); | 164 | void (*mdio_write) (struct net_device *dev, int phy_id, int location, int val); |
152 | }; | 165 | }; |
153 | 166 | ||
154 | struct ethtool_cmd; | ||
155 | struct mii_ioctl_data; | ||
156 | |||
157 | extern int mii_link_ok (struct mii_if_info *mii); | 167 | extern int mii_link_ok (struct mii_if_info *mii); |
158 | extern int mii_nway_restart (struct mii_if_info *mii); | 168 | extern int mii_nway_restart (struct mii_if_info *mii); |
159 | extern int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd); | 169 | extern int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd); |
@@ -168,16 +178,6 @@ extern int generic_mii_ioctl(struct mii_if_info *mii_if, | |||
168 | unsigned int *duplex_changed); | 178 | unsigned int *duplex_changed); |
169 | 179 | ||
170 | 180 | ||
171 | |||
172 | /* This structure is used in all SIOCxMIIxxx ioctl calls */ | ||
173 | struct mii_ioctl_data { | ||
174 | u16 phy_id; | ||
175 | u16 reg_num; | ||
176 | u16 val_in; | ||
177 | u16 val_out; | ||
178 | }; | ||
179 | |||
180 | |||
181 | static inline struct mii_ioctl_data *if_mii(struct ifreq *rq) | 181 | static inline struct mii_ioctl_data *if_mii(struct ifreq *rq) |
182 | { | 182 | { |
183 | return (struct mii_ioctl_data *) &rq->ifr_ifru; | 183 | return (struct mii_ioctl_data *) &rq->ifr_ifru; |
@@ -235,5 +235,5 @@ static inline unsigned int mii_duplex (unsigned int duplex_lock, | |||
235 | return 0; | 235 | return 0; |
236 | } | 236 | } |
237 | 237 | ||
238 | 238 | #endif /* __KERNEL__ */ | |
239 | #endif /* __LINUX_MII_H__ */ | 239 | #endif /* __LINUX_MII_H__ */ |
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index 5b584dafb5a6..b03cfb91e228 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h | |||
@@ -40,7 +40,6 @@ struct miscdevice { | |||
40 | struct list_head list; | 40 | struct list_head list; |
41 | struct device *dev; | 41 | struct device *dev; |
42 | struct class_device *class; | 42 | struct class_device *class; |
43 | char devfs_name[64]; | ||
44 | }; | 43 | }; |
45 | 44 | ||
46 | extern int misc_register(struct miscdevice * misc); | 45 | extern int misc_register(struct miscdevice * misc); |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 1154684209a4..75179529e399 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -7,7 +7,6 @@ | |||
7 | 7 | ||
8 | #ifdef __KERNEL__ | 8 | #ifdef __KERNEL__ |
9 | 9 | ||
10 | #include <linux/config.h> | ||
11 | #include <linux/gfp.h> | 10 | #include <linux/gfp.h> |
12 | #include <linux/list.h> | 11 | #include <linux/list.h> |
13 | #include <linux/mmzone.h> | 12 | #include <linux/mmzone.h> |
@@ -37,7 +36,6 @@ extern int sysctl_legacy_va_layout; | |||
37 | #include <asm/page.h> | 36 | #include <asm/page.h> |
38 | #include <asm/pgtable.h> | 37 | #include <asm/pgtable.h> |
39 | #include <asm/processor.h> | 38 | #include <asm/processor.h> |
40 | #include <asm/atomic.h> | ||
41 | 39 | ||
42 | #define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n)) | 40 | #define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n)) |
43 | 41 | ||
@@ -146,7 +144,6 @@ extern unsigned int kobjsize(const void *objp); | |||
146 | 144 | ||
147 | #define VM_GROWSDOWN 0x00000100 /* general info on the segment */ | 145 | #define VM_GROWSDOWN 0x00000100 /* general info on the segment */ |
148 | #define VM_GROWSUP 0x00000200 | 146 | #define VM_GROWSUP 0x00000200 |
149 | #define VM_SHM 0x00000000 /* Means nothing: delete it later */ | ||
150 | #define VM_PFNMAP 0x00000400 /* Page-ranges managed without "struct page", just pure PFN */ | 147 | #define VM_PFNMAP 0x00000400 /* Page-ranges managed without "struct page", just pure PFN */ |
151 | #define VM_DENYWRITE 0x00000800 /* ETXTBSY on write attempts.. */ | 148 | #define VM_DENYWRITE 0x00000800 /* ETXTBSY on write attempts.. */ |
152 | 149 | ||
@@ -200,10 +197,16 @@ struct vm_operations_struct { | |||
200 | void (*close)(struct vm_area_struct * area); | 197 | void (*close)(struct vm_area_struct * area); |
201 | struct page * (*nopage)(struct vm_area_struct * area, unsigned long address, int *type); | 198 | struct page * (*nopage)(struct vm_area_struct * area, unsigned long address, int *type); |
202 | int (*populate)(struct vm_area_struct * area, unsigned long address, unsigned long len, pgprot_t prot, unsigned long pgoff, int nonblock); | 199 | int (*populate)(struct vm_area_struct * area, unsigned long address, unsigned long len, pgprot_t prot, unsigned long pgoff, int nonblock); |
200 | |||
201 | /* notification that a previously read-only page is about to become | ||
202 | * writable, if an error is returned it will cause a SIGBUS */ | ||
203 | int (*page_mkwrite)(struct vm_area_struct *vma, struct page *page); | ||
203 | #ifdef CONFIG_NUMA | 204 | #ifdef CONFIG_NUMA |
204 | int (*set_policy)(struct vm_area_struct *vma, struct mempolicy *new); | 205 | int (*set_policy)(struct vm_area_struct *vma, struct mempolicy *new); |
205 | struct mempolicy *(*get_policy)(struct vm_area_struct *vma, | 206 | struct mempolicy *(*get_policy)(struct vm_area_struct *vma, |
206 | unsigned long addr); | 207 | unsigned long addr); |
208 | int (*migrate)(struct vm_area_struct *vma, const nodemask_t *from, | ||
209 | const nodemask_t *to, unsigned long flags); | ||
207 | #endif | 210 | #endif |
208 | }; | 211 | }; |
209 | 212 | ||
@@ -466,10 +469,13 @@ static inline unsigned long page_zonenum(struct page *page) | |||
466 | struct zone; | 469 | struct zone; |
467 | extern struct zone *zone_table[]; | 470 | extern struct zone *zone_table[]; |
468 | 471 | ||
472 | static inline int page_zone_id(struct page *page) | ||
473 | { | ||
474 | return (page->flags >> ZONETABLE_PGSHIFT) & ZONETABLE_MASK; | ||
475 | } | ||
469 | static inline struct zone *page_zone(struct page *page) | 476 | static inline struct zone *page_zone(struct page *page) |
470 | { | 477 | { |
471 | return zone_table[(page->flags >> ZONETABLE_PGSHIFT) & | 478 | return zone_table[page_zone_id(page)]; |
472 | ZONETABLE_MASK]; | ||
473 | } | 479 | } |
474 | 480 | ||
475 | static inline unsigned long page_to_nid(struct page *page) | 481 | static inline unsigned long page_to_nid(struct page *page) |
@@ -508,6 +514,11 @@ static inline void set_page_links(struct page *page, unsigned long zone, | |||
508 | set_page_section(page, pfn_to_section_nr(pfn)); | 514 | set_page_section(page, pfn_to_section_nr(pfn)); |
509 | } | 515 | } |
510 | 516 | ||
517 | /* | ||
518 | * Some inline functions in vmstat.h depend on page_zone() | ||
519 | */ | ||
520 | #include <linux/vmstat.h> | ||
521 | |||
511 | #ifndef CONFIG_DISCONTIGMEM | 522 | #ifndef CONFIG_DISCONTIGMEM |
512 | /* The array of struct pages - for discontigmem use pgdat->lmem_map */ | 523 | /* The array of struct pages - for discontigmem use pgdat->lmem_map */ |
513 | extern struct page *mem_map; | 524 | extern struct page *mem_map; |
@@ -1023,13 +1034,20 @@ static inline void vm_stat_account(struct mm_struct *mm, | |||
1023 | } | 1034 | } |
1024 | #endif /* CONFIG_PROC_FS */ | 1035 | #endif /* CONFIG_PROC_FS */ |
1025 | 1036 | ||
1037 | static inline void | ||
1038 | debug_check_no_locks_freed(const void *from, unsigned long len) | ||
1039 | { | ||
1040 | mutex_debug_check_no_locks_freed(from, len); | ||
1041 | rt_mutex_debug_check_no_locks_freed(from, len); | ||
1042 | } | ||
1043 | |||
1026 | #ifndef CONFIG_DEBUG_PAGEALLOC | 1044 | #ifndef CONFIG_DEBUG_PAGEALLOC |
1027 | static inline void | 1045 | static inline void |
1028 | kernel_map_pages(struct page *page, int numpages, int enable) | 1046 | kernel_map_pages(struct page *page, int numpages, int enable) |
1029 | { | 1047 | { |
1030 | if (!PageHighMem(page) && !enable) | 1048 | if (!PageHighMem(page) && !enable) |
1031 | mutex_debug_check_no_locks_freed(page_address(page), | 1049 | debug_check_no_locks_freed(page_address(page), |
1032 | numpages * PAGE_SIZE); | 1050 | numpages * PAGE_SIZE); |
1033 | } | 1051 | } |
1034 | #endif | 1052 | #endif |
1035 | 1053 | ||
@@ -1058,5 +1076,7 @@ void drop_slab(void); | |||
1058 | extern int randomize_va_space; | 1076 | extern int randomize_va_space; |
1059 | #endif | 1077 | #endif |
1060 | 1078 | ||
1079 | const char *arch_vma_name(struct vm_area_struct *vma); | ||
1080 | |||
1061 | #endif /* __KERNEL__ */ | 1081 | #endif /* __KERNEL__ */ |
1062 | #endif /* _LINUX_MM_H */ | 1082 | #endif /* _LINUX_MM_H */ |
diff --git a/include/linux/mman.h b/include/linux/mman.h index 18a5689ef748..87920a0852a3 100644 --- a/include/linux/mman.h +++ b/include/linux/mman.h | |||
@@ -1,10 +1,6 @@ | |||
1 | #ifndef _LINUX_MMAN_H | 1 | #ifndef _LINUX_MMAN_H |
2 | #define _LINUX_MMAN_H | 2 | #define _LINUX_MMAN_H |
3 | 3 | ||
4 | #include <linux/config.h> | ||
5 | #include <linux/mm.h> | ||
6 | |||
7 | #include <asm/atomic.h> | ||
8 | #include <asm/mman.h> | 4 | #include <asm/mman.h> |
9 | 5 | ||
10 | #define MREMAP_MAYMOVE 1 | 6 | #define MREMAP_MAYMOVE 1 |
@@ -13,6 +9,12 @@ | |||
13 | #define OVERCOMMIT_GUESS 0 | 9 | #define OVERCOMMIT_GUESS 0 |
14 | #define OVERCOMMIT_ALWAYS 1 | 10 | #define OVERCOMMIT_ALWAYS 1 |
15 | #define OVERCOMMIT_NEVER 2 | 11 | #define OVERCOMMIT_NEVER 2 |
12 | |||
13 | #ifdef __KERNEL__ | ||
14 | #include <linux/mm.h> | ||
15 | |||
16 | #include <asm/atomic.h> | ||
17 | |||
16 | extern int sysctl_overcommit_memory; | 18 | extern int sysctl_overcommit_memory; |
17 | extern int sysctl_overcommit_ratio; | 19 | extern int sysctl_overcommit_ratio; |
18 | extern atomic_t vm_committed_space; | 20 | extern atomic_t vm_committed_space; |
@@ -63,5 +65,5 @@ calc_vm_flag_bits(unsigned long flags) | |||
63 | _calc_vm_trans(flags, MAP_EXECUTABLE, VM_EXECUTABLE) | | 65 | _calc_vm_trans(flags, MAP_EXECUTABLE, VM_EXECUTABLE) | |
64 | _calc_vm_trans(flags, MAP_LOCKED, VM_LOCKED ); | 66 | _calc_vm_trans(flags, MAP_LOCKED, VM_LOCKED ); |
65 | } | 67 | } |
66 | 68 | #endif /* __KERNEL__ */ | |
67 | #endif /* _LINUX_MMAN_H */ | 69 | #endif /* _LINUX_MMAN_H */ |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 2d8337150493..27e748eb72b0 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -4,7 +4,6 @@ | |||
4 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
5 | #ifndef __ASSEMBLY__ | 5 | #ifndef __ASSEMBLY__ |
6 | 6 | ||
7 | #include <linux/config.h> | ||
8 | #include <linux/spinlock.h> | 7 | #include <linux/spinlock.h> |
9 | #include <linux/list.h> | 8 | #include <linux/list.h> |
10 | #include <linux/wait.h> | 9 | #include <linux/wait.h> |
@@ -47,6 +46,27 @@ struct zone_padding { | |||
47 | #define ZONE_PADDING(name) | 46 | #define ZONE_PADDING(name) |
48 | #endif | 47 | #endif |
49 | 48 | ||
49 | enum zone_stat_item { | ||
50 | NR_ANON_PAGES, /* Mapped anonymous pages */ | ||
51 | NR_FILE_MAPPED, /* pagecache pages mapped into pagetables. | ||
52 | only modified from process context */ | ||
53 | NR_FILE_PAGES, | ||
54 | NR_SLAB, /* Pages used by slab allocator */ | ||
55 | NR_PAGETABLE, /* used for pagetables */ | ||
56 | NR_FILE_DIRTY, | ||
57 | NR_WRITEBACK, | ||
58 | NR_UNSTABLE_NFS, /* NFS unstable pages */ | ||
59 | NR_BOUNCE, | ||
60 | #ifdef CONFIG_NUMA | ||
61 | NUMA_HIT, /* allocated in intended node */ | ||
62 | NUMA_MISS, /* allocated in non intended node */ | ||
63 | NUMA_FOREIGN, /* was intended here, hit elsewhere */ | ||
64 | NUMA_INTERLEAVE_HIT, /* interleaver preferred this zone */ | ||
65 | NUMA_LOCAL, /* allocation from local node */ | ||
66 | NUMA_OTHER, /* allocation from other node */ | ||
67 | #endif | ||
68 | NR_VM_ZONE_STAT_ITEMS }; | ||
69 | |||
50 | struct per_cpu_pages { | 70 | struct per_cpu_pages { |
51 | int count; /* number of pages in the list */ | 71 | int count; /* number of pages in the list */ |
52 | int high; /* high watermark, emptying needed */ | 72 | int high; /* high watermark, emptying needed */ |
@@ -56,13 +76,8 @@ struct per_cpu_pages { | |||
56 | 76 | ||
57 | struct per_cpu_pageset { | 77 | struct per_cpu_pageset { |
58 | struct per_cpu_pages pcp[2]; /* 0: hot. 1: cold */ | 78 | struct per_cpu_pages pcp[2]; /* 0: hot. 1: cold */ |
59 | #ifdef CONFIG_NUMA | 79 | #ifdef CONFIG_SMP |
60 | unsigned long numa_hit; /* allocated in intended node */ | 80 | s8 vm_stat_diff[NR_VM_ZONE_STAT_ITEMS]; |
61 | unsigned long numa_miss; /* allocated in non intended node */ | ||
62 | unsigned long numa_foreign; /* was intended here, hit elsewhere */ | ||
63 | unsigned long interleave_hit; /* interleaver prefered this zone */ | ||
64 | unsigned long local_node; /* allocation from local node */ | ||
65 | unsigned long other_node; /* allocation from other node */ | ||
66 | #endif | 81 | #endif |
67 | } ____cacheline_aligned_in_smp; | 82 | } ____cacheline_aligned_in_smp; |
68 | 83 | ||
@@ -166,12 +181,8 @@ struct zone { | |||
166 | /* A count of how many reclaimers are scanning this zone */ | 181 | /* A count of how many reclaimers are scanning this zone */ |
167 | atomic_t reclaim_in_progress; | 182 | atomic_t reclaim_in_progress; |
168 | 183 | ||
169 | /* | 184 | /* Zone statistics */ |
170 | * timestamp (in jiffies) of the last zone reclaim that did not | 185 | atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS]; |
171 | * result in freeing of pages. This is used to avoid repeated scans | ||
172 | * if all memory in the zone is in use. | ||
173 | */ | ||
174 | unsigned long last_unsuccessful_zone_reclaim; | ||
175 | 186 | ||
176 | /* | 187 | /* |
177 | * prev_priority holds the scanning priority for this zone. It is | 188 | * prev_priority holds the scanning priority for this zone. It is |
@@ -198,7 +209,7 @@ struct zone { | |||
198 | 209 | ||
199 | /* | 210 | /* |
200 | * wait_table -- the array holding the hash table | 211 | * wait_table -- the array holding the hash table |
201 | * wait_table_size -- the size of the hash table array | 212 | * wait_table_hash_nr_entries -- the size of the hash table array |
202 | * wait_table_bits -- wait_table_size == (1 << wait_table_bits) | 213 | * wait_table_bits -- wait_table_size == (1 << wait_table_bits) |
203 | * | 214 | * |
204 | * The purpose of all these is to keep track of the people | 215 | * The purpose of all these is to keep track of the people |
@@ -221,7 +232,7 @@ struct zone { | |||
221 | * free_area_init_core() performs the initialization of them. | 232 | * free_area_init_core() performs the initialization of them. |
222 | */ | 233 | */ |
223 | wait_queue_head_t * wait_table; | 234 | wait_queue_head_t * wait_table; |
224 | unsigned long wait_table_size; | 235 | unsigned long wait_table_hash_nr_entries; |
225 | unsigned long wait_table_bits; | 236 | unsigned long wait_table_bits; |
226 | 237 | ||
227 | /* | 238 | /* |
@@ -334,6 +345,9 @@ void wakeup_kswapd(struct zone *zone, int order); | |||
334 | int zone_watermark_ok(struct zone *z, int order, unsigned long mark, | 345 | int zone_watermark_ok(struct zone *z, int order, unsigned long mark, |
335 | int classzone_idx, int alloc_flags); | 346 | int classzone_idx, int alloc_flags); |
336 | 347 | ||
348 | extern int init_currently_empty_zone(struct zone *zone, unsigned long start_pfn, | ||
349 | unsigned long size); | ||
350 | |||
337 | #ifdef CONFIG_HAVE_MEMORY_PRESENT | 351 | #ifdef CONFIG_HAVE_MEMORY_PRESENT |
338 | void memory_present(int nid, unsigned long start, unsigned long end); | 352 | void memory_present(int nid, unsigned long start, unsigned long end); |
339 | #else | 353 | #else |
@@ -507,6 +521,10 @@ struct mem_section { | |||
507 | * pages. However, it is stored with some other magic. | 521 | * pages. However, it is stored with some other magic. |
508 | * (see sparse.c::sparse_init_one_section()) | 522 | * (see sparse.c::sparse_init_one_section()) |
509 | * | 523 | * |
524 | * Additionally during early boot we encode node id of | ||
525 | * the location of the section here to guide allocation. | ||
526 | * (see sparse.c::memory_present()) | ||
527 | * | ||
510 | * Making it a UL at least makes someone do a cast | 528 | * Making it a UL at least makes someone do a cast |
511 | * before using it wrong. | 529 | * before using it wrong. |
512 | */ | 530 | */ |
@@ -546,6 +564,7 @@ extern int __section_nr(struct mem_section* ms); | |||
546 | #define SECTION_HAS_MEM_MAP (1UL<<1) | 564 | #define SECTION_HAS_MEM_MAP (1UL<<1) |
547 | #define SECTION_MAP_LAST_BIT (1UL<<2) | 565 | #define SECTION_MAP_LAST_BIT (1UL<<2) |
548 | #define SECTION_MAP_MASK (~(SECTION_MAP_LAST_BIT-1)) | 566 | #define SECTION_MAP_MASK (~(SECTION_MAP_LAST_BIT-1)) |
567 | #define SECTION_NID_SHIFT 2 | ||
549 | 568 | ||
550 | static inline struct page *__section_mem_map_addr(struct mem_section *section) | 569 | static inline struct page *__section_mem_map_addr(struct mem_section *section) |
551 | { | 570 | { |
diff --git a/include/linux/module.h b/include/linux/module.h index eaec13ddd667..9e9dc7c24d95 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -6,7 +6,6 @@ | |||
6 | * Rewritten by Richard Henderson <rth@tamu.edu> Dec 1996 | 6 | * Rewritten by Richard Henderson <rth@tamu.edu> Dec 1996 |
7 | * Rewritten again by Rusty Russell, 2002 | 7 | * Rewritten again by Rusty Russell, 2002 |
8 | */ | 8 | */ |
9 | #include <linux/config.h> | ||
10 | #include <linux/sched.h> | 9 | #include <linux/sched.h> |
11 | #include <linux/spinlock.h> | 10 | #include <linux/spinlock.h> |
12 | #include <linux/list.h> | 11 | #include <linux/list.h> |
@@ -106,6 +105,8 @@ extern struct module __this_module; | |||
106 | * "GPL and additional rights" [GNU Public License v2 rights and more] | 105 | * "GPL and additional rights" [GNU Public License v2 rights and more] |
107 | * "Dual BSD/GPL" [GNU Public License v2 | 106 | * "Dual BSD/GPL" [GNU Public License v2 |
108 | * or BSD license choice] | 107 | * or BSD license choice] |
108 | * "Dual MIT/GPL" [GNU Public License v2 | ||
109 | * or MIT license choice] | ||
109 | * "Dual MPL/GPL" [GNU Public License v2 | 110 | * "Dual MPL/GPL" [GNU Public License v2 |
110 | * or Mozilla license choice] | 111 | * or Mozilla license choice] |
111 | * | 112 | * |
@@ -202,6 +203,15 @@ void *__symbol_get_gpl(const char *symbol); | |||
202 | #define EXPORT_SYMBOL_GPL_FUTURE(sym) \ | 203 | #define EXPORT_SYMBOL_GPL_FUTURE(sym) \ |
203 | __EXPORT_SYMBOL(sym, "_gpl_future") | 204 | __EXPORT_SYMBOL(sym, "_gpl_future") |
204 | 205 | ||
206 | |||
207 | #ifdef CONFIG_UNUSED_SYMBOLS | ||
208 | #define EXPORT_UNUSED_SYMBOL(sym) __EXPORT_SYMBOL(sym, "_unused") | ||
209 | #define EXPORT_UNUSED_SYMBOL_GPL(sym) __EXPORT_SYMBOL(sym, "_unused_gpl") | ||
210 | #else | ||
211 | #define EXPORT_UNUSED_SYMBOL(sym) | ||
212 | #define EXPORT_UNUSED_SYMBOL_GPL(sym) | ||
213 | #endif | ||
214 | |||
205 | #endif | 215 | #endif |
206 | 216 | ||
207 | struct module_ref | 217 | struct module_ref |
@@ -260,6 +270,15 @@ struct module | |||
260 | unsigned int num_gpl_syms; | 270 | unsigned int num_gpl_syms; |
261 | const unsigned long *gpl_crcs; | 271 | const unsigned long *gpl_crcs; |
262 | 272 | ||
273 | /* unused exported symbols. */ | ||
274 | const struct kernel_symbol *unused_syms; | ||
275 | unsigned int num_unused_syms; | ||
276 | const unsigned long *unused_crcs; | ||
277 | /* GPL-only, unused exported symbols. */ | ||
278 | const struct kernel_symbol *unused_gpl_syms; | ||
279 | unsigned int num_unused_gpl_syms; | ||
280 | const unsigned long *unused_gpl_crcs; | ||
281 | |||
263 | /* symbols that will be GPL-only in the near future. */ | 282 | /* symbols that will be GPL-only in the near future. */ |
264 | const struct kernel_symbol *gpl_future_syms; | 283 | const struct kernel_symbol *gpl_future_syms; |
265 | unsigned int num_gpl_future_syms; | 284 | unsigned int num_gpl_future_syms; |
@@ -284,6 +303,9 @@ struct module | |||
284 | /* The size of the executable code in each section. */ | 303 | /* The size of the executable code in each section. */ |
285 | unsigned long init_text_size, core_text_size; | 304 | unsigned long init_text_size, core_text_size; |
286 | 305 | ||
306 | /* The handle returned from unwind_add_table. */ | ||
307 | void *unwind_info; | ||
308 | |||
287 | /* Arch-specific module values */ | 309 | /* Arch-specific module values */ |
288 | struct mod_arch_specific arch; | 310 | struct mod_arch_specific arch; |
289 | 311 | ||
@@ -452,6 +474,8 @@ void module_remove_driver(struct device_driver *); | |||
452 | #define EXPORT_SYMBOL(sym) | 474 | #define EXPORT_SYMBOL(sym) |
453 | #define EXPORT_SYMBOL_GPL(sym) | 475 | #define EXPORT_SYMBOL_GPL(sym) |
454 | #define EXPORT_SYMBOL_GPL_FUTURE(sym) | 476 | #define EXPORT_SYMBOL_GPL_FUTURE(sym) |
477 | #define EXPORT_UNUSED_SYMBOL(sym) | ||
478 | #define EXPORT_UNUSED_SYMBOL_GPL(sym) | ||
455 | 479 | ||
456 | /* Given an address, look for it in the exception tables. */ | 480 | /* Given an address, look for it in the exception tables. */ |
457 | static inline const struct exception_table_entry * | 481 | static inline const struct exception_table_entry * |
@@ -557,13 +581,4 @@ static inline void module_remove_driver(struct device_driver *driver) | |||
557 | 581 | ||
558 | #define __MODULE_STRING(x) __stringify(x) | 582 | #define __MODULE_STRING(x) __stringify(x) |
559 | 583 | ||
560 | /* Use symbol_get and symbol_put instead. You'll thank me. */ | ||
561 | #define HAVE_INTER_MODULE | ||
562 | extern void __deprecated inter_module_register(const char *, | ||
563 | struct module *, const void *); | ||
564 | extern void __deprecated inter_module_unregister(const char *); | ||
565 | extern const void * __deprecated inter_module_get_request(const char *, | ||
566 | const char *); | ||
567 | extern void __deprecated inter_module_put(const char *); | ||
568 | |||
569 | #endif /* _LINUX_MODULE_H */ | 584 | #endif /* _LINUX_MODULE_H */ |
diff --git a/include/linux/mount.h b/include/linux/mount.h index b7472ae91fa4..403d1a97c512 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h | |||
@@ -17,12 +17,19 @@ | |||
17 | #include <linux/spinlock.h> | 17 | #include <linux/spinlock.h> |
18 | #include <asm/atomic.h> | 18 | #include <asm/atomic.h> |
19 | 19 | ||
20 | struct super_block; | ||
21 | struct vfsmount; | ||
22 | struct dentry; | ||
23 | struct namespace; | ||
24 | |||
20 | #define MNT_NOSUID 0x01 | 25 | #define MNT_NOSUID 0x01 |
21 | #define MNT_NODEV 0x02 | 26 | #define MNT_NODEV 0x02 |
22 | #define MNT_NOEXEC 0x04 | 27 | #define MNT_NOEXEC 0x04 |
23 | #define MNT_NOATIME 0x08 | 28 | #define MNT_NOATIME 0x08 |
24 | #define MNT_NODIRATIME 0x10 | 29 | #define MNT_NODIRATIME 0x10 |
25 | 30 | ||
31 | #define MNT_SHRINKABLE 0x100 | ||
32 | |||
26 | #define MNT_SHARED 0x1000 /* if the vfsmount is a shared mount */ | 33 | #define MNT_SHARED 0x1000 /* if the vfsmount is a shared mount */ |
27 | #define MNT_UNBINDABLE 0x2000 /* if the vfsmount is a unbindable mount */ | 34 | #define MNT_UNBINDABLE 0x2000 /* if the vfsmount is a unbindable mount */ |
28 | #define MNT_PNODE_MASK 0x3000 /* propogation flag mask */ | 35 | #define MNT_PNODE_MASK 0x3000 /* propogation flag mask */ |
@@ -73,12 +80,18 @@ extern struct vfsmount *alloc_vfsmnt(const char *name); | |||
73 | extern struct vfsmount *do_kern_mount(const char *fstype, int flags, | 80 | extern struct vfsmount *do_kern_mount(const char *fstype, int flags, |
74 | const char *name, void *data); | 81 | const char *name, void *data); |
75 | 82 | ||
83 | struct file_system_type; | ||
84 | extern struct vfsmount *vfs_kern_mount(struct file_system_type *type, | ||
85 | int flags, const char *name, | ||
86 | void *data); | ||
87 | |||
76 | struct nameidata; | 88 | struct nameidata; |
77 | 89 | ||
78 | extern int do_add_mount(struct vfsmount *newmnt, struct nameidata *nd, | 90 | extern int do_add_mount(struct vfsmount *newmnt, struct nameidata *nd, |
79 | int mnt_flags, struct list_head *fslist); | 91 | int mnt_flags, struct list_head *fslist); |
80 | 92 | ||
81 | extern void mark_mounts_for_expiry(struct list_head *mounts); | 93 | extern void mark_mounts_for_expiry(struct list_head *mounts); |
94 | extern void shrink_submounts(struct vfsmount *mountpoint, struct list_head *mounts); | ||
82 | 95 | ||
83 | extern spinlock_t vfsmount_lock; | 96 | extern spinlock_t vfsmount_lock; |
84 | extern dev_t name_to_dev_t(char *name); | 97 | extern dev_t name_to_dev_t(char *name); |
diff --git a/include/linux/msg.h b/include/linux/msg.h index 903e0ab8101f..acc7c174ff00 100644 --- a/include/linux/msg.h +++ b/include/linux/msg.h | |||
@@ -2,7 +2,6 @@ | |||
2 | #define _LINUX_MSG_H | 2 | #define _LINUX_MSG_H |
3 | 3 | ||
4 | #include <linux/ipc.h> | 4 | #include <linux/ipc.h> |
5 | #include <linux/list.h> | ||
6 | 5 | ||
7 | /* ipcs ctl commands */ | 6 | /* ipcs ctl commands */ |
8 | #define MSG_STAT 11 | 7 | #define MSG_STAT 11 |
@@ -63,6 +62,7 @@ struct msginfo { | |||
63 | #define MSGSEG (__MSGSEG <= 0xffff ? __MSGSEG : 0xffff) | 62 | #define MSGSEG (__MSGSEG <= 0xffff ? __MSGSEG : 0xffff) |
64 | 63 | ||
65 | #ifdef __KERNEL__ | 64 | #ifdef __KERNEL__ |
65 | #include <linux/list.h> | ||
66 | 66 | ||
67 | /* one msg_msg structure for each message */ | 67 | /* one msg_msg structure for each message */ |
68 | struct msg_msg { | 68 | struct msg_msg { |
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h index 23a568910341..09bfae6938b3 100644 --- a/include/linux/mtd/cfi.h +++ b/include/linux/mtd/cfi.h | |||
@@ -7,7 +7,6 @@ | |||
7 | #ifndef __MTD_CFI_H__ | 7 | #ifndef __MTD_CFI_H__ |
8 | #define __MTD_CFI_H__ | 8 | #define __MTD_CFI_H__ |
9 | 9 | ||
10 | #include <linux/config.h> | ||
11 | #include <linux/delay.h> | 10 | #include <linux/delay.h> |
12 | #include <linux/types.h> | 11 | #include <linux/types.h> |
13 | #include <linux/interrupt.h> | 12 | #include <linux/interrupt.h> |
diff --git a/include/linux/mtd/inftl.h b/include/linux/mtd/inftl.h index d7eaa40e5ab0..6977780e548f 100644 --- a/include/linux/mtd/inftl.h +++ b/include/linux/mtd/inftl.h | |||
@@ -46,7 +46,7 @@ struct INFTLrecord { | |||
46 | unsigned int nb_blocks; /* number of physical blocks */ | 46 | unsigned int nb_blocks; /* number of physical blocks */ |
47 | unsigned int nb_boot_blocks; /* number of blocks used by the bios */ | 47 | unsigned int nb_boot_blocks; /* number of blocks used by the bios */ |
48 | struct erase_info instr; | 48 | struct erase_info instr; |
49 | struct nand_oobinfo oobinfo; | 49 | struct nand_ecclayout oobinfo; |
50 | }; | 50 | }; |
51 | 51 | ||
52 | int INFTL_mount(struct INFTLrecord *s); | 52 | int INFTL_mount(struct INFTLrecord *s); |
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h index 7dfd6e1fcde7..28d461d862bd 100644 --- a/include/linux/mtd/map.h +++ b/include/linux/mtd/map.h | |||
@@ -5,7 +5,6 @@ | |||
5 | #ifndef __LINUX_MTD_MAP_H__ | 5 | #ifndef __LINUX_MTD_MAP_H__ |
6 | #define __LINUX_MTD_MAP_H__ | 6 | #define __LINUX_MTD_MAP_H__ |
7 | 7 | ||
8 | #include <linux/config.h> | ||
9 | #include <linux/types.h> | 8 | #include <linux/types.h> |
10 | #include <linux/list.h> | 9 | #include <linux/list.h> |
11 | #include <linux/string.h> | 10 | #include <linux/string.h> |
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index b6f2fdae65c6..9b7a2b525d63 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
@@ -13,7 +13,6 @@ | |||
13 | #error This is a kernel header. Perhaps include mtd-user.h instead? | 13 | #error This is a kernel header. Perhaps include mtd-user.h instead? |
14 | #endif | 14 | #endif |
15 | 15 | ||
16 | #include <linux/config.h> | ||
17 | #include <linux/types.h> | 16 | #include <linux/types.h> |
18 | #include <linux/module.h> | 17 | #include <linux/module.h> |
19 | #include <linux/uio.h> | 18 | #include <linux/uio.h> |
@@ -56,18 +55,69 @@ struct mtd_erase_region_info { | |||
56 | u_int32_t numblocks; /* Number of blocks of erasesize in this region */ | 55 | u_int32_t numblocks; /* Number of blocks of erasesize in this region */ |
57 | }; | 56 | }; |
58 | 57 | ||
58 | /* | ||
59 | * oob operation modes | ||
60 | * | ||
61 | * MTD_OOB_PLACE: oob data are placed at the given offset | ||
62 | * MTD_OOB_AUTO: oob data are automatically placed at the free areas | ||
63 | * which are defined by the ecclayout | ||
64 | * MTD_OOB_RAW: mode to read raw data+oob in one chunk. The oob data | ||
65 | * is inserted into the data. Thats a raw image of the | ||
66 | * flash contents. | ||
67 | */ | ||
68 | typedef enum { | ||
69 | MTD_OOB_PLACE, | ||
70 | MTD_OOB_AUTO, | ||
71 | MTD_OOB_RAW, | ||
72 | } mtd_oob_mode_t; | ||
73 | |||
74 | /** | ||
75 | * struct mtd_oob_ops - oob operation operands | ||
76 | * @mode: operation mode | ||
77 | * | ||
78 | * @len: number of bytes to write/read. When a data buffer is given | ||
79 | * (datbuf != NULL) this is the number of data bytes. When | ||
80 | + no data buffer is available this is the number of oob bytes. | ||
81 | * | ||
82 | * @retlen: number of bytes written/read. When a data buffer is given | ||
83 | * (datbuf != NULL) this is the number of data bytes. When | ||
84 | + no data buffer is available this is the number of oob bytes. | ||
85 | * | ||
86 | * @ooblen: number of oob bytes per page | ||
87 | * @ooboffs: offset of oob data in the oob area (only relevant when | ||
88 | * mode = MTD_OOB_PLACE) | ||
89 | * @datbuf: data buffer - if NULL only oob data are read/written | ||
90 | * @oobbuf: oob data buffer | ||
91 | */ | ||
92 | struct mtd_oob_ops { | ||
93 | mtd_oob_mode_t mode; | ||
94 | size_t len; | ||
95 | size_t retlen; | ||
96 | size_t ooblen; | ||
97 | uint32_t ooboffs; | ||
98 | uint8_t *datbuf; | ||
99 | uint8_t *oobbuf; | ||
100 | }; | ||
101 | |||
59 | struct mtd_info { | 102 | struct mtd_info { |
60 | u_char type; | 103 | u_char type; |
61 | u_int32_t flags; | 104 | u_int32_t flags; |
62 | u_int32_t size; // Total size of the MTD | 105 | u_int32_t size; // Total size of the MTD |
63 | 106 | ||
64 | /* "Major" erase size for the device. Naïve users may take this | 107 | /* "Major" erase size for the device. Naïve users may take this |
65 | * to be the only erase size available, or may use the more detailed | 108 | * to be the only erase size available, or may use the more detailed |
66 | * information below if they desire | 109 | * information below if they desire |
67 | */ | 110 | */ |
68 | u_int32_t erasesize; | 111 | u_int32_t erasesize; |
112 | /* Minimal writable flash unit size. In case of NOR flash it is 1 (even | ||
113 | * though individual bits can be cleared), in case of NAND flash it is | ||
114 | * one NAND page (or half, or one-fourths of it), in case of ECC-ed NOR | ||
115 | * it is of ECC block size, etc. It is illegal to have writesize = 0. | ||
116 | * Any driver registering a struct mtd_info must ensure a writesize of | ||
117 | * 1 or larger. | ||
118 | */ | ||
119 | u_int32_t writesize; | ||
69 | 120 | ||
70 | u_int32_t oobblock; // Size of OOB blocks (e.g. 512) | ||
71 | u_int32_t oobsize; // Amount of OOB data per block (e.g. 16) | 121 | u_int32_t oobsize; // Amount of OOB data per block (e.g. 16) |
72 | u_int32_t ecctype; | 122 | u_int32_t ecctype; |
73 | u_int32_t eccsize; | 123 | u_int32_t eccsize; |
@@ -79,7 +129,6 @@ struct mtd_info { | |||
79 | * MTD_PROGRAM_REGIONS flag is set. | 129 | * MTD_PROGRAM_REGIONS flag is set. |
80 | * (Maybe we should have an union for those?) | 130 | * (Maybe we should have an union for those?) |
81 | */ | 131 | */ |
82 | #define MTD_PROGREGION_SIZE(mtd) (mtd)->oobblock | ||
83 | #define MTD_PROGREGION_CTRLMODE_VALID(mtd) (mtd)->oobsize | 132 | #define MTD_PROGREGION_CTRLMODE_VALID(mtd) (mtd)->oobsize |
84 | #define MTD_PROGREGION_CTRLMODE_INVALID(mtd) (mtd)->ecctype | 133 | #define MTD_PROGREGION_CTRLMODE_INVALID(mtd) (mtd)->ecctype |
85 | 134 | ||
@@ -87,9 +136,8 @@ struct mtd_info { | |||
87 | char *name; | 136 | char *name; |
88 | int index; | 137 | int index; |
89 | 138 | ||
90 | // oobinfo is a nand_oobinfo structure, which can be set by iotcl (MEMSETOOBINFO) | 139 | /* ecc layout structure pointer - read only ! */ |
91 | struct nand_oobinfo oobinfo; | 140 | struct nand_ecclayout *ecclayout; |
92 | u_int32_t oobavail; // Number of bytes in OOB area available for fs | ||
93 | 141 | ||
94 | /* Data for variable erase regions. If numeraseregions is zero, | 142 | /* Data for variable erase regions. If numeraseregions is zero, |
95 | * it means that the whole device has erasesize as given above. | 143 | * it means that the whole device has erasesize as given above. |
@@ -112,11 +160,10 @@ struct mtd_info { | |||
112 | int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); | 160 | int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); |
113 | int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); | 161 | int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); |
114 | 162 | ||
115 | int (*read_ecc) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel); | 163 | int (*read_oob) (struct mtd_info *mtd, loff_t from, |
116 | int (*write_ecc) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel); | 164 | struct mtd_oob_ops *ops); |
117 | 165 | int (*write_oob) (struct mtd_info *mtd, loff_t to, | |
118 | int (*read_oob) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); | 166 | struct mtd_oob_ops *ops); |
119 | int (*write_oob) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); | ||
120 | 167 | ||
121 | /* | 168 | /* |
122 | * Methods to access the protection register area, present in some | 169 | * Methods to access the protection register area, present in some |
@@ -130,17 +177,11 @@ struct mtd_info { | |||
130 | int (*write_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); | 177 | int (*write_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); |
131 | int (*lock_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len); | 178 | int (*lock_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len); |
132 | 179 | ||
133 | /* kvec-based read/write methods. We need these especially for NAND flash, | 180 | /* kvec-based read/write methods. |
134 | with its limited number of write cycles per erase. | ||
135 | NB: The 'count' parameter is the number of _vectors_, each of | 181 | NB: The 'count' parameter is the number of _vectors_, each of |
136 | which contains an (ofs, len) tuple. | 182 | which contains an (ofs, len) tuple. |
137 | */ | 183 | */ |
138 | int (*readv) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from, size_t *retlen); | ||
139 | int (*readv_ecc) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from, | ||
140 | size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel); | ||
141 | int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen); | 184 | int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen); |
142 | int (*writev_ecc) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, | ||
143 | size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel); | ||
144 | 185 | ||
145 | /* Sync */ | 186 | /* Sync */ |
146 | void (*sync) (struct mtd_info *mtd); | 187 | void (*sync) (struct mtd_info *mtd); |
@@ -159,6 +200,9 @@ struct mtd_info { | |||
159 | 200 | ||
160 | struct notifier_block reboot_notifier; /* default mode before reboot */ | 201 | struct notifier_block reboot_notifier; /* default mode before reboot */ |
161 | 202 | ||
203 | /* ECC status information */ | ||
204 | struct mtd_ecc_stats ecc_stats; | ||
205 | |||
162 | void *priv; | 206 | void *priv; |
163 | 207 | ||
164 | struct module *owner; | 208 | struct module *owner; |
@@ -192,20 +236,6 @@ int default_mtd_writev(struct mtd_info *mtd, const struct kvec *vecs, | |||
192 | int default_mtd_readv(struct mtd_info *mtd, struct kvec *vecs, | 236 | int default_mtd_readv(struct mtd_info *mtd, struct kvec *vecs, |
193 | unsigned long count, loff_t from, size_t *retlen); | 237 | unsigned long count, loff_t from, size_t *retlen); |
194 | 238 | ||
195 | #define MTD_ERASE(mtd, args...) (*(mtd->erase))(mtd, args) | ||
196 | #define MTD_POINT(mtd, a,b,c,d) (*(mtd->point))(mtd, a,b,c, (u_char **)(d)) | ||
197 | #define MTD_UNPOINT(mtd, arg) (*(mtd->unpoint))(mtd, (u_char *)arg) | ||
198 | #define MTD_READ(mtd, args...) (*(mtd->read))(mtd, args) | ||
199 | #define MTD_WRITE(mtd, args...) (*(mtd->write))(mtd, args) | ||
200 | #define MTD_READV(mtd, args...) (*(mtd->readv))(mtd, args) | ||
201 | #define MTD_WRITEV(mtd, args...) (*(mtd->writev))(mtd, args) | ||
202 | #define MTD_READECC(mtd, args...) (*(mtd->read_ecc))(mtd, args) | ||
203 | #define MTD_WRITEECC(mtd, args...) (*(mtd->write_ecc))(mtd, args) | ||
204 | #define MTD_READOOB(mtd, args...) (*(mtd->read_oob))(mtd, args) | ||
205 | #define MTD_WRITEOOB(mtd, args...) (*(mtd->write_oob))(mtd, args) | ||
206 | #define MTD_SYNC(mtd) do { if (mtd->sync) (*(mtd->sync))(mtd); } while (0) | ||
207 | |||
208 | |||
209 | #ifdef CONFIG_MTD_PARTITIONS | 239 | #ifdef CONFIG_MTD_PARTITIONS |
210 | void mtd_erase_callback(struct erase_info *instr); | 240 | void mtd_erase_callback(struct erase_info *instr); |
211 | #else | 241 | #else |
@@ -226,7 +256,7 @@ static inline void mtd_erase_callback(struct erase_info *instr) | |||
226 | 256 | ||
227 | #ifdef CONFIG_MTD_DEBUG | 257 | #ifdef CONFIG_MTD_DEBUG |
228 | #define DEBUG(n, args...) \ | 258 | #define DEBUG(n, args...) \ |
229 | do { \ | 259 | do { \ |
230 | if (n <= CONFIG_MTD_DEBUG_VERBOSE) \ | 260 | if (n <= CONFIG_MTD_DEBUG_VERBOSE) \ |
231 | printk(KERN_INFO args); \ | 261 | printk(KERN_INFO args); \ |
232 | } while(0) | 262 | } while(0) |
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index da5e67b3fc70..66559272ebcb 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -11,52 +11,15 @@ | |||
11 | * it under the terms of the GNU General Public License version 2 as | 11 | * it under the terms of the GNU General Public License version 2 as |
12 | * published by the Free Software Foundation. | 12 | * published by the Free Software Foundation. |
13 | * | 13 | * |
14 | * Info: | 14 | * Info: |
15 | * Contains standard defines and IDs for NAND flash devices | 15 | * Contains standard defines and IDs for NAND flash devices |
16 | * | 16 | * |
17 | * Changelog: | 17 | * Changelog: |
18 | * 01-31-2000 DMW Created | 18 | * See git changelog. |
19 | * 09-18-2000 SJH Moved structure out of the Disk-On-Chip drivers | ||
20 | * so it can be used by other NAND flash device | ||
21 | * drivers. I also changed the copyright since none | ||
22 | * of the original contents of this file are specific | ||
23 | * to DoC devices. David can whack me with a baseball | ||
24 | * bat later if I did something naughty. | ||
25 | * 10-11-2000 SJH Added private NAND flash structure for driver | ||
26 | * 10-24-2000 SJH Added prototype for 'nand_scan' function | ||
27 | * 10-29-2001 TG changed nand_chip structure to support | ||
28 | * hardwarespecific function for accessing control lines | ||
29 | * 02-21-2002 TG added support for different read/write adress and | ||
30 | * ready/busy line access function | ||
31 | * 02-26-2002 TG added chip_delay to nand_chip structure to optimize | ||
32 | * command delay times for different chips | ||
33 | * 04-28-2002 TG OOB config defines moved from nand.c to avoid duplicate | ||
34 | * defines in jffs2/wbuf.c | ||
35 | * 08-07-2002 TG forced bad block location to byte 5 of OOB, even if | ||
36 | * CONFIG_MTD_NAND_ECC_JFFS2 is not set | ||
37 | * 08-10-2002 TG extensions to nand_chip structure to support HW-ECC | ||
38 | * | ||
39 | * 08-29-2002 tglx nand_chip structure: data_poi for selecting | ||
40 | * internal / fs-driver buffer | ||
41 | * support for 6byte/512byte hardware ECC | ||
42 | * read_ecc, write_ecc extended for different oob-layout | ||
43 | * oob layout selections: NAND_NONE_OOB, NAND_JFFS2_OOB, | ||
44 | * NAND_YAFFS_OOB | ||
45 | * 11-25-2002 tglx Added Manufacturer code FUJITSU, NATIONAL | ||
46 | * Split manufacturer and device ID structures | ||
47 | * | ||
48 | * 02-08-2004 tglx added option field to nand structure for chip anomalities | ||
49 | * 05-25-2004 tglx added bad block table support, ST-MICRO manufacturer id | ||
50 | * update of nand_chip structure description | ||
51 | * 01-17-2005 dmarlin added extended commands for AG-AND device and added option | ||
52 | * for BBT_AUTO_REFRESH. | ||
53 | * 01-20-2005 dmarlin added optional pointer to hardware specific callback for | ||
54 | * extra error status checks. | ||
55 | */ | 19 | */ |
56 | #ifndef __LINUX_MTD_NAND_H | 20 | #ifndef __LINUX_MTD_NAND_H |
57 | #define __LINUX_MTD_NAND_H | 21 | #define __LINUX_MTD_NAND_H |
58 | 22 | ||
59 | #include <linux/config.h> | ||
60 | #include <linux/wait.h> | 23 | #include <linux/wait.h> |
61 | #include <linux/spinlock.h> | 24 | #include <linux/spinlock.h> |
62 | #include <linux/mtd/mtd.h> | 25 | #include <linux/mtd/mtd.h> |
@@ -67,10 +30,6 @@ extern int nand_scan (struct mtd_info *mtd, int max_chips); | |||
67 | /* Free resources held by the NAND device */ | 30 | /* Free resources held by the NAND device */ |
68 | extern void nand_release (struct mtd_info *mtd); | 31 | extern void nand_release (struct mtd_info *mtd); |
69 | 32 | ||
70 | /* Read raw data from the device without ECC */ | ||
71 | extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_t len, size_t ooblen); | ||
72 | |||
73 | |||
74 | /* The maximum number of NAND chips in an array */ | 33 | /* The maximum number of NAND chips in an array */ |
75 | #define NAND_MAX_CHIPS 8 | 34 | #define NAND_MAX_CHIPS 8 |
76 | 35 | ||
@@ -79,44 +38,45 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_ | |||
79 | * adjust this accordingly. | 38 | * adjust this accordingly. |
80 | */ | 39 | */ |
81 | #define NAND_MAX_OOBSIZE 64 | 40 | #define NAND_MAX_OOBSIZE 64 |
41 | #define NAND_MAX_PAGESIZE 2048 | ||
82 | 42 | ||
83 | /* | 43 | /* |
84 | * Constants for hardware specific CLE/ALE/NCE function | 44 | * Constants for hardware specific CLE/ALE/NCE function |
85 | */ | 45 | * |
46 | * These are bits which can be or'ed to set/clear multiple | ||
47 | * bits in one go. | ||
48 | */ | ||
86 | /* Select the chip by setting nCE to low */ | 49 | /* Select the chip by setting nCE to low */ |
87 | #define NAND_CTL_SETNCE 1 | 50 | #define NAND_NCE 0x01 |
88 | /* Deselect the chip by setting nCE to high */ | ||
89 | #define NAND_CTL_CLRNCE 2 | ||
90 | /* Select the command latch by setting CLE to high */ | 51 | /* Select the command latch by setting CLE to high */ |
91 | #define NAND_CTL_SETCLE 3 | 52 | #define NAND_CLE 0x02 |
92 | /* Deselect the command latch by setting CLE to low */ | ||
93 | #define NAND_CTL_CLRCLE 4 | ||
94 | /* Select the address latch by setting ALE to high */ | 53 | /* Select the address latch by setting ALE to high */ |
95 | #define NAND_CTL_SETALE 5 | 54 | #define NAND_ALE 0x04 |
96 | /* Deselect the address latch by setting ALE to low */ | 55 | |
97 | #define NAND_CTL_CLRALE 6 | 56 | #define NAND_CTRL_CLE (NAND_NCE | NAND_CLE) |
98 | /* Set write protection by setting WP to high. Not used! */ | 57 | #define NAND_CTRL_ALE (NAND_NCE | NAND_ALE) |
99 | #define NAND_CTL_SETWP 7 | 58 | #define NAND_CTRL_CHANGE 0x80 |
100 | /* Clear write protection by setting WP to low. Not used! */ | ||
101 | #define NAND_CTL_CLRWP 8 | ||
102 | 59 | ||
103 | /* | 60 | /* |
104 | * Standard NAND flash commands | 61 | * Standard NAND flash commands |
105 | */ | 62 | */ |
106 | #define NAND_CMD_READ0 0 | 63 | #define NAND_CMD_READ0 0 |
107 | #define NAND_CMD_READ1 1 | 64 | #define NAND_CMD_READ1 1 |
65 | #define NAND_CMD_RNDOUT 5 | ||
108 | #define NAND_CMD_PAGEPROG 0x10 | 66 | #define NAND_CMD_PAGEPROG 0x10 |
109 | #define NAND_CMD_READOOB 0x50 | 67 | #define NAND_CMD_READOOB 0x50 |
110 | #define NAND_CMD_ERASE1 0x60 | 68 | #define NAND_CMD_ERASE1 0x60 |
111 | #define NAND_CMD_STATUS 0x70 | 69 | #define NAND_CMD_STATUS 0x70 |
112 | #define NAND_CMD_STATUS_MULTI 0x71 | 70 | #define NAND_CMD_STATUS_MULTI 0x71 |
113 | #define NAND_CMD_SEQIN 0x80 | 71 | #define NAND_CMD_SEQIN 0x80 |
72 | #define NAND_CMD_RNDIN 0x85 | ||
114 | #define NAND_CMD_READID 0x90 | 73 | #define NAND_CMD_READID 0x90 |
115 | #define NAND_CMD_ERASE2 0xd0 | 74 | #define NAND_CMD_ERASE2 0xd0 |
116 | #define NAND_CMD_RESET 0xff | 75 | #define NAND_CMD_RESET 0xff |
117 | 76 | ||
118 | /* Extended commands for large page devices */ | 77 | /* Extended commands for large page devices */ |
119 | #define NAND_CMD_READSTART 0x30 | 78 | #define NAND_CMD_READSTART 0x30 |
79 | #define NAND_CMD_RNDOUTSTART 0xE0 | ||
120 | #define NAND_CMD_CACHEDPROG 0x15 | 80 | #define NAND_CMD_CACHEDPROG 0x15 |
121 | 81 | ||
122 | /* Extended commands for AG-AND device */ | 82 | /* Extended commands for AG-AND device */ |
@@ -138,6 +98,8 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_ | |||
138 | #define NAND_CMD_STATUS_RESET 0x7f | 98 | #define NAND_CMD_STATUS_RESET 0x7f |
139 | #define NAND_CMD_STATUS_CLEAR 0xff | 99 | #define NAND_CMD_STATUS_CLEAR 0xff |
140 | 100 | ||
101 | #define NAND_CMD_NONE -1 | ||
102 | |||
141 | /* Status bits */ | 103 | /* Status bits */ |
142 | #define NAND_STATUS_FAIL 0x01 | 104 | #define NAND_STATUS_FAIL 0x01 |
143 | #define NAND_STATUS_FAIL_N1 0x02 | 105 | #define NAND_STATUS_FAIL_N1 0x02 |
@@ -148,21 +110,12 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_ | |||
148 | /* | 110 | /* |
149 | * Constants for ECC_MODES | 111 | * Constants for ECC_MODES |
150 | */ | 112 | */ |
151 | 113 | typedef enum { | |
152 | /* No ECC. Usage is not recommended ! */ | 114 | NAND_ECC_NONE, |
153 | #define NAND_ECC_NONE 0 | 115 | NAND_ECC_SOFT, |
154 | /* Software ECC 3 byte ECC per 256 Byte data */ | 116 | NAND_ECC_HW, |
155 | #define NAND_ECC_SOFT 1 | 117 | NAND_ECC_HW_SYNDROME, |
156 | /* Hardware ECC 3 byte ECC per 256 Byte data */ | 118 | } nand_ecc_modes_t; |
157 | #define NAND_ECC_HW3_256 2 | ||
158 | /* Hardware ECC 3 byte ECC per 512 Byte data */ | ||
159 | #define NAND_ECC_HW3_512 3 | ||
160 | /* Hardware ECC 3 byte ECC per 512 Byte data */ | ||
161 | #define NAND_ECC_HW6_512 4 | ||
162 | /* Hardware ECC 8 byte ECC per 512 Byte data */ | ||
163 | #define NAND_ECC_HW8_512 6 | ||
164 | /* Hardware ECC 12 byte ECC per 2048 Byte data */ | ||
165 | #define NAND_ECC_HW12_2048 7 | ||
166 | 119 | ||
167 | /* | 120 | /* |
168 | * Constants for Hardware ECC | 121 | * Constants for Hardware ECC |
@@ -201,6 +154,10 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_ | |||
201 | * bits from adjacent blocks from 'leaking' in altering data. | 154 | * bits from adjacent blocks from 'leaking' in altering data. |
202 | * This happens with the Renesas AG-AND chips, possibly others. */ | 155 | * This happens with the Renesas AG-AND chips, possibly others. */ |
203 | #define BBT_AUTO_REFRESH 0x00000080 | 156 | #define BBT_AUTO_REFRESH 0x00000080 |
157 | /* Chip does not require ready check on read. True | ||
158 | * for all large page devices, as they do not support | ||
159 | * autoincrement.*/ | ||
160 | #define NAND_NO_READRDY 0x00000100 | ||
204 | 161 | ||
205 | /* Options valid for Samsung large page devices */ | 162 | /* Options valid for Samsung large page devices */ |
206 | #define NAND_SAMSUNG_LP_OPTIONS \ | 163 | #define NAND_SAMSUNG_LP_OPTIONS \ |
@@ -219,18 +176,12 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_ | |||
219 | /* Use a flash based bad block table. This option is passed to the | 176 | /* Use a flash based bad block table. This option is passed to the |
220 | * default bad block table function. */ | 177 | * default bad block table function. */ |
221 | #define NAND_USE_FLASH_BBT 0x00010000 | 178 | #define NAND_USE_FLASH_BBT 0x00010000 |
222 | /* The hw ecc generator provides a syndrome instead a ecc value on read | ||
223 | * This can only work if we have the ecc bytes directly behind the | ||
224 | * data bytes. Applies for DOC and AG-AND Renesas HW Reed Solomon generators */ | ||
225 | #define NAND_HWECC_SYNDROME 0x00020000 | ||
226 | /* This option skips the bbt scan during initialization. */ | 179 | /* This option skips the bbt scan during initialization. */ |
227 | #define NAND_SKIP_BBTSCAN 0x00040000 | 180 | #define NAND_SKIP_BBTSCAN 0x00020000 |
228 | 181 | ||
229 | /* Options set by nand scan */ | 182 | /* Options set by nand scan */ |
230 | /* Nand scan has allocated oob_buf */ | 183 | /* Nand scan has allocated controller struct */ |
231 | #define NAND_OOBBUF_ALLOC 0x40000000 | 184 | #define NAND_CONTROLLER_ALLOC 0x80000000 |
232 | /* Nand scan has allocated data_buf */ | ||
233 | #define NAND_DATABUF_ALLOC 0x80000000 | ||
234 | 185 | ||
235 | 186 | ||
236 | /* | 187 | /* |
@@ -264,45 +215,102 @@ struct nand_hw_control { | |||
264 | }; | 215 | }; |
265 | 216 | ||
266 | /** | 217 | /** |
218 | * struct nand_ecc_ctrl - Control structure for ecc | ||
219 | * @mode: ecc mode | ||
220 | * @steps: number of ecc steps per page | ||
221 | * @size: data bytes per ecc step | ||
222 | * @bytes: ecc bytes per step | ||
223 | * @total: total number of ecc bytes per page | ||
224 | * @prepad: padding information for syndrome based ecc generators | ||
225 | * @postpad: padding information for syndrome based ecc generators | ||
226 | * @hwctl: function to control hardware ecc generator. Must only | ||
227 | * be provided if an hardware ECC is available | ||
228 | * @calculate: function for ecc calculation or readback from ecc hardware | ||
229 | * @correct: function for ecc correction, matching to ecc generator (sw/hw) | ||
230 | * @read_page: function to read a page according to the ecc generator requirements | ||
231 | * @write_page: function to write a page according to the ecc generator requirements | ||
232 | */ | ||
233 | struct nand_ecc_ctrl { | ||
234 | nand_ecc_modes_t mode; | ||
235 | int steps; | ||
236 | int size; | ||
237 | int bytes; | ||
238 | int total; | ||
239 | int prepad; | ||
240 | int postpad; | ||
241 | struct nand_ecclayout *layout; | ||
242 | void (*hwctl)(struct mtd_info *mtd, int mode); | ||
243 | int (*calculate)(struct mtd_info *mtd, | ||
244 | const uint8_t *dat, | ||
245 | uint8_t *ecc_code); | ||
246 | int (*correct)(struct mtd_info *mtd, uint8_t *dat, | ||
247 | uint8_t *read_ecc, | ||
248 | uint8_t *calc_ecc); | ||
249 | int (*read_page)(struct mtd_info *mtd, | ||
250 | struct nand_chip *chip, | ||
251 | uint8_t *buf); | ||
252 | void (*write_page)(struct mtd_info *mtd, | ||
253 | struct nand_chip *chip, | ||
254 | const uint8_t *buf); | ||
255 | int (*read_oob)(struct mtd_info *mtd, | ||
256 | struct nand_chip *chip, | ||
257 | int page, | ||
258 | int sndcmd); | ||
259 | int (*write_oob)(struct mtd_info *mtd, | ||
260 | struct nand_chip *chip, | ||
261 | int page); | ||
262 | }; | ||
263 | |||
264 | /** | ||
265 | * struct nand_buffers - buffer structure for read/write | ||
266 | * @ecccalc: buffer for calculated ecc | ||
267 | * @ecccode: buffer for ecc read from flash | ||
268 | * @oobwbuf: buffer for write oob data | ||
269 | * @databuf: buffer for data - dynamically sized | ||
270 | * @oobrbuf: buffer to read oob data | ||
271 | * | ||
272 | * Do not change the order of buffers. databuf and oobrbuf must be in | ||
273 | * consecutive order. | ||
274 | */ | ||
275 | struct nand_buffers { | ||
276 | uint8_t ecccalc[NAND_MAX_OOBSIZE]; | ||
277 | uint8_t ecccode[NAND_MAX_OOBSIZE]; | ||
278 | uint8_t oobwbuf[NAND_MAX_OOBSIZE]; | ||
279 | uint8_t databuf[NAND_MAX_PAGESIZE]; | ||
280 | uint8_t oobrbuf[NAND_MAX_OOBSIZE]; | ||
281 | }; | ||
282 | |||
283 | /** | ||
267 | * struct nand_chip - NAND Private Flash Chip Data | 284 | * struct nand_chip - NAND Private Flash Chip Data |
268 | * @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the flash device | 285 | * @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the flash device |
269 | * @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the flash device | 286 | * @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the flash device |
270 | * @read_byte: [REPLACEABLE] read one byte from the chip | 287 | * @read_byte: [REPLACEABLE] read one byte from the chip |
271 | * @write_byte: [REPLACEABLE] write one byte to the chip | ||
272 | * @read_word: [REPLACEABLE] read one word from the chip | 288 | * @read_word: [REPLACEABLE] read one word from the chip |
273 | * @write_word: [REPLACEABLE] write one word to the chip | ||
274 | * @write_buf: [REPLACEABLE] write data from the buffer to the chip | 289 | * @write_buf: [REPLACEABLE] write data from the buffer to the chip |
275 | * @read_buf: [REPLACEABLE] read data from the chip into the buffer | 290 | * @read_buf: [REPLACEABLE] read data from the chip into the buffer |
276 | * @verify_buf: [REPLACEABLE] verify buffer contents against the chip data | 291 | * @verify_buf: [REPLACEABLE] verify buffer contents against the chip data |
277 | * @select_chip: [REPLACEABLE] select chip nr | 292 | * @select_chip: [REPLACEABLE] select chip nr |
278 | * @block_bad: [REPLACEABLE] check, if the block is bad | 293 | * @block_bad: [REPLACEABLE] check, if the block is bad |
279 | * @block_markbad: [REPLACEABLE] mark the block bad | 294 | * @block_markbad: [REPLACEABLE] mark the block bad |
280 | * @hwcontrol: [BOARDSPECIFIC] hardwarespecific function for accesing control-lines | 295 | * @cmd_ctrl: [BOARDSPECIFIC] hardwarespecific funtion for controlling |
296 | * ALE/CLE/nCE. Also used to write command and address | ||
281 | * @dev_ready: [BOARDSPECIFIC] hardwarespecific function for accesing device ready/busy line | 297 | * @dev_ready: [BOARDSPECIFIC] hardwarespecific function for accesing device ready/busy line |
282 | * If set to NULL no access to ready/busy is available and the ready/busy information | 298 | * If set to NULL no access to ready/busy is available and the ready/busy information |
283 | * is read from the chip status register | 299 | * is read from the chip status register |
284 | * @cmdfunc: [REPLACEABLE] hardwarespecific function for writing commands to the chip | 300 | * @cmdfunc: [REPLACEABLE] hardwarespecific function for writing commands to the chip |
285 | * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on ready | 301 | * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on ready |
286 | * @calculate_ecc: [REPLACEABLE] function for ecc calculation or readback from ecc hardware | 302 | * @ecc: [BOARDSPECIFIC] ecc control ctructure |
287 | * @correct_data: [REPLACEABLE] function for ecc correction, matching to ecc generator (sw/hw) | ||
288 | * @enable_hwecc: [BOARDSPECIFIC] function to enable (reset) hardware ecc generator. Must only | ||
289 | * be provided if a hardware ECC is available | ||
290 | * @erase_cmd: [INTERN] erase command write function, selectable due to AND support | 303 | * @erase_cmd: [INTERN] erase command write function, selectable due to AND support |
291 | * @scan_bbt: [REPLACEABLE] function to scan bad block table | 304 | * @scan_bbt: [REPLACEABLE] function to scan bad block table |
292 | * @eccmode: [BOARDSPECIFIC] mode of ecc, see defines | ||
293 | * @eccsize: [INTERN] databytes used per ecc-calculation | ||
294 | * @eccbytes: [INTERN] number of ecc bytes per ecc-calculation step | ||
295 | * @eccsteps: [INTERN] number of ecc calculation steps per page | ||
296 | * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transfering data from array to read regs (tR) | 305 | * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transfering data from array to read regs (tR) |
297 | * @chip_lock: [INTERN] spinlock used to protect access to this structure and the chip | ||
298 | * @wq: [INTERN] wait queue to sleep on if a NAND operation is in progress | 306 | * @wq: [INTERN] wait queue to sleep on if a NAND operation is in progress |
299 | * @state: [INTERN] the current state of the NAND device | 307 | * @state: [INTERN] the current state of the NAND device |
300 | * @page_shift: [INTERN] number of address bits in a page (column address bits) | 308 | * @page_shift: [INTERN] number of address bits in a page (column address bits) |
301 | * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock | 309 | * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock |
302 | * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry | 310 | * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry |
303 | * @chip_shift: [INTERN] number of address bits in one chip | 311 | * @chip_shift: [INTERN] number of address bits in one chip |
304 | * @data_buf: [INTERN] internal buffer for one page + oob | 312 | * @datbuf: [INTERN] internal buffer for one page + oob |
305 | * @oob_buf: [INTERN] oob buffer for one eraseblock | 313 | * @oobbuf: [INTERN] oob buffer for one eraseblock |
306 | * @oobdirty: [INTERN] indicates that oob_buf must be reinitialized | 314 | * @oobdirty: [INTERN] indicates that oob_buf must be reinitialized |
307 | * @data_poi: [INTERN] pointer to a data buffer | 315 | * @data_poi: [INTERN] pointer to a data buffer |
308 | * @options: [BOARDSPECIFIC] various chip options. They can partly be set to inform nand_scan about | 316 | * @options: [BOARDSPECIFIC] various chip options. They can partly be set to inform nand_scan about |
@@ -312,12 +320,13 @@ struct nand_hw_control { | |||
312 | * @chipsize: [INTERN] the size of one chip for multichip arrays | 320 | * @chipsize: [INTERN] the size of one chip for multichip arrays |
313 | * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1 | 321 | * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1 |
314 | * @pagebuf: [INTERN] holds the pagenumber which is currently in data_buf | 322 | * @pagebuf: [INTERN] holds the pagenumber which is currently in data_buf |
315 | * @autooob: [REPLACEABLE] the default (auto)placement scheme | 323 | * @ecclayout: [REPLACEABLE] the default ecc placement scheme |
316 | * @bbt: [INTERN] bad block table pointer | 324 | * @bbt: [INTERN] bad block table pointer |
317 | * @bbt_td: [REPLACEABLE] bad block table descriptor for flash lookup | 325 | * @bbt_td: [REPLACEABLE] bad block table descriptor for flash lookup |
318 | * @bbt_md: [REPLACEABLE] bad block table mirror descriptor | 326 | * @bbt_md: [REPLACEABLE] bad block table mirror descriptor |
319 | * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial bad block scan | 327 | * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial bad block scan |
320 | * @controller: [OPTIONAL] a pointer to a hardware controller structure which is shared among multiple independend devices | 328 | * @controller: [REPLACEABLE] a pointer to a hardware controller structure |
329 | * which is shared among multiple independend devices | ||
321 | * @priv: [OPTIONAL] pointer to private chip date | 330 | * @priv: [OPTIONAL] pointer to private chip date |
322 | * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks | 331 | * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks |
323 | * (determine if errors are correctable) | 332 | * (determine if errors are correctable) |
@@ -325,58 +334,57 @@ struct nand_hw_control { | |||
325 | 334 | ||
326 | struct nand_chip { | 335 | struct nand_chip { |
327 | void __iomem *IO_ADDR_R; | 336 | void __iomem *IO_ADDR_R; |
328 | void __iomem *IO_ADDR_W; | 337 | void __iomem *IO_ADDR_W; |
329 | 338 | ||
330 | u_char (*read_byte)(struct mtd_info *mtd); | 339 | uint8_t (*read_byte)(struct mtd_info *mtd); |
331 | void (*write_byte)(struct mtd_info *mtd, u_char byte); | ||
332 | u16 (*read_word)(struct mtd_info *mtd); | 340 | u16 (*read_word)(struct mtd_info *mtd); |
333 | void (*write_word)(struct mtd_info *mtd, u16 word); | 341 | void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len); |
334 | 342 | void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len); | |
335 | void (*write_buf)(struct mtd_info *mtd, const u_char *buf, int len); | 343 | int (*verify_buf)(struct mtd_info *mtd, const uint8_t *buf, int len); |
336 | void (*read_buf)(struct mtd_info *mtd, u_char *buf, int len); | ||
337 | int (*verify_buf)(struct mtd_info *mtd, const u_char *buf, int len); | ||
338 | void (*select_chip)(struct mtd_info *mtd, int chip); | 344 | void (*select_chip)(struct mtd_info *mtd, int chip); |
339 | int (*block_bad)(struct mtd_info *mtd, loff_t ofs, int getchip); | 345 | int (*block_bad)(struct mtd_info *mtd, loff_t ofs, int getchip); |
340 | int (*block_markbad)(struct mtd_info *mtd, loff_t ofs); | 346 | int (*block_markbad)(struct mtd_info *mtd, loff_t ofs); |
341 | void (*hwcontrol)(struct mtd_info *mtd, int cmd); | 347 | void (*cmd_ctrl)(struct mtd_info *mtd, int dat, |
342 | int (*dev_ready)(struct mtd_info *mtd); | 348 | unsigned int ctrl); |
343 | void (*cmdfunc)(struct mtd_info *mtd, unsigned command, int column, int page_addr); | 349 | int (*dev_ready)(struct mtd_info *mtd); |
344 | int (*waitfunc)(struct mtd_info *mtd, struct nand_chip *this, int state); | 350 | void (*cmdfunc)(struct mtd_info *mtd, unsigned command, int column, int page_addr); |
345 | int (*calculate_ecc)(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code); | 351 | int (*waitfunc)(struct mtd_info *mtd, struct nand_chip *this); |
346 | int (*correct_data)(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, u_char *calc_ecc); | ||
347 | void (*enable_hwecc)(struct mtd_info *mtd, int mode); | ||
348 | void (*erase_cmd)(struct mtd_info *mtd, int page); | 352 | void (*erase_cmd)(struct mtd_info *mtd, int page); |
349 | int (*scan_bbt)(struct mtd_info *mtd); | 353 | int (*scan_bbt)(struct mtd_info *mtd); |
350 | int eccmode; | 354 | int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, int status, int page); |
351 | int eccsize; | 355 | |
352 | int eccbytes; | 356 | int chip_delay; |
353 | int eccsteps; | 357 | unsigned int options; |
354 | int chip_delay; | 358 | |
355 | spinlock_t chip_lock; | 359 | int page_shift; |
356 | wait_queue_head_t wq; | ||
357 | nand_state_t state; | ||
358 | int page_shift; | ||
359 | int phys_erase_shift; | 360 | int phys_erase_shift; |
360 | int bbt_erase_shift; | 361 | int bbt_erase_shift; |
361 | int chip_shift; | 362 | int chip_shift; |
362 | u_char *data_buf; | ||
363 | u_char *oob_buf; | ||
364 | int oobdirty; | ||
365 | u_char *data_poi; | ||
366 | unsigned int options; | ||
367 | int badblockpos; | ||
368 | int numchips; | 363 | int numchips; |
369 | unsigned long chipsize; | 364 | unsigned long chipsize; |
370 | int pagemask; | 365 | int pagemask; |
371 | int pagebuf; | 366 | int pagebuf; |
372 | struct nand_oobinfo *autooob; | 367 | int badblockpos; |
368 | |||
369 | nand_state_t state; | ||
370 | |||
371 | uint8_t *oob_poi; | ||
372 | struct nand_hw_control *controller; | ||
373 | struct nand_ecclayout *ecclayout; | ||
374 | |||
375 | struct nand_ecc_ctrl ecc; | ||
376 | struct nand_buffers buffers; | ||
377 | struct nand_hw_control hwcontrol; | ||
378 | |||
379 | struct mtd_oob_ops ops; | ||
380 | |||
373 | uint8_t *bbt; | 381 | uint8_t *bbt; |
374 | struct nand_bbt_descr *bbt_td; | 382 | struct nand_bbt_descr *bbt_td; |
375 | struct nand_bbt_descr *bbt_md; | 383 | struct nand_bbt_descr *bbt_md; |
384 | |||
376 | struct nand_bbt_descr *badblock_pattern; | 385 | struct nand_bbt_descr *badblock_pattern; |
377 | struct nand_hw_control *controller; | 386 | |
378 | void *priv; | 387 | void *priv; |
379 | int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, int status, int page); | ||
380 | }; | 388 | }; |
381 | 389 | ||
382 | /* | 390 | /* |
@@ -388,19 +396,19 @@ struct nand_chip { | |||
388 | #define NAND_MFR_NATIONAL 0x8f | 396 | #define NAND_MFR_NATIONAL 0x8f |
389 | #define NAND_MFR_RENESAS 0x07 | 397 | #define NAND_MFR_RENESAS 0x07 |
390 | #define NAND_MFR_STMICRO 0x20 | 398 | #define NAND_MFR_STMICRO 0x20 |
391 | #define NAND_MFR_HYNIX 0xad | 399 | #define NAND_MFR_HYNIX 0xad |
392 | 400 | ||
393 | /** | 401 | /** |
394 | * struct nand_flash_dev - NAND Flash Device ID Structure | 402 | * struct nand_flash_dev - NAND Flash Device ID Structure |
395 | * | 403 | * |
396 | * @name: Identify the device type | 404 | * @name: Identify the device type |
397 | * @id: device ID code | 405 | * @id: device ID code |
398 | * @pagesize: Pagesize in bytes. Either 256 or 512 or 0 | 406 | * @pagesize: Pagesize in bytes. Either 256 or 512 or 0 |
399 | * If the pagesize is 0, then the real pagesize | 407 | * If the pagesize is 0, then the real pagesize |
400 | * and the eraseize are determined from the | 408 | * and the eraseize are determined from the |
401 | * extended id bytes in the chip | 409 | * extended id bytes in the chip |
402 | * @erasesize: Size of an erase block in the flash device. | 410 | * @erasesize: Size of an erase block in the flash device. |
403 | * @chipsize: Total chipsize in Mega Bytes | 411 | * @chipsize: Total chipsize in Mega Bytes |
404 | * @options: Bitfield to store chip relevant options | 412 | * @options: Bitfield to store chip relevant options |
405 | */ | 413 | */ |
406 | struct nand_flash_dev { | 414 | struct nand_flash_dev { |
@@ -415,7 +423,7 @@ struct nand_flash_dev { | |||
415 | /** | 423 | /** |
416 | * struct nand_manufacturers - NAND Flash Manufacturer ID Structure | 424 | * struct nand_manufacturers - NAND Flash Manufacturer ID Structure |
417 | * @name: Manufacturer name | 425 | * @name: Manufacturer name |
418 | * @id: manufacturer ID code of device. | 426 | * @id: manufacturer ID code of device. |
419 | */ | 427 | */ |
420 | struct nand_manufacturers { | 428 | struct nand_manufacturers { |
421 | int id; | 429 | int id; |
@@ -455,7 +463,7 @@ struct nand_bbt_descr { | |||
455 | int veroffs; | 463 | int veroffs; |
456 | uint8_t version[NAND_MAX_CHIPS]; | 464 | uint8_t version[NAND_MAX_CHIPS]; |
457 | int len; | 465 | int len; |
458 | int maxblocks; | 466 | int maxblocks; |
459 | int reserved_block_code; | 467 | int reserved_block_code; |
460 | uint8_t *pattern; | 468 | uint8_t *pattern; |
461 | }; | 469 | }; |
@@ -494,14 +502,14 @@ struct nand_bbt_descr { | |||
494 | /* The maximum number of blocks to scan for a bbt */ | 502 | /* The maximum number of blocks to scan for a bbt */ |
495 | #define NAND_BBT_SCAN_MAXBLOCKS 4 | 503 | #define NAND_BBT_SCAN_MAXBLOCKS 4 |
496 | 504 | ||
497 | extern int nand_scan_bbt (struct mtd_info *mtd, struct nand_bbt_descr *bd); | 505 | extern int nand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd); |
498 | extern int nand_update_bbt (struct mtd_info *mtd, loff_t offs); | 506 | extern int nand_update_bbt(struct mtd_info *mtd, loff_t offs); |
499 | extern int nand_default_bbt (struct mtd_info *mtd); | 507 | extern int nand_default_bbt(struct mtd_info *mtd); |
500 | extern int nand_isbad_bbt (struct mtd_info *mtd, loff_t offs, int allowbbt); | 508 | extern int nand_isbad_bbt(struct mtd_info *mtd, loff_t offs, int allowbbt); |
501 | extern int nand_erase_nand (struct mtd_info *mtd, struct erase_info *instr, int allowbbt); | 509 | extern int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr, |
502 | extern int nand_do_read_ecc (struct mtd_info *mtd, loff_t from, size_t len, | 510 | int allowbbt); |
503 | size_t * retlen, u_char * buf, u_char * oob_buf, | 511 | extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len, |
504 | struct nand_oobinfo *oobsel, int flags); | 512 | size_t * retlen, uint8_t * buf); |
505 | 513 | ||
506 | /* | 514 | /* |
507 | * Constants for oob configuration | 515 | * Constants for oob configuration |
@@ -509,4 +517,53 @@ extern int nand_do_read_ecc (struct mtd_info *mtd, loff_t from, size_t len, | |||
509 | #define NAND_SMALL_BADBLOCK_POS 5 | 517 | #define NAND_SMALL_BADBLOCK_POS 5 |
510 | #define NAND_LARGE_BADBLOCK_POS 0 | 518 | #define NAND_LARGE_BADBLOCK_POS 0 |
511 | 519 | ||
520 | /** | ||
521 | * struct platform_nand_chip - chip level device structure | ||
522 | * | ||
523 | * @nr_chips: max. number of chips to scan for | ||
524 | * @chip_offs: chip number offset | ||
525 | * @nr_partitions: number of partitions pointed to by partitions (or zero) | ||
526 | * @partitions: mtd partition list | ||
527 | * @chip_delay: R/B delay value in us | ||
528 | * @options: Option flags, e.g. 16bit buswidth | ||
529 | * @ecclayout: ecc layout info structure | ||
530 | * @priv: hardware controller specific settings | ||
531 | */ | ||
532 | struct platform_nand_chip { | ||
533 | int nr_chips; | ||
534 | int chip_offset; | ||
535 | int nr_partitions; | ||
536 | struct mtd_partition *partitions; | ||
537 | struct nand_ecclayout *ecclayout; | ||
538 | int chip_delay; | ||
539 | unsigned int options; | ||
540 | void *priv; | ||
541 | }; | ||
542 | |||
543 | /** | ||
544 | * struct platform_nand_ctrl - controller level device structure | ||
545 | * | ||
546 | * @hwcontrol: platform specific hardware control structure | ||
547 | * @dev_ready: platform specific function to read ready/busy pin | ||
548 | * @select_chip: platform specific chip select function | ||
549 | * @priv_data: private data to transport driver specific settings | ||
550 | * | ||
551 | * All fields are optional and depend on the hardware driver requirements | ||
552 | */ | ||
553 | struct platform_nand_ctrl { | ||
554 | void (*hwcontrol)(struct mtd_info *mtd, int cmd); | ||
555 | int (*dev_ready)(struct mtd_info *mtd); | ||
556 | void (*select_chip)(struct mtd_info *mtd, int chip); | ||
557 | void *priv; | ||
558 | }; | ||
559 | |||
560 | /* Some helpers to access the data structures */ | ||
561 | static inline | ||
562 | struct platform_nand_chip *get_platform_nandchip(struct mtd_info *mtd) | ||
563 | { | ||
564 | struct nand_chip *chip = mtd->priv; | ||
565 | |||
566 | return chip->priv; | ||
567 | } | ||
568 | |||
512 | #endif /* __LINUX_MTD_NAND_H */ | 569 | #endif /* __LINUX_MTD_NAND_H */ |
diff --git a/include/linux/mtd/ndfc.h b/include/linux/mtd/ndfc.h new file mode 100644 index 000000000000..d0558a982628 --- /dev/null +++ b/include/linux/mtd/ndfc.h | |||
@@ -0,0 +1,67 @@ | |||
1 | /* | ||
2 | * linux/include/linux/mtd/ndfc.h | ||
3 | * | ||
4 | * Copyright (c) 2006 Thomas Gleixner <tglx@linutronix.de> | ||
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 | * Info: | ||
11 | * Contains defines, datastructures for ndfc nand controller | ||
12 | * | ||
13 | */ | ||
14 | #ifndef __LINUX_MTD_NDFC_H | ||
15 | #define __LINUX_MTD_NDFC_H | ||
16 | |||
17 | /* NDFC Register definitions */ | ||
18 | #define NDFC_CMD 0x00 | ||
19 | #define NDFC_ALE 0x04 | ||
20 | #define NDFC_DATA 0x08 | ||
21 | #define NDFC_ECC 0x10 | ||
22 | #define NDFC_BCFG0 0x30 | ||
23 | #define NDFC_BCFG1 0x34 | ||
24 | #define NDFC_BCFG2 0x38 | ||
25 | #define NDFC_BCFG3 0x3c | ||
26 | #define NDFC_CCR 0x40 | ||
27 | #define NDFC_STAT 0x44 | ||
28 | #define NDFC_HWCTL 0x48 | ||
29 | #define NDFC_REVID 0x50 | ||
30 | |||
31 | #define NDFC_STAT_IS_READY 0x01000000 | ||
32 | |||
33 | #define NDFC_CCR_RESET_CE 0x80000000 /* CE Reset */ | ||
34 | #define NDFC_CCR_RESET_ECC 0x40000000 /* ECC Reset */ | ||
35 | #define NDFC_CCR_RIE 0x20000000 /* Interrupt Enable on Device Rdy */ | ||
36 | #define NDFC_CCR_REN 0x10000000 /* Enable wait for Rdy in LinearR */ | ||
37 | #define NDFC_CCR_ROMEN 0x08000000 /* Enable ROM In LinearR */ | ||
38 | #define NDFC_CCR_ARE 0x04000000 /* Auto-Read Enable */ | ||
39 | #define NDFC_CCR_BS(x) (((x) & 0x3) << 24) /* Select Bank on CE[x] */ | ||
40 | #define NDFC_CCR_BS_MASK 0x03000000 /* Select Bank */ | ||
41 | #define NDFC_CCR_ARAC0 0x00000000 /* 3 Addr, 1 Col 2 Row 512b page */ | ||
42 | #define NDFC_CCR_ARAC1 0x00001000 /* 4 Addr, 1 Col 3 Row 512b page */ | ||
43 | #define NDFC_CCR_ARAC2 0x00002000 /* 4 Addr, 2 Col 2 Row 2K page */ | ||
44 | #define NDFC_CCR_ARAC3 0x00003000 /* 5 Addr, 2 Col 3 Row 2K page */ | ||
45 | #define NDFC_CCR_ARAC_MASK 0x00003000 /* Auto-Read mode Addr Cycles */ | ||
46 | #define NDFC_CCR_RPG 0x0000C000 /* Auto-Read Page */ | ||
47 | #define NDFC_CCR_EBCC 0x00000004 /* EBC Configuration Completed */ | ||
48 | #define NDFC_CCR_DHC 0x00000002 /* Direct Hardware Control Enable */ | ||
49 | |||
50 | #define NDFC_BxCFG_EN 0x80000000 /* Bank Enable */ | ||
51 | #define NDFC_BxCFG_CED 0x40000000 /* nCE Style */ | ||
52 | #define NDFC_BxCFG_SZ_MASK 0x08000000 /* Bank Size */ | ||
53 | #define NDFC_BxCFG_SZ_8BIT 0x00000000 /* 8bit */ | ||
54 | #define NDFC_BxCFG_SZ_16BIT 0x08000000 /* 16bit */ | ||
55 | |||
56 | #define NDFC_MAX_BANKS 4 | ||
57 | |||
58 | struct ndfc_controller_settings { | ||
59 | uint32_t ccr_settings; | ||
60 | uint64_t ndfc_erpn; | ||
61 | }; | ||
62 | |||
63 | struct ndfc_chip_settings { | ||
64 | uint32_t bank_settings; | ||
65 | }; | ||
66 | |||
67 | #endif | ||
diff --git a/include/linux/mtd/nftl.h b/include/linux/mtd/nftl.h index d35d2c21ff3e..bcf2fb3fa4a7 100644 --- a/include/linux/mtd/nftl.h +++ b/include/linux/mtd/nftl.h | |||
@@ -37,7 +37,7 @@ struct NFTLrecord { | |||
37 | unsigned int nb_blocks; /* number of physical blocks */ | 37 | unsigned int nb_blocks; /* number of physical blocks */ |
38 | unsigned int nb_boot_blocks; /* number of blocks used by the bios */ | 38 | unsigned int nb_boot_blocks; /* number of blocks used by the bios */ |
39 | struct erase_info instr; | 39 | struct erase_info instr; |
40 | struct nand_oobinfo oobinfo; | 40 | struct nand_ecclayout oobinfo; |
41 | }; | 41 | }; |
42 | 42 | ||
43 | int NFTL_mount(struct NFTLrecord *s); | 43 | int NFTL_mount(struct NFTLrecord *s); |
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h index 7419b5fab133..9ce9a48db444 100644 --- a/include/linux/mtd/onenand.h +++ b/include/linux/mtd/onenand.h | |||
@@ -35,6 +35,8 @@ typedef enum { | |||
35 | FL_SYNCING, | 35 | FL_SYNCING, |
36 | FL_UNLOCKING, | 36 | FL_UNLOCKING, |
37 | FL_LOCKING, | 37 | FL_LOCKING, |
38 | FL_RESETING, | ||
39 | FL_OTPING, | ||
38 | FL_PM_SUSPENDED, | 40 | FL_PM_SUSPENDED, |
39 | } onenand_state_t; | 41 | } onenand_state_t; |
40 | 42 | ||
@@ -75,7 +77,7 @@ struct onenand_bufferram { | |||
75 | * @param chip_lock [INTERN] spinlock used to protect access to this structure and the chip | 77 | * @param chip_lock [INTERN] spinlock used to protect access to this structure and the chip |
76 | * @param wq [INTERN] wait queue to sleep on if a OneNAND operation is in progress | 78 | * @param wq [INTERN] wait queue to sleep on if a OneNAND operation is in progress |
77 | * @param state [INTERN] the current state of the OneNAND device | 79 | * @param state [INTERN] the current state of the OneNAND device |
78 | * @param autooob [REPLACEABLE] the default (auto)placement scheme | 80 | * @param ecclayout [REPLACEABLE] the default ecc placement scheme |
79 | * @param bbm [REPLACEABLE] pointer to Bad Block Management | 81 | * @param bbm [REPLACEABLE] pointer to Bad Block Management |
80 | * @param priv [OPTIONAL] pointer to private chip date | 82 | * @param priv [OPTIONAL] pointer to private chip date |
81 | */ | 83 | */ |
@@ -111,9 +113,9 @@ struct onenand_chip { | |||
111 | onenand_state_t state; | 113 | onenand_state_t state; |
112 | unsigned char *page_buf; | 114 | unsigned char *page_buf; |
113 | 115 | ||
114 | struct nand_oobinfo *autooob; | 116 | struct nand_ecclayout *ecclayout; |
115 | 117 | ||
116 | void *bbm; | 118 | void *bbm; |
117 | 119 | ||
118 | void *priv; | 120 | void *priv; |
119 | }; | 121 | }; |
@@ -130,6 +132,9 @@ struct onenand_chip { | |||
130 | #define ONENAND_SET_SYS_CFG1(v, this) \ | 132 | #define ONENAND_SET_SYS_CFG1(v, this) \ |
131 | (this->write_word(v, this->base + ONENAND_REG_SYS_CFG1)) | 133 | (this->write_word(v, this->base + ONENAND_REG_SYS_CFG1)) |
132 | 134 | ||
135 | /* Check byte access in OneNAND */ | ||
136 | #define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1) | ||
137 | |||
133 | /* | 138 | /* |
134 | * Options bits | 139 | * Options bits |
135 | */ | 140 | */ |
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h index d7832ef8ed63..4a72818d2545 100644 --- a/include/linux/mtd/onenand_regs.h +++ b/include/linux/mtd/onenand_regs.h | |||
@@ -112,6 +112,7 @@ | |||
112 | #define ONENAND_CMD_LOCK_TIGHT (0x2C) | 112 | #define ONENAND_CMD_LOCK_TIGHT (0x2C) |
113 | #define ONENAND_CMD_ERASE (0x94) | 113 | #define ONENAND_CMD_ERASE (0x94) |
114 | #define ONENAND_CMD_RESET (0xF0) | 114 | #define ONENAND_CMD_RESET (0xF0) |
115 | #define ONENAND_CMD_OTP_ACCESS (0x65) | ||
115 | #define ONENAND_CMD_READID (0x90) | 116 | #define ONENAND_CMD_READID (0x90) |
116 | 117 | ||
117 | /* NOTE: Those are not *REAL* commands */ | 118 | /* NOTE: Those are not *REAL* commands */ |
@@ -152,6 +153,8 @@ | |||
152 | #define ONENAND_CTRL_ERASE (1 << 11) | 153 | #define ONENAND_CTRL_ERASE (1 << 11) |
153 | #define ONENAND_CTRL_ERROR (1 << 10) | 154 | #define ONENAND_CTRL_ERROR (1 << 10) |
154 | #define ONENAND_CTRL_RSTB (1 << 7) | 155 | #define ONENAND_CTRL_RSTB (1 << 7) |
156 | #define ONENAND_CTRL_OTP_L (1 << 6) | ||
157 | #define ONENAND_CTRL_OTP_BL (1 << 5) | ||
155 | 158 | ||
156 | /* | 159 | /* |
157 | * Interrupt Status Register F241h (R) | 160 | * Interrupt Status Register F241h (R) |
@@ -177,4 +180,9 @@ | |||
177 | #define ONENAND_ECC_2BIT (1 << 1) | 180 | #define ONENAND_ECC_2BIT (1 << 1) |
178 | #define ONENAND_ECC_2BIT_ALL (0xAAAA) | 181 | #define ONENAND_ECC_2BIT_ALL (0xAAAA) |
179 | 182 | ||
183 | /* | ||
184 | * One-Time Programmable (OTP) | ||
185 | */ | ||
186 | #define ONENAND_OTP_LOCK_OFFSET (14) | ||
187 | |||
180 | #endif /* __ONENAND_REG_H */ | 188 | #endif /* __ONENAND_REG_H */ |
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h index b03f512d51b9..da6b3d6f12a7 100644 --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h | |||
@@ -41,7 +41,7 @@ struct mtd_partition { | |||
41 | u_int32_t size; /* partition size */ | 41 | u_int32_t size; /* partition size */ |
42 | u_int32_t offset; /* offset within the master MTD space */ | 42 | u_int32_t offset; /* offset within the master MTD space */ |
43 | u_int32_t mask_flags; /* master MTD flags to mask out for this partition */ | 43 | u_int32_t mask_flags; /* master MTD flags to mask out for this partition */ |
44 | struct nand_oobinfo *oobsel; /* out of band layout for this partition (NAND only)*/ | 44 | struct nand_ecclayout *ecclayout; /* out of band layout for this partition (NAND only)*/ |
45 | struct mtd_info **mtdp; /* pointer to store the MTD object */ | 45 | struct mtd_info **mtdp; /* pointer to store the MTD object */ |
46 | }; | 46 | }; |
47 | 47 | ||
diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h index c7b8bcdef013..86831e3594f6 100644 --- a/include/linux/mtd/physmap.h +++ b/include/linux/mtd/physmap.h | |||
@@ -15,33 +15,26 @@ | |||
15 | */ | 15 | */ |
16 | 16 | ||
17 | #ifndef __LINUX_MTD_PHYSMAP__ | 17 | #ifndef __LINUX_MTD_PHYSMAP__ |
18 | 18 | #define __LINUX_MTD_PHYSMAP__ | |
19 | #include <linux/config.h> | ||
20 | |||
21 | #if defined(CONFIG_MTD_PHYSMAP) | ||
22 | 19 | ||
23 | #include <linux/mtd/mtd.h> | 20 | #include <linux/mtd/mtd.h> |
24 | #include <linux/mtd/map.h> | 21 | #include <linux/mtd/map.h> |
25 | #include <linux/mtd/partitions.h> | 22 | #include <linux/mtd/partitions.h> |
26 | 23 | ||
27 | /* | 24 | struct physmap_flash_data { |
28 | * The map_info for physmap. Board can override size, buswidth, phys, | 25 | unsigned int width; |
29 | * (*set_vpp)(), etc in their initial setup routine. | 26 | void (*set_vpp)(struct map_info *, int); |
30 | */ | 27 | unsigned int nr_parts; |
31 | extern struct map_info physmap_map; | 28 | struct mtd_partition *parts; |
29 | }; | ||
32 | 30 | ||
33 | /* | 31 | /* |
34 | * Board needs to specify the exact mapping during their setup time. | 32 | * Board needs to specify the exact mapping during their setup time. |
35 | */ | 33 | */ |
36 | static inline void physmap_configure(unsigned long addr, unsigned long size, int bankwidth, void (*set_vpp)(struct map_info *, int) ) | 34 | void physmap_configure(unsigned long addr, unsigned long size, |
37 | { | 35 | int bankwidth, void (*set_vpp)(struct map_info *, int) ); |
38 | physmap_map.phys = addr; | ||
39 | physmap_map.size = size; | ||
40 | physmap_map.bankwidth = bankwidth; | ||
41 | physmap_map.set_vpp = set_vpp; | ||
42 | } | ||
43 | 36 | ||
44 | #if defined(CONFIG_MTD_PARTITIONS) | 37 | #ifdef CONFIG_MTD_PARTITIONS |
45 | 38 | ||
46 | /* | 39 | /* |
47 | * Machines that wish to do flash partition may want to call this function in | 40 | * Machines that wish to do flash partition may want to call this function in |
@@ -55,7 +48,5 @@ static inline void physmap_configure(unsigned long addr, unsigned long size, int | |||
55 | void physmap_set_partitions(struct mtd_partition *parts, int num_parts); | 48 | void physmap_set_partitions(struct mtd_partition *parts, int num_parts); |
56 | 49 | ||
57 | #endif /* defined(CONFIG_MTD_PARTITIONS) */ | 50 | #endif /* defined(CONFIG_MTD_PARTITIONS) */ |
58 | #endif /* defined(CONFIG_MTD) */ | ||
59 | 51 | ||
60 | #endif /* __LINUX_MTD_PHYSMAP__ */ | 52 | #endif /* __LINUX_MTD_PHYSMAP__ */ |
61 | |||
diff --git a/include/linux/mtd/xip.h b/include/linux/mtd/xip.h index 220d50bb71cd..e9d40bdde48c 100644 --- a/include/linux/mtd/xip.h +++ b/include/linux/mtd/xip.h | |||
@@ -18,7 +18,6 @@ | |||
18 | #ifndef __LINUX_MTD_XIP_H__ | 18 | #ifndef __LINUX_MTD_XIP_H__ |
19 | #define __LINUX_MTD_XIP_H__ | 19 | #define __LINUX_MTD_XIP_H__ |
20 | 20 | ||
21 | #include <linux/config.h> | ||
22 | 21 | ||
23 | #ifdef CONFIG_MTD_XIP | 22 | #ifdef CONFIG_MTD_XIP |
24 | 23 | ||
diff --git a/include/linux/nbd.h b/include/linux/nbd.h index a6ce409ec6fc..e712e7d47cc2 100644 --- a/include/linux/nbd.h +++ b/include/linux/nbd.h | |||
@@ -77,11 +77,11 @@ struct nbd_device { | |||
77 | * server. All data are in network byte order. | 77 | * server. All data are in network byte order. |
78 | */ | 78 | */ |
79 | struct nbd_request { | 79 | struct nbd_request { |
80 | u32 magic; | 80 | __be32 magic; |
81 | u32 type; /* == READ || == WRITE */ | 81 | __be32 type; /* == READ || == WRITE */ |
82 | char handle[8]; | 82 | char handle[8]; |
83 | u64 from; | 83 | __be64 from; |
84 | u32 len; | 84 | __be32 len; |
85 | } | 85 | } |
86 | #ifdef __GNUC__ | 86 | #ifdef __GNUC__ |
87 | __attribute__ ((packed)) | 87 | __attribute__ ((packed)) |
@@ -93,8 +93,8 @@ struct nbd_request { | |||
93 | * it has completed an I/O request (or an error occurs). | 93 | * it has completed an I/O request (or an error occurs). |
94 | */ | 94 | */ |
95 | struct nbd_reply { | 95 | struct nbd_reply { |
96 | u32 magic; | 96 | __be32 magic; |
97 | u32 error; /* 0 = ok, else error */ | 97 | __be32 error; /* 0 = ok, else error */ |
98 | char handle[8]; /* handle you got from request */ | 98 | char handle[8]; /* handle you got from request */ |
99 | }; | 99 | }; |
100 | #endif | 100 | #endif |
diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h index 96dc237b8f03..b208f0cd556b 100644 --- a/include/linux/ncp_fs.h +++ b/include/linux/ncp_fs.h | |||
@@ -12,8 +12,6 @@ | |||
12 | #include <linux/in.h> | 12 | #include <linux/in.h> |
13 | #include <linux/types.h> | 13 | #include <linux/types.h> |
14 | 14 | ||
15 | #include <linux/ncp_fs_i.h> | ||
16 | #include <linux/ncp_fs_sb.h> | ||
17 | #include <linux/ipx.h> | 15 | #include <linux/ipx.h> |
18 | #include <linux/ncp_no.h> | 16 | #include <linux/ncp_no.h> |
19 | 17 | ||
@@ -146,7 +144,8 @@ struct ncp_nls_ioctl | |||
146 | 144 | ||
147 | #ifdef __KERNEL__ | 145 | #ifdef __KERNEL__ |
148 | 146 | ||
149 | #include <linux/config.h> | 147 | #include <linux/ncp_fs_i.h> |
148 | #include <linux/ncp_fs_sb.h> | ||
150 | 149 | ||
151 | /* undef because public define in umsdos_fs.h (ncp_fs.h isn't public) */ | 150 | /* undef because public define in umsdos_fs.h (ncp_fs.h isn't public) */ |
152 | #undef PRINTK | 151 | #undef PRINTK |
diff --git a/include/linux/net.h b/include/linux/net.h index 84a490e5f0a1..b20c53c74413 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -18,9 +18,7 @@ | |||
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/config.h> | ||
22 | #include <linux/wait.h> | 21 | #include <linux/wait.h> |
23 | #include <linux/stringify.h> | ||
24 | #include <asm/socket.h> | 22 | #include <asm/socket.h> |
25 | 23 | ||
26 | struct poll_table_struct; | 24 | struct poll_table_struct; |
@@ -57,11 +55,13 @@ typedef enum { | |||
57 | #define __SO_ACCEPTCON (1 << 16) /* performed a listen */ | 55 | #define __SO_ACCEPTCON (1 << 16) /* performed a listen */ |
58 | 56 | ||
59 | #ifdef __KERNEL__ | 57 | #ifdef __KERNEL__ |
58 | #include <linux/stringify.h> | ||
60 | 59 | ||
61 | #define SOCK_ASYNC_NOSPACE 0 | 60 | #define SOCK_ASYNC_NOSPACE 0 |
62 | #define SOCK_ASYNC_WAITDATA 1 | 61 | #define SOCK_ASYNC_WAITDATA 1 |
63 | #define SOCK_NOSPACE 2 | 62 | #define SOCK_NOSPACE 2 |
64 | #define SOCK_PASSCRED 3 | 63 | #define SOCK_PASSCRED 3 |
64 | #define SOCK_PASSSEC 4 | ||
65 | 65 | ||
66 | #ifndef ARCH_HAS_SOCKET_TYPES | 66 | #ifndef ARCH_HAS_SOCKET_TYPES |
67 | /** | 67 | /** |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index e432b743dda2..85f99f60deea 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -34,7 +34,6 @@ | |||
34 | #include <asm/cache.h> | 34 | #include <asm/cache.h> |
35 | #include <asm/byteorder.h> | 35 | #include <asm/byteorder.h> |
36 | 36 | ||
37 | #include <linux/config.h> | ||
38 | #include <linux/device.h> | 37 | #include <linux/device.h> |
39 | #include <linux/percpu.h> | 38 | #include <linux/percpu.h> |
40 | #include <linux/dmaengine.h> | 39 | #include <linux/dmaengine.h> |
@@ -233,6 +232,7 @@ enum netdev_state_t | |||
233 | __LINK_STATE_RX_SCHED, | 232 | __LINK_STATE_RX_SCHED, |
234 | __LINK_STATE_LINKWATCH_PENDING, | 233 | __LINK_STATE_LINKWATCH_PENDING, |
235 | __LINK_STATE_DORMANT, | 234 | __LINK_STATE_DORMANT, |
235 | __LINK_STATE_QDISC_RUNNING, | ||
236 | }; | 236 | }; |
237 | 237 | ||
238 | 238 | ||
@@ -308,9 +308,17 @@ struct net_device | |||
308 | #define NETIF_F_HW_VLAN_RX 256 /* Receive VLAN hw acceleration */ | 308 | #define NETIF_F_HW_VLAN_RX 256 /* Receive VLAN hw acceleration */ |
309 | #define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */ | 309 | #define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */ |
310 | #define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */ | 310 | #define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */ |
311 | #define NETIF_F_TSO 2048 /* Can offload TCP/IP segmentation */ | 311 | #define NETIF_F_GSO 2048 /* Enable software GSO. */ |
312 | #define NETIF_F_LLTX 4096 /* LockLess TX */ | 312 | #define NETIF_F_LLTX 4096 /* LockLess TX */ |
313 | #define NETIF_F_UFO 8192 /* Can offload UDP Large Send*/ | 313 | |
314 | /* Segmentation offload features */ | ||
315 | #define NETIF_F_GSO_SHIFT 16 | ||
316 | #define NETIF_F_GSO_MASK 0xffff0000 | ||
317 | #define NETIF_F_TSO (SKB_GSO_TCPV4 << NETIF_F_GSO_SHIFT) | ||
318 | #define NETIF_F_UFO (SKB_GSO_UDP << NETIF_F_GSO_SHIFT) | ||
319 | #define NETIF_F_GSO_ROBUST (SKB_GSO_DODGY << NETIF_F_GSO_SHIFT) | ||
320 | #define NETIF_F_TSO_ECN (SKB_GSO_TCP_ECN << NETIF_F_GSO_SHIFT) | ||
321 | #define NETIF_F_TSO6 (SKB_GSO_TCPV6 << NETIF_F_GSO_SHIFT) | ||
314 | 322 | ||
315 | #define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM) | 323 | #define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM) |
316 | #define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM) | 324 | #define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM) |
@@ -402,6 +410,9 @@ struct net_device | |||
402 | struct list_head qdisc_list; | 410 | struct list_head qdisc_list; |
403 | unsigned long tx_queue_len; /* Max frames per queue allowed */ | 411 | unsigned long tx_queue_len; /* Max frames per queue allowed */ |
404 | 412 | ||
413 | /* Partially transmitted GSO packet. */ | ||
414 | struct sk_buff *gso_skb; | ||
415 | |||
405 | /* ingress path synchronizer */ | 416 | /* ingress path synchronizer */ |
406 | spinlock_t ingress_lock; | 417 | spinlock_t ingress_lock; |
407 | struct Qdisc *qdisc_ingress; | 418 | struct Qdisc *qdisc_ingress; |
@@ -536,6 +547,8 @@ struct packet_type { | |||
536 | struct net_device *, | 547 | struct net_device *, |
537 | struct packet_type *, | 548 | struct packet_type *, |
538 | struct net_device *); | 549 | struct net_device *); |
550 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, | ||
551 | int features); | ||
539 | void *af_packet_priv; | 552 | void *af_packet_priv; |
540 | struct list_head list; | 553 | struct list_head list; |
541 | }; | 554 | }; |
@@ -686,11 +699,11 @@ extern int dev_change_name(struct net_device *, char *); | |||
686 | extern int dev_set_mtu(struct net_device *, int); | 699 | extern int dev_set_mtu(struct net_device *, int); |
687 | extern int dev_set_mac_address(struct net_device *, | 700 | extern int dev_set_mac_address(struct net_device *, |
688 | struct sockaddr *); | 701 | struct sockaddr *); |
689 | extern void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev); | 702 | extern int dev_hard_start_xmit(struct sk_buff *skb, |
703 | struct net_device *dev); | ||
690 | 704 | ||
691 | extern void dev_init(void); | 705 | extern void dev_init(void); |
692 | 706 | ||
693 | extern int netdev_nit; | ||
694 | extern int netdev_budget; | 707 | extern int netdev_budget; |
695 | 708 | ||
696 | /* Called by rtnetlink.c:rtnl_unlock() */ | 709 | /* Called by rtnetlink.c:rtnl_unlock() */ |
@@ -960,6 +973,7 @@ extern int netdev_max_backlog; | |||
960 | extern int weight_p; | 973 | extern int weight_p; |
961 | extern int netdev_set_master(struct net_device *dev, struct net_device *master); | 974 | extern int netdev_set_master(struct net_device *dev, struct net_device *master); |
962 | extern int skb_checksum_help(struct sk_buff *skb, int inward); | 975 | extern int skb_checksum_help(struct sk_buff *skb, int inward); |
976 | extern struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features); | ||
963 | #ifdef CONFIG_BUG | 977 | #ifdef CONFIG_BUG |
964 | extern void netdev_rx_csum_fault(struct net_device *dev); | 978 | extern void netdev_rx_csum_fault(struct net_device *dev); |
965 | #else | 979 | #else |
@@ -979,6 +993,23 @@ extern void dev_seq_stop(struct seq_file *seq, void *v); | |||
979 | 993 | ||
980 | extern void linkwatch_run_queue(void); | 994 | extern void linkwatch_run_queue(void); |
981 | 995 | ||
996 | static inline int net_gso_ok(int features, int gso_type) | ||
997 | { | ||
998 | int feature = gso_type << NETIF_F_GSO_SHIFT; | ||
999 | return (features & feature) == feature; | ||
1000 | } | ||
1001 | |||
1002 | static inline int skb_gso_ok(struct sk_buff *skb, int features) | ||
1003 | { | ||
1004 | return net_gso_ok(features, skb_shinfo(skb)->gso_size ? | ||
1005 | skb_shinfo(skb)->gso_type : 0); | ||
1006 | } | ||
1007 | |||
1008 | static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) | ||
1009 | { | ||
1010 | return !skb_gso_ok(skb, dev->features); | ||
1011 | } | ||
1012 | |||
982 | #endif /* __KERNEL__ */ | 1013 | #endif /* __KERNEL__ */ |
983 | 1014 | ||
984 | #endif /* _LINUX_DEV_H */ | 1015 | #endif /* _LINUX_DEV_H */ |
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index b31a9bca9361..10168e26a846 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
@@ -40,7 +40,6 @@ | |||
40 | #endif | 40 | #endif |
41 | 41 | ||
42 | #ifdef __KERNEL__ | 42 | #ifdef __KERNEL__ |
43 | #include <linux/config.h> | ||
44 | #ifdef CONFIG_NETFILTER | 43 | #ifdef CONFIG_NETFILTER |
45 | 44 | ||
46 | extern void netfilter_init(void); | 45 | extern void netfilter_init(void); |
diff --git a/include/linux/netfilter/xt_conntrack.h b/include/linux/netfilter/xt_conntrack.h index 34f63cf2e293..4c2d9945ca54 100644 --- a/include/linux/netfilter/xt_conntrack.h +++ b/include/linux/netfilter/xt_conntrack.h | |||
@@ -42,7 +42,7 @@ struct ip_conntrack_old_tuple | |||
42 | } u; | 42 | } u; |
43 | 43 | ||
44 | /* The protocol. */ | 44 | /* The protocol. */ |
45 | u16 protonum; | 45 | __u16 protonum; |
46 | } dst; | 46 | } dst; |
47 | }; | 47 | }; |
48 | 48 | ||
diff --git a/include/linux/netfilter_arp.h b/include/linux/netfilter_arp.h index a3f8977f7f12..92bc6ddcbf73 100644 --- a/include/linux/netfilter_arp.h +++ b/include/linux/netfilter_arp.h | |||
@@ -5,7 +5,6 @@ | |||
5 | * (C)2002 Rusty Russell IBM -- This code is GPL. | 5 | * (C)2002 Rusty Russell IBM -- This code is GPL. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include <linux/config.h> | ||
9 | #include <linux/netfilter.h> | 8 | #include <linux/netfilter.h> |
10 | 9 | ||
11 | /* There is no PF_ARP. */ | 10 | /* There is no PF_ARP. */ |
diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h index a75b84bb9a88..87764022cc67 100644 --- a/include/linux/netfilter_bridge.h +++ b/include/linux/netfilter_bridge.h | |||
@@ -4,7 +4,6 @@ | |||
4 | /* bridge-specific defines for netfilter. | 4 | /* bridge-specific defines for netfilter. |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #include <linux/config.h> | ||
8 | #include <linux/netfilter.h> | 7 | #include <linux/netfilter.h> |
9 | #if defined(__KERNEL__) && defined(CONFIG_BRIDGE_NETFILTER) | 8 | #if defined(__KERNEL__) && defined(CONFIG_BRIDGE_NETFILTER) |
10 | #include <asm/atomic.h> | 9 | #include <asm/atomic.h> |
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h index 85301c5e8d24..ce02c984f3ba 100644 --- a/include/linux/netfilter_ipv4.h +++ b/include/linux/netfilter_ipv4.h | |||
@@ -5,7 +5,6 @@ | |||
5 | * (C)1998 Rusty Russell -- This code is GPL. | 5 | * (C)1998 Rusty Russell -- This code is GPL. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include <linux/config.h> | ||
9 | #include <linux/netfilter.h> | 8 | #include <linux/netfilter.h> |
10 | 9 | ||
11 | /* only for userspace compatibility */ | 10 | /* only for userspace compatibility */ |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h index e0e9951eb8c3..51dbec1892c8 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack.h +++ b/include/linux/netfilter_ipv4/ip_conntrack.h | |||
@@ -4,7 +4,6 @@ | |||
4 | #include <linux/netfilter/nf_conntrack_common.h> | 4 | #include <linux/netfilter/nf_conntrack_common.h> |
5 | 5 | ||
6 | #ifdef __KERNEL__ | 6 | #ifdef __KERNEL__ |
7 | #include <linux/config.h> | ||
8 | #include <linux/netfilter_ipv4/ip_conntrack_tuple.h> | 7 | #include <linux/netfilter_ipv4/ip_conntrack_tuple.h> |
9 | #include <linux/bitops.h> | 8 | #include <linux/bitops.h> |
10 | #include <linux/compiler.h> | 9 | #include <linux/compiler.h> |
diff --git a/include/linux/netfilter_ipv4/listhelp.h b/include/linux/netfilter_ipv4/listhelp.h index 360429f48737..5d92cf044d91 100644 --- a/include/linux/netfilter_ipv4/listhelp.h +++ b/include/linux/netfilter_ipv4/listhelp.h | |||
@@ -1,6 +1,5 @@ | |||
1 | #ifndef _LISTHELP_H | 1 | #ifndef _LISTHELP_H |
2 | #define _LISTHELP_H | 2 | #define _LISTHELP_H |
3 | #include <linux/config.h> | ||
4 | #include <linux/list.h> | 3 | #include <linux/list.h> |
5 | 4 | ||
6 | /* Header to do more comprehensive job than linux/list.h; assume list | 5 | /* Header to do more comprehensive job than linux/list.h; assume list |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 87b8a5703ebc..855b44668caa 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -5,7 +5,7 @@ | |||
5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
6 | 6 | ||
7 | #define NETLINK_ROUTE 0 /* Routing/device hook */ | 7 | #define NETLINK_ROUTE 0 /* Routing/device hook */ |
8 | #define NETLINK_W1 1 /* 1-wire subsystem */ | 8 | #define NETLINK_UNUSED 1 /* Unused number */ |
9 | #define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */ | 9 | #define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */ |
10 | #define NETLINK_FIREWALL 3 /* Firewalling hook */ | 10 | #define NETLINK_FIREWALL 3 /* Firewalling hook */ |
11 | #define NETLINK_INET_DIAG 4 /* INET socket monitoring */ | 11 | #define NETLINK_INET_DIAG 4 /* INET socket monitoring */ |
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index ca5a8733000f..1efe60c5c00c 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h | |||
@@ -31,6 +31,7 @@ struct netpoll_info { | |||
31 | int rx_flags; | 31 | int rx_flags; |
32 | spinlock_t rx_lock; | 32 | spinlock_t rx_lock; |
33 | struct netpoll *rx_np; /* netpoll that registered an rx_hook */ | 33 | struct netpoll *rx_np; /* netpoll that registered an rx_hook */ |
34 | struct sk_buff_head arp_tx; /* list of arp requests to reply to */ | ||
34 | }; | 35 | }; |
35 | 36 | ||
36 | void netpoll_poll(struct netpoll *np); | 37 | void netpoll_poll(struct netpoll *np); |
diff --git a/include/linux/nfs.h b/include/linux/nfs.h index ca2ffa6ae1d5..54af92c1c70b 100644 --- a/include/linux/nfs.h +++ b/include/linux/nfs.h | |||
@@ -7,9 +7,6 @@ | |||
7 | #ifndef _LINUX_NFS_H | 7 | #ifndef _LINUX_NFS_H |
8 | #define _LINUX_NFS_H | 8 | #define _LINUX_NFS_H |
9 | 9 | ||
10 | #include <linux/sunrpc/msg_prot.h> | ||
11 | #include <linux/string.h> | ||
12 | |||
13 | #define NFS_PROGRAM 100003 | 10 | #define NFS_PROGRAM 100003 |
14 | #define NFS_PORT 2049 | 11 | #define NFS_PORT 2049 |
15 | #define NFS_MAXDATA 8192 | 12 | #define NFS_MAXDATA 8192 |
@@ -129,7 +126,10 @@ enum nfs_ftype { | |||
129 | NFFIFO = 8 | 126 | NFFIFO = 8 |
130 | }; | 127 | }; |
131 | 128 | ||
132 | #if defined(__KERNEL__) | 129 | #ifdef __KERNEL__ |
130 | #include <linux/sunrpc/msg_prot.h> | ||
131 | #include <linux/string.h> | ||
132 | |||
133 | /* | 133 | /* |
134 | * This is the kernel NFS client file handle representation | 134 | * This is the kernel NFS client file handle representation |
135 | */ | 135 | */ |
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 0c1c306cdaec..5f681d534295 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -14,7 +14,6 @@ | |||
14 | #define _LINUX_NFS4_H | 14 | #define _LINUX_NFS4_H |
15 | 15 | ||
16 | #include <linux/types.h> | 16 | #include <linux/types.h> |
17 | #include <linux/list.h> | ||
18 | 17 | ||
19 | #define NFS4_VERIFIER_SIZE 8 | 18 | #define NFS4_VERIFIER_SIZE 8 |
20 | #define NFS4_FHSIZE 128 | 19 | #define NFS4_FHSIZE 128 |
@@ -97,6 +96,9 @@ enum nfs4_acl_whotype { | |||
97 | NFS4_ACL_WHO_EVERYONE, | 96 | NFS4_ACL_WHO_EVERYONE, |
98 | }; | 97 | }; |
99 | 98 | ||
99 | #ifdef __KERNEL__ | ||
100 | #include <linux/list.h> | ||
101 | |||
100 | struct nfs4_ace { | 102 | struct nfs4_ace { |
101 | uint32_t type; | 103 | uint32_t type; |
102 | uint32_t flag; | 104 | uint32_t flag; |
@@ -345,8 +347,6 @@ enum lock_type4 { | |||
345 | #define NFS4_MINOR_VERSION 0 | 347 | #define NFS4_MINOR_VERSION 0 |
346 | #define NFS4_DEBUG 1 | 348 | #define NFS4_DEBUG 1 |
347 | 349 | ||
348 | #ifdef __KERNEL__ | ||
349 | |||
350 | /* Index of predefined Linux client operations */ | 350 | /* Index of predefined Linux client operations */ |
351 | 351 | ||
352 | enum { | 352 | enum { |
@@ -384,6 +384,7 @@ enum { | |||
384 | NFSPROC4_CLNT_DELEGRETURN, | 384 | NFSPROC4_CLNT_DELEGRETURN, |
385 | NFSPROC4_CLNT_GETACL, | 385 | NFSPROC4_CLNT_GETACL, |
386 | NFSPROC4_CLNT_SETACL, | 386 | NFSPROC4_CLNT_SETACL, |
387 | NFSPROC4_CLNT_FS_LOCATIONS, | ||
387 | }; | 388 | }; |
388 | 389 | ||
389 | #endif | 390 | #endif |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index c71227dd4389..55ea853d57bc 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -9,15 +9,12 @@ | |||
9 | #ifndef _LINUX_NFS_FS_H | 9 | #ifndef _LINUX_NFS_FS_H |
10 | #define _LINUX_NFS_FS_H | 10 | #define _LINUX_NFS_FS_H |
11 | 11 | ||
12 | #include <linux/config.h> | ||
13 | #include <linux/in.h> | 12 | #include <linux/in.h> |
14 | #include <linux/mm.h> | 13 | #include <linux/mm.h> |
15 | #include <linux/pagemap.h> | 14 | #include <linux/pagemap.h> |
16 | #include <linux/rwsem.h> | 15 | #include <linux/rwsem.h> |
17 | #include <linux/wait.h> | 16 | #include <linux/wait.h> |
18 | 17 | ||
19 | #include <linux/nfs_fs_sb.h> | ||
20 | |||
21 | #include <linux/sunrpc/debug.h> | 18 | #include <linux/sunrpc/debug.h> |
22 | #include <linux/sunrpc/auth.h> | 19 | #include <linux/sunrpc/auth.h> |
23 | #include <linux/sunrpc/clnt.h> | 20 | #include <linux/sunrpc/clnt.h> |
@@ -27,6 +24,9 @@ | |||
27 | #include <linux/nfs3.h> | 24 | #include <linux/nfs3.h> |
28 | #include <linux/nfs4.h> | 25 | #include <linux/nfs4.h> |
29 | #include <linux/nfs_xdr.h> | 26 | #include <linux/nfs_xdr.h> |
27 | |||
28 | #include <linux/nfs_fs_sb.h> | ||
29 | |||
30 | #include <linux/rwsem.h> | 30 | #include <linux/rwsem.h> |
31 | #include <linux/mempool.h> | 31 | #include <linux/mempool.h> |
32 | 32 | ||
@@ -61,6 +61,7 @@ | |||
61 | #define FLUSH_LOWPRI 8 /* low priority background flush */ | 61 | #define FLUSH_LOWPRI 8 /* low priority background flush */ |
62 | #define FLUSH_HIGHPRI 16 /* high priority memory reclaim flush */ | 62 | #define FLUSH_HIGHPRI 16 /* high priority memory reclaim flush */ |
63 | #define FLUSH_NOCOMMIT 32 /* Don't send the NFSv3/v4 COMMIT */ | 63 | #define FLUSH_NOCOMMIT 32 /* Don't send the NFSv3/v4 COMMIT */ |
64 | #define FLUSH_INVALIDATE 64 /* Invalidate the page cache */ | ||
64 | 65 | ||
65 | #ifdef __KERNEL__ | 66 | #ifdef __KERNEL__ |
66 | 67 | ||
@@ -234,8 +235,12 @@ static inline int nfs_caches_unstable(struct inode *inode) | |||
234 | 235 | ||
235 | static inline void nfs_mark_for_revalidate(struct inode *inode) | 236 | static inline void nfs_mark_for_revalidate(struct inode *inode) |
236 | { | 237 | { |
238 | struct nfs_inode *nfsi = NFS_I(inode); | ||
239 | |||
237 | spin_lock(&inode->i_lock); | 240 | spin_lock(&inode->i_lock); |
238 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS; | 241 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ACCESS; |
242 | if (S_ISDIR(inode->i_mode)) | ||
243 | nfsi->cache_validity |= NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_DATA; | ||
239 | spin_unlock(&inode->i_lock); | 244 | spin_unlock(&inode->i_lock); |
240 | } | 245 | } |
241 | 246 | ||
@@ -297,7 +302,7 @@ extern int nfs_release(struct inode *, struct file *); | |||
297 | extern int nfs_attribute_timeout(struct inode *inode); | 302 | extern int nfs_attribute_timeout(struct inode *inode); |
298 | extern int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode); | 303 | extern int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode); |
299 | extern int __nfs_revalidate_inode(struct nfs_server *, struct inode *); | 304 | extern int __nfs_revalidate_inode(struct nfs_server *, struct inode *); |
300 | extern void nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping); | 305 | extern int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping); |
301 | extern int nfs_setattr(struct dentry *, struct iattr *); | 306 | extern int nfs_setattr(struct dentry *, struct iattr *); |
302 | extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr); | 307 | extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr); |
303 | extern void nfs_begin_attr_update(struct inode *); | 308 | extern void nfs_begin_attr_update(struct inode *); |
@@ -307,6 +312,10 @@ extern void nfs_end_data_update(struct inode *); | |||
307 | extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); | 312 | extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); |
308 | extern void put_nfs_open_context(struct nfs_open_context *ctx); | 313 | extern void put_nfs_open_context(struct nfs_open_context *ctx); |
309 | extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, int mode); | 314 | extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, int mode); |
315 | extern struct vfsmount *nfs_do_submount(const struct vfsmount *mnt_parent, | ||
316 | const struct dentry *dentry, | ||
317 | struct nfs_fh *fh, | ||
318 | struct nfs_fattr *fattr); | ||
310 | 319 | ||
311 | /* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ | 320 | /* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ |
312 | extern u32 root_nfs_parse_addr(char *name); /*__init*/ | 321 | extern u32 root_nfs_parse_addr(char *name); /*__init*/ |
@@ -325,7 +334,7 @@ extern struct inode_operations nfs_file_inode_operations; | |||
325 | extern struct inode_operations nfs3_file_inode_operations; | 334 | extern struct inode_operations nfs3_file_inode_operations; |
326 | #endif /* CONFIG_NFS_V3 */ | 335 | #endif /* CONFIG_NFS_V3 */ |
327 | extern const struct file_operations nfs_file_operations; | 336 | extern const struct file_operations nfs_file_operations; |
328 | extern struct address_space_operations nfs_file_aops; | 337 | extern const struct address_space_operations nfs_file_aops; |
329 | 338 | ||
330 | static inline struct rpc_cred *nfs_file_cred(struct file *file) | 339 | static inline struct rpc_cred *nfs_file_cred(struct file *file) |
331 | { | 340 | { |
@@ -393,6 +402,15 @@ extern void nfs_unregister_sysctl(void); | |||
393 | #endif | 402 | #endif |
394 | 403 | ||
395 | /* | 404 | /* |
405 | * linux/fs/nfs/namespace.c | ||
406 | */ | ||
407 | extern struct list_head nfs_automount_list; | ||
408 | extern struct inode_operations nfs_mountpoint_inode_operations; | ||
409 | extern struct inode_operations nfs_referral_inode_operations; | ||
410 | extern int nfs_mountpoint_expiry_timeout; | ||
411 | extern void nfs_release_automount_timer(void); | ||
412 | |||
413 | /* | ||
396 | * linux/fs/nfs/unlink.c | 414 | * linux/fs/nfs/unlink.c |
397 | */ | 415 | */ |
398 | extern int nfs_async_unlink(struct dentry *); | 416 | extern int nfs_async_unlink(struct dentry *); |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index 65dec21af774..6b4a13c79474 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
@@ -35,6 +35,7 @@ struct nfs_server { | |||
35 | char * hostname; /* remote hostname */ | 35 | char * hostname; /* remote hostname */ |
36 | struct nfs_fh fh; | 36 | struct nfs_fh fh; |
37 | struct sockaddr_in addr; | 37 | struct sockaddr_in addr; |
38 | struct nfs_fsid fsid; | ||
38 | unsigned long mount_time; /* when this fs was mounted */ | 39 | unsigned long mount_time; /* when this fs was mounted */ |
39 | #ifdef CONFIG_NFS_V4 | 40 | #ifdef CONFIG_NFS_V4 |
40 | /* Our own IP address, as a null-terminated string. | 41 | /* Our own IP address, as a null-terminated string. |
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h index 66e2ed658527..1f7bd287c230 100644 --- a/include/linux/nfs_page.h +++ b/include/linux/nfs_page.h | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <linux/list.h> | 13 | #include <linux/list.h> |
14 | #include <linux/pagemap.h> | 14 | #include <linux/pagemap.h> |
15 | #include <linux/wait.h> | 15 | #include <linux/wait.h> |
16 | #include <linux/nfs_fs_sb.h> | ||
17 | #include <linux/sunrpc/auth.h> | 16 | #include <linux/sunrpc/auth.h> |
18 | #include <linux/nfs_xdr.h> | 17 | #include <linux/nfs_xdr.h> |
19 | 18 | ||
@@ -63,8 +62,8 @@ extern void nfs_release_request(struct nfs_page *req); | |||
63 | 62 | ||
64 | extern int nfs_scan_lock_dirty(struct nfs_inode *nfsi, struct list_head *dst, | 63 | extern int nfs_scan_lock_dirty(struct nfs_inode *nfsi, struct list_head *dst, |
65 | unsigned long idx_start, unsigned int npages); | 64 | unsigned long idx_start, unsigned int npages); |
66 | extern int nfs_scan_list(struct list_head *, struct list_head *, | 65 | extern int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *head, struct list_head *dst, |
67 | unsigned long, unsigned int); | 66 | unsigned long idx_start, unsigned int npages); |
68 | extern int nfs_coalesce_requests(struct list_head *, struct list_head *, | 67 | extern int nfs_coalesce_requests(struct list_head *, struct list_head *, |
69 | unsigned int); | 68 | unsigned int); |
70 | extern int nfs_wait_on_request(struct nfs_page *); | 69 | extern int nfs_wait_on_request(struct nfs_page *); |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 7fafc4c546b7..7c7320fa51aa 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -14,11 +14,19 @@ | |||
14 | #define NFS_DEF_FILE_IO_SIZE (4096U) | 14 | #define NFS_DEF_FILE_IO_SIZE (4096U) |
15 | #define NFS_MIN_FILE_IO_SIZE (1024U) | 15 | #define NFS_MIN_FILE_IO_SIZE (1024U) |
16 | 16 | ||
17 | struct nfs4_fsid { | 17 | struct nfs_fsid { |
18 | __u64 major; | 18 | uint64_t major; |
19 | __u64 minor; | 19 | uint64_t minor; |
20 | }; | 20 | }; |
21 | 21 | ||
22 | /* | ||
23 | * Helper for checking equality between 2 fsids. | ||
24 | */ | ||
25 | static inline int nfs_fsid_equal(const struct nfs_fsid *a, const struct nfs_fsid *b) | ||
26 | { | ||
27 | return a->major == b->major && a->minor == b->minor; | ||
28 | } | ||
29 | |||
22 | struct nfs_fattr { | 30 | struct nfs_fattr { |
23 | unsigned short valid; /* which fields are valid */ | 31 | unsigned short valid; /* which fields are valid */ |
24 | __u64 pre_size; /* pre_op_attr.size */ | 32 | __u64 pre_size; /* pre_op_attr.size */ |
@@ -40,10 +48,7 @@ struct nfs_fattr { | |||
40 | } nfs3; | 48 | } nfs3; |
41 | } du; | 49 | } du; |
42 | dev_t rdev; | 50 | dev_t rdev; |
43 | union { | 51 | struct nfs_fsid fsid; |
44 | __u64 nfs3; /* also nfs2 */ | ||
45 | struct nfs4_fsid nfs4; | ||
46 | } fsid_u; | ||
47 | __u64 fileid; | 52 | __u64 fileid; |
48 | struct timespec atime; | 53 | struct timespec atime; |
49 | struct timespec mtime; | 54 | struct timespec mtime; |
@@ -57,8 +62,8 @@ struct nfs_fattr { | |||
57 | #define NFS_ATTR_WCC 0x0001 /* pre-op WCC data */ | 62 | #define NFS_ATTR_WCC 0x0001 /* pre-op WCC data */ |
58 | #define NFS_ATTR_FATTR 0x0002 /* post-op attributes */ | 63 | #define NFS_ATTR_FATTR 0x0002 /* post-op attributes */ |
59 | #define NFS_ATTR_FATTR_V3 0x0004 /* NFSv3 attributes */ | 64 | #define NFS_ATTR_FATTR_V3 0x0004 /* NFSv3 attributes */ |
60 | #define NFS_ATTR_FATTR_V4 0x0008 | 65 | #define NFS_ATTR_FATTR_V4 0x0008 /* NFSv4 change attribute */ |
61 | #define NFS_ATTR_PRE_CHANGE 0x0010 | 66 | #define NFS_ATTR_FATTR_V4_REFERRAL 0x0010 /* NFSv4 referral */ |
62 | 67 | ||
63 | /* | 68 | /* |
64 | * Info on the file system | 69 | * Info on the file system |
@@ -675,6 +680,40 @@ struct nfs4_server_caps_res { | |||
675 | u32 has_symlinks; | 680 | u32 has_symlinks; |
676 | }; | 681 | }; |
677 | 682 | ||
683 | struct nfs4_string { | ||
684 | unsigned int len; | ||
685 | char *data; | ||
686 | }; | ||
687 | |||
688 | #define NFS4_PATHNAME_MAXCOMPONENTS 512 | ||
689 | struct nfs4_pathname { | ||
690 | unsigned int ncomponents; | ||
691 | struct nfs4_string components[NFS4_PATHNAME_MAXCOMPONENTS]; | ||
692 | }; | ||
693 | |||
694 | #define NFS4_FS_LOCATION_MAXSERVERS 10 | ||
695 | struct nfs4_fs_location { | ||
696 | unsigned int nservers; | ||
697 | struct nfs4_string servers[NFS4_FS_LOCATION_MAXSERVERS]; | ||
698 | struct nfs4_pathname rootpath; | ||
699 | }; | ||
700 | |||
701 | #define NFS4_FS_LOCATIONS_MAXENTRIES 10 | ||
702 | struct nfs4_fs_locations { | ||
703 | struct nfs_fattr fattr; | ||
704 | const struct nfs_server *server; | ||
705 | struct nfs4_pathname fs_path; | ||
706 | int nlocations; | ||
707 | struct nfs4_fs_location locations[NFS4_FS_LOCATIONS_MAXENTRIES]; | ||
708 | }; | ||
709 | |||
710 | struct nfs4_fs_locations_arg { | ||
711 | const struct nfs_fh *dir_fh; | ||
712 | const struct qstr *name; | ||
713 | struct page *page; | ||
714 | const u32 *bitmask; | ||
715 | }; | ||
716 | |||
678 | #endif /* CONFIG_NFS_V4 */ | 717 | #endif /* CONFIG_NFS_V4 */ |
679 | 718 | ||
680 | struct nfs_page; | 719 | struct nfs_page; |
@@ -695,7 +734,7 @@ struct nfs_read_data { | |||
695 | #ifdef CONFIG_NFS_V4 | 734 | #ifdef CONFIG_NFS_V4 |
696 | unsigned long timestamp; /* For lease renewal */ | 735 | unsigned long timestamp; /* For lease renewal */ |
697 | #endif | 736 | #endif |
698 | struct page *page_array[NFS_PAGEVEC_SIZE + 1]; | 737 | struct page *page_array[NFS_PAGEVEC_SIZE]; |
699 | }; | 738 | }; |
700 | 739 | ||
701 | struct nfs_write_data { | 740 | struct nfs_write_data { |
@@ -713,7 +752,7 @@ struct nfs_write_data { | |||
713 | #ifdef CONFIG_NFS_V4 | 752 | #ifdef CONFIG_NFS_V4 |
714 | unsigned long timestamp; /* For lease renewal */ | 753 | unsigned long timestamp; /* For lease renewal */ |
715 | #endif | 754 | #endif |
716 | struct page *page_array[NFS_PAGEVEC_SIZE + 1]; | 755 | struct page *page_array[NFS_PAGEVEC_SIZE]; |
717 | }; | 756 | }; |
718 | 757 | ||
719 | struct nfs_access_entry; | 758 | struct nfs_access_entry; |
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h index ec7c2e872d72..2dcad295fece 100644 --- a/include/linux/nfsd/nfsd.h +++ b/include/linux/nfsd/nfsd.h | |||
@@ -10,7 +10,6 @@ | |||
10 | #ifndef LINUX_NFSD_NFSD_H | 10 | #ifndef LINUX_NFSD_NFSD_H |
11 | #define LINUX_NFSD_NFSD_H | 11 | #define LINUX_NFSD_NFSD_H |
12 | 12 | ||
13 | #include <linux/config.h> | ||
14 | #include <linux/types.h> | 13 | #include <linux/types.h> |
15 | #include <linux/unistd.h> | 14 | #include <linux/unistd.h> |
16 | #include <linux/dirent.h> | 15 | #include <linux/dirent.h> |
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h index 0798b7781a6e..f9edcd2ff3c8 100644 --- a/include/linux/nfsd/nfsfh.h +++ b/include/linux/nfsd/nfsfh.h | |||
@@ -16,7 +16,6 @@ | |||
16 | 16 | ||
17 | #include <asm/types.h> | 17 | #include <asm/types.h> |
18 | #ifdef __KERNEL__ | 18 | #ifdef __KERNEL__ |
19 | # include <linux/config.h> | ||
20 | # include <linux/types.h> | 19 | # include <linux/types.h> |
21 | # include <linux/string.h> | 20 | # include <linux/string.h> |
22 | # include <linux/fs.h> | 21 | # include <linux/fs.h> |
diff --git a/include/linux/nfsd/syscall.h b/include/linux/nfsd/syscall.h index 781efbf94ed3..dae0faea2807 100644 --- a/include/linux/nfsd/syscall.h +++ b/include/linux/nfsd/syscall.h | |||
@@ -11,7 +11,6 @@ | |||
11 | 11 | ||
12 | #include <asm/types.h> | 12 | #include <asm/types.h> |
13 | #ifdef __KERNEL__ | 13 | #ifdef __KERNEL__ |
14 | # include <linux/config.h> | ||
15 | # include <linux/types.h> | 14 | # include <linux/types.h> |
16 | # include <linux/in.h> | 15 | # include <linux/in.h> |
17 | #endif | 16 | #endif |
diff --git a/include/linux/node.h b/include/linux/node.h index 254dc3de650b..81dcec84cd8f 100644 --- a/include/linux/node.h +++ b/include/linux/node.h | |||
@@ -26,8 +26,25 @@ struct node { | |||
26 | struct sys_device sysdev; | 26 | struct sys_device sysdev; |
27 | }; | 27 | }; |
28 | 28 | ||
29 | extern struct node node_devices[]; | ||
30 | |||
29 | extern int register_node(struct node *, int, struct node *); | 31 | extern int register_node(struct node *, int, struct node *); |
30 | extern void unregister_node(struct node *node); | 32 | extern void unregister_node(struct node *node); |
33 | extern int register_one_node(int nid); | ||
34 | extern void unregister_one_node(int nid); | ||
35 | #ifdef CONFIG_NUMA | ||
36 | extern int register_cpu_under_node(unsigned int cpu, unsigned int nid); | ||
37 | extern int unregister_cpu_under_node(unsigned int cpu, unsigned int nid); | ||
38 | #else | ||
39 | static inline int register_cpu_under_node(unsigned int cpu, unsigned int nid) | ||
40 | { | ||
41 | return 0; | ||
42 | } | ||
43 | static inline int unregister_cpu_under_node(unsigned int cpu, unsigned int nid) | ||
44 | { | ||
45 | return 0; | ||
46 | } | ||
47 | #endif | ||
31 | 48 | ||
32 | #define to_node(sys_device) container_of(sys_device, struct node, sysdev) | 49 | #define to_node(sys_device) container_of(sys_device, struct node, sysdev) |
33 | 50 | ||
diff --git a/include/linux/nsc_gpio.h b/include/linux/nsc_gpio.h new file mode 100644 index 000000000000..135742cfada5 --- /dev/null +++ b/include/linux/nsc_gpio.h | |||
@@ -0,0 +1,42 @@ | |||
1 | /** | ||
2 | nsc_gpio.c | ||
3 | |||
4 | National Semiconductor GPIO common access methods. | ||
5 | |||
6 | struct nsc_gpio_ops abstracts the low-level access | ||
7 | operations for the GPIO units on 2 NSC chip families; the GEODE | ||
8 | integrated CPU, and the PC-8736[03456] integrated PC-peripheral | ||
9 | chips. | ||
10 | |||
11 | The GPIO units on these chips have the same pin architecture, but | ||
12 | the access methods differ. Thus, scx200_gpio and pc8736x_gpio | ||
13 | implement their own versions of these routines; and use the common | ||
14 | file-operations routines implemented in nsc_gpio module. | ||
15 | |||
16 | Copyright (c) 2005 Jim Cromie <jim.cromie@gmail.com> | ||
17 | |||
18 | NB: this work was tested on the Geode SC-1100 and PC-87366 chips. | ||
19 | NSC sold the GEODE line to AMD, and the PC-8736x line to Winbond. | ||
20 | */ | ||
21 | |||
22 | struct nsc_gpio_ops { | ||
23 | struct module* owner; | ||
24 | u32 (*gpio_config) (unsigned iminor, u32 mask, u32 bits); | ||
25 | void (*gpio_dump) (struct nsc_gpio_ops *amp, unsigned iminor); | ||
26 | int (*gpio_get) (unsigned iminor); | ||
27 | void (*gpio_set) (unsigned iminor, int state); | ||
28 | void (*gpio_set_high)(unsigned iminor); | ||
29 | void (*gpio_set_low) (unsigned iminor); | ||
30 | void (*gpio_change) (unsigned iminor); | ||
31 | int (*gpio_current) (unsigned iminor); | ||
32 | struct device* dev; /* for dev_dbg() support, set in init */ | ||
33 | }; | ||
34 | |||
35 | extern ssize_t nsc_gpio_write(struct file *file, const char __user *data, | ||
36 | size_t len, loff_t *ppos); | ||
37 | |||
38 | extern ssize_t nsc_gpio_read(struct file *file, char __user *buf, | ||
39 | size_t len, loff_t *ppos); | ||
40 | |||
41 | extern void nsc_gpio_dump(struct nsc_gpio_ops *amp, unsigned index); | ||
42 | |||
diff --git a/include/linux/numa.h b/include/linux/numa.h index e481feb1bfd8..a31a7301b159 100644 --- a/include/linux/numa.h +++ b/include/linux/numa.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _LINUX_NUMA_H | 1 | #ifndef _LINUX_NUMA_H |
2 | #define _LINUX_NUMA_H | 2 | #define _LINUX_NUMA_H |
3 | 3 | ||
4 | #include <linux/config.h> | ||
5 | 4 | ||
6 | #ifdef CONFIG_NODES_SHIFT | 5 | #ifdef CONFIG_NODES_SHIFT |
7 | #define NODES_SHIFT CONFIG_NODES_SHIFT | 6 | #define NODES_SHIFT CONFIG_NODES_SHIFT |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index d276a4e2f825..5748642e9f36 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -5,9 +5,7 @@ | |||
5 | #ifndef PAGE_FLAGS_H | 5 | #ifndef PAGE_FLAGS_H |
6 | #define PAGE_FLAGS_H | 6 | #define PAGE_FLAGS_H |
7 | 7 | ||
8 | #include <linux/percpu.h> | 8 | #include <linux/types.h> |
9 | #include <linux/cache.h> | ||
10 | #include <asm/pgtable.h> | ||
11 | 9 | ||
12 | /* | 10 | /* |
13 | * Various page->flags bits: | 11 | * Various page->flags bits: |
@@ -88,135 +86,17 @@ | |||
88 | #define PG_nosave_free 18 /* Free, should not be written */ | 86 | #define PG_nosave_free 18 /* Free, should not be written */ |
89 | #define PG_buddy 19 /* Page is free, on buddy lists */ | 87 | #define PG_buddy 19 /* Page is free, on buddy lists */ |
90 | 88 | ||
91 | #define PG_uncached 20 /* Page has been mapped as uncached */ | ||
92 | 89 | ||
90 | #if (BITS_PER_LONG > 32) | ||
93 | /* | 91 | /* |
94 | * Global page accounting. One instance per CPU. Only unsigned longs are | 92 | * 64-bit-only flags build down from bit 31 |
95 | * allowed. | ||
96 | * | 93 | * |
97 | * - Fields can be modified with xxx_page_state and xxx_page_state_zone at | 94 | * 32 bit -------------------------------| FIELDS | FLAGS | |
98 | * any time safely (which protects the instance from modification by | 95 | * 64 bit | FIELDS | ?????? FLAGS | |
99 | * interrupt. | 96 | * 63 32 0 |
100 | * - The __xxx_page_state variants can be used safely when interrupts are | ||
101 | * disabled. | ||
102 | * - The __xxx_page_state variants can be used if the field is only | ||
103 | * modified from process context and protected from preemption, or only | ||
104 | * modified from interrupt context. In this case, the field should be | ||
105 | * commented here. | ||
106 | */ | 97 | */ |
107 | struct page_state { | 98 | #define PG_uncached 31 /* Page has been mapped as uncached */ |
108 | unsigned long nr_dirty; /* Dirty writeable pages */ | 99 | #endif |
109 | unsigned long nr_writeback; /* Pages under writeback */ | ||
110 | unsigned long nr_unstable; /* NFS unstable pages */ | ||
111 | unsigned long nr_page_table_pages;/* Pages used for pagetables */ | ||
112 | unsigned long nr_mapped; /* mapped into pagetables. | ||
113 | * only modified from process context */ | ||
114 | unsigned long nr_slab; /* In slab */ | ||
115 | #define GET_PAGE_STATE_LAST nr_slab | ||
116 | |||
117 | /* | ||
118 | * The below are zeroed by get_page_state(). Use get_full_page_state() | ||
119 | * to add up all these. | ||
120 | */ | ||
121 | unsigned long pgpgin; /* Disk reads */ | ||
122 | unsigned long pgpgout; /* Disk writes */ | ||
123 | unsigned long pswpin; /* swap reads */ | ||
124 | unsigned long pswpout; /* swap writes */ | ||
125 | |||
126 | unsigned long pgalloc_high; /* page allocations */ | ||
127 | unsigned long pgalloc_normal; | ||
128 | unsigned long pgalloc_dma32; | ||
129 | unsigned long pgalloc_dma; | ||
130 | |||
131 | unsigned long pgfree; /* page freeings */ | ||
132 | unsigned long pgactivate; /* pages moved inactive->active */ | ||
133 | unsigned long pgdeactivate; /* pages moved active->inactive */ | ||
134 | |||
135 | unsigned long pgfault; /* faults (major+minor) */ | ||
136 | unsigned long pgmajfault; /* faults (major only) */ | ||
137 | |||
138 | unsigned long pgrefill_high; /* inspected in refill_inactive_zone */ | ||
139 | unsigned long pgrefill_normal; | ||
140 | unsigned long pgrefill_dma32; | ||
141 | unsigned long pgrefill_dma; | ||
142 | |||
143 | unsigned long pgsteal_high; /* total highmem pages reclaimed */ | ||
144 | unsigned long pgsteal_normal; | ||
145 | unsigned long pgsteal_dma32; | ||
146 | unsigned long pgsteal_dma; | ||
147 | |||
148 | unsigned long pgscan_kswapd_high;/* total highmem pages scanned */ | ||
149 | unsigned long pgscan_kswapd_normal; | ||
150 | unsigned long pgscan_kswapd_dma32; | ||
151 | unsigned long pgscan_kswapd_dma; | ||
152 | |||
153 | unsigned long pgscan_direct_high;/* total highmem pages scanned */ | ||
154 | unsigned long pgscan_direct_normal; | ||
155 | unsigned long pgscan_direct_dma32; | ||
156 | unsigned long pgscan_direct_dma; | ||
157 | |||
158 | unsigned long pginodesteal; /* pages reclaimed via inode freeing */ | ||
159 | unsigned long slabs_scanned; /* slab objects scanned */ | ||
160 | unsigned long kswapd_steal; /* pages reclaimed by kswapd */ | ||
161 | unsigned long kswapd_inodesteal;/* reclaimed via kswapd inode freeing */ | ||
162 | unsigned long pageoutrun; /* kswapd's calls to page reclaim */ | ||
163 | unsigned long allocstall; /* direct reclaim calls */ | ||
164 | |||
165 | unsigned long pgrotated; /* pages rotated to tail of the LRU */ | ||
166 | unsigned long nr_bounce; /* pages for bounce buffers */ | ||
167 | }; | ||
168 | |||
169 | extern void get_page_state(struct page_state *ret); | ||
170 | extern void get_page_state_node(struct page_state *ret, int node); | ||
171 | extern void get_full_page_state(struct page_state *ret); | ||
172 | extern unsigned long read_page_state_offset(unsigned long offset); | ||
173 | extern void mod_page_state_offset(unsigned long offset, unsigned long delta); | ||
174 | extern void __mod_page_state_offset(unsigned long offset, unsigned long delta); | ||
175 | |||
176 | #define read_page_state(member) \ | ||
177 | read_page_state_offset(offsetof(struct page_state, member)) | ||
178 | |||
179 | #define mod_page_state(member, delta) \ | ||
180 | mod_page_state_offset(offsetof(struct page_state, member), (delta)) | ||
181 | |||
182 | #define __mod_page_state(member, delta) \ | ||
183 | __mod_page_state_offset(offsetof(struct page_state, member), (delta)) | ||
184 | |||
185 | #define inc_page_state(member) mod_page_state(member, 1UL) | ||
186 | #define dec_page_state(member) mod_page_state(member, 0UL - 1) | ||
187 | #define add_page_state(member,delta) mod_page_state(member, (delta)) | ||
188 | #define sub_page_state(member,delta) mod_page_state(member, 0UL - (delta)) | ||
189 | |||
190 | #define __inc_page_state(member) __mod_page_state(member, 1UL) | ||
191 | #define __dec_page_state(member) __mod_page_state(member, 0UL - 1) | ||
192 | #define __add_page_state(member,delta) __mod_page_state(member, (delta)) | ||
193 | #define __sub_page_state(member,delta) __mod_page_state(member, 0UL - (delta)) | ||
194 | |||
195 | #define page_state(member) (*__page_state(offsetof(struct page_state, member))) | ||
196 | |||
197 | #define state_zone_offset(zone, member) \ | ||
198 | ({ \ | ||
199 | unsigned offset; \ | ||
200 | if (is_highmem(zone)) \ | ||
201 | offset = offsetof(struct page_state, member##_high); \ | ||
202 | else if (is_normal(zone)) \ | ||
203 | offset = offsetof(struct page_state, member##_normal); \ | ||
204 | else if (is_dma32(zone)) \ | ||
205 | offset = offsetof(struct page_state, member##_dma32); \ | ||
206 | else \ | ||
207 | offset = offsetof(struct page_state, member##_dma); \ | ||
208 | offset; \ | ||
209 | }) | ||
210 | |||
211 | #define __mod_page_state_zone(zone, member, delta) \ | ||
212 | do { \ | ||
213 | __mod_page_state_offset(state_zone_offset(zone, member), (delta)); \ | ||
214 | } while (0) | ||
215 | |||
216 | #define mod_page_state_zone(zone, member, delta) \ | ||
217 | do { \ | ||
218 | mod_page_state_offset(state_zone_offset(zone, member), (delta)); \ | ||
219 | } while (0) | ||
220 | 100 | ||
221 | /* | 101 | /* |
222 | * Manipulation of page state flags | 102 | * Manipulation of page state flags |
@@ -242,7 +122,14 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta); | |||
242 | #define TestClearPageReferenced(page) test_and_clear_bit(PG_referenced, &(page)->flags) | 122 | #define TestClearPageReferenced(page) test_and_clear_bit(PG_referenced, &(page)->flags) |
243 | 123 | ||
244 | #define PageUptodate(page) test_bit(PG_uptodate, &(page)->flags) | 124 | #define PageUptodate(page) test_bit(PG_uptodate, &(page)->flags) |
245 | #ifndef SetPageUptodate | 125 | #ifdef CONFIG_S390 |
126 | #define SetPageUptodate(_page) \ | ||
127 | do { \ | ||
128 | struct page *__page = (_page); \ | ||
129 | if (!test_and_set_bit(PG_uptodate, &__page->flags)) \ | ||
130 | page_test_and_clear_dirty(_page); \ | ||
131 | } while (0) | ||
132 | #else | ||
246 | #define SetPageUptodate(page) set_bit(PG_uptodate, &(page)->flags) | 133 | #define SetPageUptodate(page) set_bit(PG_uptodate, &(page)->flags) |
247 | #endif | 134 | #endif |
248 | #define ClearPageUptodate(page) clear_bit(PG_uptodate, &(page)->flags) | 135 | #define ClearPageUptodate(page) clear_bit(PG_uptodate, &(page)->flags) |
@@ -294,7 +181,7 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta); | |||
294 | do { \ | 181 | do { \ |
295 | if (!test_and_set_bit(PG_writeback, \ | 182 | if (!test_and_set_bit(PG_writeback, \ |
296 | &(page)->flags)) \ | 183 | &(page)->flags)) \ |
297 | inc_page_state(nr_writeback); \ | 184 | inc_zone_page_state(page, NR_WRITEBACK); \ |
298 | } while (0) | 185 | } while (0) |
299 | #define TestSetPageWriteback(page) \ | 186 | #define TestSetPageWriteback(page) \ |
300 | ({ \ | 187 | ({ \ |
@@ -302,14 +189,14 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta); | |||
302 | ret = test_and_set_bit(PG_writeback, \ | 189 | ret = test_and_set_bit(PG_writeback, \ |
303 | &(page)->flags); \ | 190 | &(page)->flags); \ |
304 | if (!ret) \ | 191 | if (!ret) \ |
305 | inc_page_state(nr_writeback); \ | 192 | inc_zone_page_state(page, NR_WRITEBACK); \ |
306 | ret; \ | 193 | ret; \ |
307 | }) | 194 | }) |
308 | #define ClearPageWriteback(page) \ | 195 | #define ClearPageWriteback(page) \ |
309 | do { \ | 196 | do { \ |
310 | if (test_and_clear_bit(PG_writeback, \ | 197 | if (test_and_clear_bit(PG_writeback, \ |
311 | &(page)->flags)) \ | 198 | &(page)->flags)) \ |
312 | dec_page_state(nr_writeback); \ | 199 | dec_zone_page_state(page, NR_WRITEBACK); \ |
313 | } while (0) | 200 | } while (0) |
314 | #define TestClearPageWriteback(page) \ | 201 | #define TestClearPageWriteback(page) \ |
315 | ({ \ | 202 | ({ \ |
@@ -317,7 +204,7 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta); | |||
317 | ret = test_and_clear_bit(PG_writeback, \ | 204 | ret = test_and_clear_bit(PG_writeback, \ |
318 | &(page)->flags); \ | 205 | &(page)->flags); \ |
319 | if (ret) \ | 206 | if (ret) \ |
320 | dec_page_state(nr_writeback); \ | 207 | dec_zone_page_state(page, NR_WRITEBACK); \ |
321 | ret; \ | 208 | ret; \ |
322 | }) | 209 | }) |
323 | 210 | ||
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 7a1af574dedf..0a2f5d27f60e 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -99,6 +99,13 @@ extern struct page * read_cache_page(struct address_space *mapping, | |||
99 | extern int read_cache_pages(struct address_space *mapping, | 99 | extern int read_cache_pages(struct address_space *mapping, |
100 | struct list_head *pages, filler_t *filler, void *data); | 100 | struct list_head *pages, filler_t *filler, void *data); |
101 | 101 | ||
102 | static inline struct page *read_mapping_page(struct address_space *mapping, | ||
103 | unsigned long index, void *data) | ||
104 | { | ||
105 | filler_t *filler = (filler_t *)mapping->a_ops->readpage; | ||
106 | return read_cache_page(mapping, index, filler, data); | ||
107 | } | ||
108 | |||
102 | int add_to_page_cache(struct page *page, struct address_space *mapping, | 109 | int add_to_page_cache(struct page *page, struct address_space *mapping, |
103 | unsigned long index, gfp_t gfp_mask); | 110 | unsigned long index, gfp_t gfp_mask); |
104 | int add_to_page_cache_lru(struct page *page, struct address_space *mapping, | 111 | int add_to_page_cache_lru(struct page *page, struct address_space *mapping, |
@@ -106,51 +113,6 @@ int add_to_page_cache_lru(struct page *page, struct address_space *mapping, | |||
106 | extern void remove_from_page_cache(struct page *page); | 113 | extern void remove_from_page_cache(struct page *page); |
107 | extern void __remove_from_page_cache(struct page *page); | 114 | extern void __remove_from_page_cache(struct page *page); |
108 | 115 | ||
109 | extern atomic_t nr_pagecache; | ||
110 | |||
111 | #ifdef CONFIG_SMP | ||
112 | |||
113 | #define PAGECACHE_ACCT_THRESHOLD max(16, NR_CPUS * 2) | ||
114 | DECLARE_PER_CPU(long, nr_pagecache_local); | ||
115 | |||
116 | /* | ||
117 | * pagecache_acct implements approximate accounting for pagecache. | ||
118 | * vm_enough_memory() do not need high accuracy. Writers will keep | ||
119 | * an offset in their per-cpu arena and will spill that into the | ||
120 | * global count whenever the absolute value of the local count | ||
121 | * exceeds the counter's threshold. | ||
122 | * | ||
123 | * MUST be protected from preemption. | ||
124 | * current protection is mapping->page_lock. | ||
125 | */ | ||
126 | static inline void pagecache_acct(int count) | ||
127 | { | ||
128 | long *local; | ||
129 | |||
130 | local = &__get_cpu_var(nr_pagecache_local); | ||
131 | *local += count; | ||
132 | if (*local > PAGECACHE_ACCT_THRESHOLD || *local < -PAGECACHE_ACCT_THRESHOLD) { | ||
133 | atomic_add(*local, &nr_pagecache); | ||
134 | *local = 0; | ||
135 | } | ||
136 | } | ||
137 | |||
138 | #else | ||
139 | |||
140 | static inline void pagecache_acct(int count) | ||
141 | { | ||
142 | atomic_add(count, &nr_pagecache); | ||
143 | } | ||
144 | #endif | ||
145 | |||
146 | static inline unsigned long get_page_cache_size(void) | ||
147 | { | ||
148 | int ret = atomic_read(&nr_pagecache); | ||
149 | if (unlikely(ret < 0)) | ||
150 | ret = 0; | ||
151 | return ret; | ||
152 | } | ||
153 | |||
154 | /* | 116 | /* |
155 | * Return byte-offset into filesystem object for page. | 117 | * Return byte-offset into filesystem object for page. |
156 | */ | 118 | */ |
diff --git a/include/linux/parport.h b/include/linux/parport.h index 008d736a6c9a..5bf321e82c99 100644 --- a/include/linux/parport.h +++ b/include/linux/parport.h | |||
@@ -96,7 +96,6 @@ typedef enum { | |||
96 | /* The rest is for the kernel only */ | 96 | /* The rest is for the kernel only */ |
97 | #ifdef __KERNEL__ | 97 | #ifdef __KERNEL__ |
98 | 98 | ||
99 | #include <linux/config.h> | ||
100 | #include <linux/jiffies.h> | 99 | #include <linux/jiffies.h> |
101 | #include <linux/proc_fs.h> | 100 | #include <linux/proc_fs.h> |
102 | #include <linux/spinlock.h> | 101 | #include <linux/spinlock.h> |
@@ -128,6 +127,10 @@ struct amiga_parport_state { | |||
128 | unsigned char statusdir;/* ciab.ddrb & 7 */ | 127 | unsigned char statusdir;/* ciab.ddrb & 7 */ |
129 | }; | 128 | }; |
130 | 129 | ||
130 | struct ax88796_parport_state { | ||
131 | unsigned char cpr; | ||
132 | }; | ||
133 | |||
131 | struct ip32_parport_state { | 134 | struct ip32_parport_state { |
132 | unsigned int dcr; | 135 | unsigned int dcr; |
133 | unsigned int ecr; | 136 | unsigned int ecr; |
@@ -139,6 +142,7 @@ struct parport_state { | |||
139 | /* ARC has no state. */ | 142 | /* ARC has no state. */ |
140 | struct ax_parport_state ax; | 143 | struct ax_parport_state ax; |
141 | struct amiga_parport_state amiga; | 144 | struct amiga_parport_state amiga; |
145 | struct ax88796_parport_state ax88796; | ||
142 | /* Atari has not state. */ | 146 | /* Atari has not state. */ |
143 | struct ip32_parport_state ip32; | 147 | struct ip32_parport_state ip32; |
144 | void *misc; | 148 | void *misc; |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 6fd36cb09160..983fca251b25 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -17,8 +17,6 @@ | |||
17 | #ifndef LINUX_PCI_H | 17 | #ifndef LINUX_PCI_H |
18 | #define LINUX_PCI_H | 18 | #define LINUX_PCI_H |
19 | 19 | ||
20 | #include <linux/mod_devicetable.h> | ||
21 | |||
22 | /* Include the pci register defines */ | 20 | /* Include the pci register defines */ |
23 | #include <linux/pci_regs.h> | 21 | #include <linux/pci_regs.h> |
24 | 22 | ||
@@ -46,8 +44,9 @@ | |||
46 | 44 | ||
47 | #ifdef __KERNEL__ | 45 | #ifdef __KERNEL__ |
48 | 46 | ||
47 | #include <linux/mod_devicetable.h> | ||
48 | |||
49 | #include <linux/types.h> | 49 | #include <linux/types.h> |
50 | #include <linux/config.h> | ||
51 | #include <linux/ioport.h> | 50 | #include <linux/ioport.h> |
52 | #include <linux/list.h> | 51 | #include <linux/list.h> |
53 | #include <linux/errno.h> | 52 | #include <linux/errno.h> |
@@ -163,6 +162,9 @@ struct pci_dev { | |||
163 | unsigned int is_busmaster:1; /* device is busmaster */ | 162 | unsigned int is_busmaster:1; /* device is busmaster */ |
164 | unsigned int no_msi:1; /* device may not use msi */ | 163 | unsigned int no_msi:1; /* device may not use msi */ |
165 | unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ | 164 | unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ |
165 | unsigned int broken_parity_status:1; /* Device generates false positive parity */ | ||
166 | unsigned int msi_enabled:1; | ||
167 | unsigned int msix_enabled:1; | ||
166 | 168 | ||
167 | u32 saved_config_space[16]; /* config space saved at suspend time */ | 169 | u32 saved_config_space[16]; /* config space saved at suspend time */ |
168 | struct hlist_head saved_cap_space; | 170 | struct hlist_head saved_cap_space; |
@@ -402,8 +404,8 @@ int pcibios_enable_device(struct pci_dev *, int mask); | |||
402 | char *pcibios_setup (char *str); | 404 | char *pcibios_setup (char *str); |
403 | 405 | ||
404 | /* Used only when drivers/pci/setup.c is used */ | 406 | /* Used only when drivers/pci/setup.c is used */ |
405 | void pcibios_align_resource(void *, struct resource *, | 407 | void pcibios_align_resource(void *, struct resource *, resource_size_t, |
406 | unsigned long, unsigned long); | 408 | resource_size_t); |
407 | void pcibios_update_irq(struct pci_dev *, int irq); | 409 | void pcibios_update_irq(struct pci_dev *, int irq); |
408 | 410 | ||
409 | /* Generic PCI functions used internally */ | 411 | /* Generic PCI functions used internally */ |
@@ -497,6 +499,7 @@ int pci_set_dma_mask(struct pci_dev *dev, u64 mask); | |||
497 | int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); | 499 | int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); |
498 | void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); | 500 | void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); |
499 | int pci_assign_resource(struct pci_dev *dev, int i); | 501 | int pci_assign_resource(struct pci_dev *dev, int i); |
502 | int pci_assign_resource_fixed(struct pci_dev *dev, int i); | ||
500 | void pci_restore_bars(struct pci_dev *dev); | 503 | void pci_restore_bars(struct pci_dev *dev); |
501 | 504 | ||
502 | /* ROM control related routines */ | 505 | /* ROM control related routines */ |
@@ -529,10 +532,10 @@ void pci_release_region(struct pci_dev *, int); | |||
529 | 532 | ||
530 | /* drivers/pci/bus.c */ | 533 | /* drivers/pci/bus.c */ |
531 | int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, | 534 | int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, |
532 | unsigned long size, unsigned long align, | 535 | resource_size_t size, resource_size_t align, |
533 | unsigned long min, unsigned int type_mask, | 536 | resource_size_t min, unsigned int type_mask, |
534 | void (*alignf)(void *, struct resource *, | 537 | void (*alignf)(void *, struct resource *, |
535 | unsigned long, unsigned long), | 538 | resource_size_t, resource_size_t), |
536 | void *alignf_data); | 539 | void *alignf_data); |
537 | void pci_enable_bridges(struct pci_bus *bus); | 540 | void pci_enable_bridges(struct pci_bus *bus); |
538 | 541 | ||
@@ -727,7 +730,8 @@ static inline char *pci_name(struct pci_dev *pdev) | |||
727 | */ | 730 | */ |
728 | #ifndef HAVE_ARCH_PCI_RESOURCE_TO_USER | 731 | #ifndef HAVE_ARCH_PCI_RESOURCE_TO_USER |
729 | static inline void pci_resource_to_user(const struct pci_dev *dev, int bar, | 732 | static inline void pci_resource_to_user(const struct pci_dev *dev, int bar, |
730 | const struct resource *rsrc, u64 *start, u64 *end) | 733 | const struct resource *rsrc, resource_size_t *start, |
734 | resource_size_t *end) | ||
731 | { | 735 | { |
732 | *start = rsrc->start; | 736 | *start = rsrc->start; |
733 | *end = rsrc->end; | 737 | *end = rsrc->end; |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index bcfe9d4f56ae..685081c01342 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -352,8 +352,11 @@ | |||
352 | #define PCI_DEVICE_ID_ATI_RS480 0x5950 | 352 | #define PCI_DEVICE_ID_ATI_RS480 0x5950 |
353 | /* ATI IXP Chipset */ | 353 | /* ATI IXP Chipset */ |
354 | #define PCI_DEVICE_ID_ATI_IXP200_IDE 0x4349 | 354 | #define PCI_DEVICE_ID_ATI_IXP200_IDE 0x4349 |
355 | #define PCI_DEVICE_ID_ATI_IXP200_SMBUS 0x4353 | ||
356 | #define PCI_DEVICE_ID_ATI_IXP300_SMBUS 0x4363 | ||
355 | #define PCI_DEVICE_ID_ATI_IXP300_IDE 0x4369 | 357 | #define PCI_DEVICE_ID_ATI_IXP300_IDE 0x4369 |
356 | #define PCI_DEVICE_ID_ATI_IXP300_SATA 0x436e | 358 | #define PCI_DEVICE_ID_ATI_IXP300_SATA 0x436e |
359 | #define PCI_DEVICE_ID_ATI_IXP400_SMBUS 0x4372 | ||
357 | #define PCI_DEVICE_ID_ATI_IXP400_IDE 0x4376 | 360 | #define PCI_DEVICE_ID_ATI_IXP400_IDE 0x4376 |
358 | #define PCI_DEVICE_ID_ATI_IXP400_SATA 0x4379 | 361 | #define PCI_DEVICE_ID_ATI_IXP400_SATA 0x4379 |
359 | #define PCI_DEVICE_ID_ATI_IXP400_SATA2 0x437a | 362 | #define PCI_DEVICE_ID_ATI_IXP400_SATA2 0x437a |
@@ -725,7 +728,9 @@ | |||
725 | #define PCI_DEVICE_ID_TI_TVP4020 0x3d07 | 728 | #define PCI_DEVICE_ID_TI_TVP4020 0x3d07 |
726 | #define PCI_DEVICE_ID_TI_4450 0x8011 | 729 | #define PCI_DEVICE_ID_TI_4450 0x8011 |
727 | #define PCI_DEVICE_ID_TI_XX21_XX11 0x8031 | 730 | #define PCI_DEVICE_ID_TI_XX21_XX11 0x8031 |
731 | #define PCI_DEVICE_ID_TI_XX21_XX11_SD 0x8034 | ||
728 | #define PCI_DEVICE_ID_TI_X515 0x8036 | 732 | #define PCI_DEVICE_ID_TI_X515 0x8036 |
733 | #define PCI_DEVICE_ID_TI_XX12 0x8039 | ||
729 | #define PCI_DEVICE_ID_TI_1130 0xac12 | 734 | #define PCI_DEVICE_ID_TI_1130 0xac12 |
730 | #define PCI_DEVICE_ID_TI_1031 0xac13 | 735 | #define PCI_DEVICE_ID_TI_1031 0xac13 |
731 | #define PCI_DEVICE_ID_TI_1131 0xac15 | 736 | #define PCI_DEVICE_ID_TI_1131 0xac15 |
@@ -848,7 +853,12 @@ | |||
848 | 853 | ||
849 | 854 | ||
850 | #define PCI_VENDOR_ID_QLOGIC 0x1077 | 855 | #define PCI_VENDOR_ID_QLOGIC 0x1077 |
856 | #define PCI_DEVICE_ID_QLOGIC_ISP10160 0x1016 | ||
851 | #define PCI_DEVICE_ID_QLOGIC_ISP1020 0x1020 | 857 | #define PCI_DEVICE_ID_QLOGIC_ISP1020 0x1020 |
858 | #define PCI_DEVICE_ID_QLOGIC_ISP1080 0x1080 | ||
859 | #define PCI_DEVICE_ID_QLOGIC_ISP12160 0x1216 | ||
860 | #define PCI_DEVICE_ID_QLOGIC_ISP1240 0x1240 | ||
861 | #define PCI_DEVICE_ID_QLOGIC_ISP1280 0x1280 | ||
852 | #define PCI_DEVICE_ID_QLOGIC_ISP2100 0x2100 | 862 | #define PCI_DEVICE_ID_QLOGIC_ISP2100 0x2100 |
853 | #define PCI_DEVICE_ID_QLOGIC_ISP2200 0x2200 | 863 | #define PCI_DEVICE_ID_QLOGIC_ISP2200 0x2200 |
854 | #define PCI_DEVICE_ID_QLOGIC_ISP2300 0x2300 | 864 | #define PCI_DEVICE_ID_QLOGIC_ISP2300 0x2300 |
@@ -1018,6 +1028,7 @@ | |||
1018 | #define PCI_DEVICE_ID_NVIDIA_NVENET_8 0x0056 | 1028 | #define PCI_DEVICE_ID_NVIDIA_NVENET_8 0x0056 |
1019 | #define PCI_DEVICE_ID_NVIDIA_NVENET_9 0x0057 | 1029 | #define PCI_DEVICE_ID_NVIDIA_NVENET_9 0x0057 |
1020 | #define PCI_DEVICE_ID_NVIDIA_CK804_AUDIO 0x0059 | 1030 | #define PCI_DEVICE_ID_NVIDIA_CK804_AUDIO 0x0059 |
1031 | #define PCI_DEVICE_ID_NVIDIA_CK804_PCIE 0x005d | ||
1021 | #define PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS 0x0064 | 1032 | #define PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS 0x0064 |
1022 | #define PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE 0x0065 | 1033 | #define PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE 0x0065 |
1023 | #define PCI_DEVICE_ID_NVIDIA_NVENET_2 0x0066 | 1034 | #define PCI_DEVICE_ID_NVIDIA_NVENET_2 0x0066 |
@@ -1127,9 +1138,11 @@ | |||
1127 | #define PCI_DEVICE_ID_NVIDIA_QUADRO4_900XGL 0x0258 | 1138 | #define PCI_DEVICE_ID_NVIDIA_QUADRO4_900XGL 0x0258 |
1128 | #define PCI_DEVICE_ID_NVIDIA_QUADRO4_750XGL 0x0259 | 1139 | #define PCI_DEVICE_ID_NVIDIA_QUADRO4_750XGL 0x0259 |
1129 | #define PCI_DEVICE_ID_NVIDIA_QUADRO4_700XGL 0x025B | 1140 | #define PCI_DEVICE_ID_NVIDIA_QUADRO4_700XGL 0x025B |
1141 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SMBUS 0x0264 | ||
1130 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE 0x0265 | 1142 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE 0x0265 |
1131 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266 | 1143 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266 |
1132 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267 | 1144 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267 |
1145 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SMBUS 0x0368 | ||
1133 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE 0x036E | 1146 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE 0x036E |
1134 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA 0x037E | 1147 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA 0x037E |
1135 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2 0x037F | 1148 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2 0x037F |
@@ -1185,8 +1198,13 @@ | |||
1185 | #define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373 | 1198 | #define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373 |
1186 | #define PCI_DEVICE_ID_NVIDIA_NVENET_16 0x03E5 | 1199 | #define PCI_DEVICE_ID_NVIDIA_NVENET_16 0x03E5 |
1187 | #define PCI_DEVICE_ID_NVIDIA_NVENET_17 0x03E6 | 1200 | #define PCI_DEVICE_ID_NVIDIA_NVENET_17 0x03E6 |
1201 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA 0x03E7 | ||
1202 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_IDE 0x03EC | ||
1188 | #define PCI_DEVICE_ID_NVIDIA_NVENET_18 0x03EE | 1203 | #define PCI_DEVICE_ID_NVIDIA_NVENET_18 0x03EE |
1189 | #define PCI_DEVICE_ID_NVIDIA_NVENET_19 0x03EF | 1204 | #define PCI_DEVICE_ID_NVIDIA_NVENET_19 0x03EF |
1205 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA2 0x03F6 | ||
1206 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA3 0x03F7 | ||
1207 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP65_IDE 0x0448 | ||
1190 | #define PCI_DEVICE_ID_NVIDIA_NVENET_20 0x0450 | 1208 | #define PCI_DEVICE_ID_NVIDIA_NVENET_20 0x0450 |
1191 | #define PCI_DEVICE_ID_NVIDIA_NVENET_21 0x0451 | 1209 | #define PCI_DEVICE_ID_NVIDIA_NVENET_21 0x0451 |
1192 | #define PCI_DEVICE_ID_NVIDIA_NVENET_22 0x0452 | 1210 | #define PCI_DEVICE_ID_NVIDIA_NVENET_22 0x0452 |
@@ -1244,6 +1262,7 @@ | |||
1244 | #define PCI_DEVICE_ID_VIA_PX8X0_0 0x0259 | 1262 | #define PCI_DEVICE_ID_VIA_PX8X0_0 0x0259 |
1245 | #define PCI_DEVICE_ID_VIA_3269_0 0x0269 | 1263 | #define PCI_DEVICE_ID_VIA_3269_0 0x0269 |
1246 | #define PCI_DEVICE_ID_VIA_K8T800PRO_0 0x0282 | 1264 | #define PCI_DEVICE_ID_VIA_K8T800PRO_0 0x0282 |
1265 | #define PCI_DEVICE_ID_VIA_3296_0 0x0296 | ||
1247 | #define PCI_DEVICE_ID_VIA_8363_0 0x0305 | 1266 | #define PCI_DEVICE_ID_VIA_8363_0 0x0305 |
1248 | #define PCI_DEVICE_ID_VIA_P4M800CE 0x0314 | 1267 | #define PCI_DEVICE_ID_VIA_P4M800CE 0x0314 |
1249 | #define PCI_DEVICE_ID_VIA_8371_0 0x0391 | 1268 | #define PCI_DEVICE_ID_VIA_8371_0 0x0391 |
@@ -1251,6 +1270,7 @@ | |||
1251 | #define PCI_DEVICE_ID_VIA_82C561 0x0561 | 1270 | #define PCI_DEVICE_ID_VIA_82C561 0x0561 |
1252 | #define PCI_DEVICE_ID_VIA_82C586_1 0x0571 | 1271 | #define PCI_DEVICE_ID_VIA_82C586_1 0x0571 |
1253 | #define PCI_DEVICE_ID_VIA_82C576 0x0576 | 1272 | #define PCI_DEVICE_ID_VIA_82C576 0x0576 |
1273 | #define PCI_DEVICE_ID_VIA_SATA_EIDE 0x0581 | ||
1254 | #define PCI_DEVICE_ID_VIA_82C586_0 0x0586 | 1274 | #define PCI_DEVICE_ID_VIA_82C586_0 0x0586 |
1255 | #define PCI_DEVICE_ID_VIA_82C596 0x0596 | 1275 | #define PCI_DEVICE_ID_VIA_82C596 0x0596 |
1256 | #define PCI_DEVICE_ID_VIA_82C597_0 0x0597 | 1276 | #define PCI_DEVICE_ID_VIA_82C597_0 0x0597 |
@@ -1291,10 +1311,11 @@ | |||
1291 | #define PCI_DEVICE_ID_VIA_8783_0 0x3208 | 1311 | #define PCI_DEVICE_ID_VIA_8783_0 0x3208 |
1292 | #define PCI_DEVICE_ID_VIA_8237 0x3227 | 1312 | #define PCI_DEVICE_ID_VIA_8237 0x3227 |
1293 | #define PCI_DEVICE_ID_VIA_8251 0x3287 | 1313 | #define PCI_DEVICE_ID_VIA_8251 0x3287 |
1294 | #define PCI_DEVICE_ID_VIA_3296_0 0x0296 | 1314 | #define PCI_DEVICE_ID_VIA_8237A 0x3337 |
1295 | #define PCI_DEVICE_ID_VIA_8231 0x8231 | 1315 | #define PCI_DEVICE_ID_VIA_8231 0x8231 |
1296 | #define PCI_DEVICE_ID_VIA_8231_4 0x8235 | 1316 | #define PCI_DEVICE_ID_VIA_8231_4 0x8235 |
1297 | #define PCI_DEVICE_ID_VIA_8365_1 0x8305 | 1317 | #define PCI_DEVICE_ID_VIA_8365_1 0x8305 |
1318 | #define PCI_DEVICE_ID_VIA_CX700 0x8324 | ||
1298 | #define PCI_DEVICE_ID_VIA_8371_1 0x8391 | 1319 | #define PCI_DEVICE_ID_VIA_8371_1 0x8391 |
1299 | #define PCI_DEVICE_ID_VIA_82C598_1 0x8598 | 1320 | #define PCI_DEVICE_ID_VIA_82C598_1 0x8598 |
1300 | #define PCI_DEVICE_ID_VIA_838X_1 0xB188 | 1321 | #define PCI_DEVICE_ID_VIA_838X_1 0xB188 |
@@ -1422,6 +1443,7 @@ | |||
1422 | #define PCI_DEVICE_ID_RICOH_RL5C475 0x0475 | 1443 | #define PCI_DEVICE_ID_RICOH_RL5C475 0x0475 |
1423 | #define PCI_DEVICE_ID_RICOH_RL5C476 0x0476 | 1444 | #define PCI_DEVICE_ID_RICOH_RL5C476 0x0476 |
1424 | #define PCI_DEVICE_ID_RICOH_RL5C478 0x0478 | 1445 | #define PCI_DEVICE_ID_RICOH_RL5C478 0x0478 |
1446 | #define PCI_DEVICE_ID_RICOH_R5C822 0x0822 | ||
1425 | 1447 | ||
1426 | #define PCI_VENDOR_ID_DLINK 0x1186 | 1448 | #define PCI_VENDOR_ID_DLINK 0x1186 |
1427 | #define PCI_DEVICE_ID_DLINK_DGE510T 0x4c00 | 1449 | #define PCI_DEVICE_ID_DLINK_DGE510T 0x4c00 |
@@ -1946,6 +1968,7 @@ | |||
1946 | 1968 | ||
1947 | #define PCI_VENDOR_ID_MELLANOX 0x15b3 | 1969 | #define PCI_VENDOR_ID_MELLANOX 0x15b3 |
1948 | #define PCI_DEVICE_ID_MELLANOX_TAVOR 0x5a44 | 1970 | #define PCI_DEVICE_ID_MELLANOX_TAVOR 0x5a44 |
1971 | #define PCI_DEVICE_ID_MELLANOX_TAVOR_BRIDGE 0x5a46 | ||
1949 | #define PCI_DEVICE_ID_MELLANOX_ARBEL_COMPAT 0x6278 | 1972 | #define PCI_DEVICE_ID_MELLANOX_ARBEL_COMPAT 0x6278 |
1950 | #define PCI_DEVICE_ID_MELLANOX_ARBEL 0x6282 | 1973 | #define PCI_DEVICE_ID_MELLANOX_ARBEL 0x6282 |
1951 | #define PCI_DEVICE_ID_MELLANOX_SINAI_OLD 0x5e8c | 1974 | #define PCI_DEVICE_ID_MELLANOX_SINAI_OLD 0x5e8c |
@@ -1969,6 +1992,9 @@ | |||
1969 | #define PCI_VENDOR_ID_NETCELL 0x169c | 1992 | #define PCI_VENDOR_ID_NETCELL 0x169c |
1970 | #define PCI_DEVICE_ID_REVOLUTION 0x0044 | 1993 | #define PCI_DEVICE_ID_REVOLUTION 0x0044 |
1971 | 1994 | ||
1995 | #define PCI_VENDOR_ID_VITESSE 0x1725 | ||
1996 | #define PCI_DEVICE_ID_VITESSE_VSC7174 0x7174 | ||
1997 | |||
1972 | #define PCI_VENDOR_ID_LINKSYS 0x1737 | 1998 | #define PCI_VENDOR_ID_LINKSYS 0x1737 |
1973 | #define PCI_DEVICE_ID_LINKSYS_EG1064 0x1064 | 1999 | #define PCI_DEVICE_ID_LINKSYS_EG1064 0x1064 |
1974 | 2000 | ||
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index d27a78b71297..6bce4a240364 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
@@ -197,6 +197,7 @@ | |||
197 | #define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */ | 197 | #define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */ |
198 | #define PCI_CAP_ID_PCIX 0x07 /* PCI-X */ | 198 | #define PCI_CAP_ID_PCIX 0x07 /* PCI-X */ |
199 | #define PCI_CAP_ID_HT_IRQCONF 0x08 /* HyperTransport IRQ Configuration */ | 199 | #define PCI_CAP_ID_HT_IRQCONF 0x08 /* HyperTransport IRQ Configuration */ |
200 | #define PCI_CAP_ID_VNDR 0x09 /* Vendor specific capability */ | ||
200 | #define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */ | 201 | #define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */ |
201 | #define PCI_CAP_ID_EXP 0x10 /* PCI Express */ | 202 | #define PCI_CAP_ID_EXP 0x10 /* PCI Express */ |
202 | #define PCI_CAP_ID_MSIX 0x11 /* MSI-X */ | 203 | #define PCI_CAP_ID_MSIX 0x11 /* MSI-X */ |
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h index 682525511c9e..f5aa593ccf32 100644 --- a/include/linux/percpu_counter.h +++ b/include/linux/percpu_counter.h | |||
@@ -6,18 +6,18 @@ | |||
6 | * WARNING: these things are HUGE. 4 kbytes per counter on 32-way P4. | 6 | * WARNING: these things are HUGE. 4 kbytes per counter on 32-way P4. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <linux/config.h> | ||
10 | #include <linux/spinlock.h> | 9 | #include <linux/spinlock.h> |
11 | #include <linux/smp.h> | 10 | #include <linux/smp.h> |
12 | #include <linux/threads.h> | 11 | #include <linux/threads.h> |
13 | #include <linux/percpu.h> | 12 | #include <linux/percpu.h> |
13 | #include <linux/types.h> | ||
14 | 14 | ||
15 | #ifdef CONFIG_SMP | 15 | #ifdef CONFIG_SMP |
16 | 16 | ||
17 | struct percpu_counter { | 17 | struct percpu_counter { |
18 | spinlock_t lock; | 18 | spinlock_t lock; |
19 | long count; | 19 | s64 count; |
20 | long *counters; | 20 | s32 *counters; |
21 | }; | 21 | }; |
22 | 22 | ||
23 | #if NR_CPUS >= 16 | 23 | #if NR_CPUS >= 16 |
@@ -26,11 +26,11 @@ struct percpu_counter { | |||
26 | #define FBC_BATCH (NR_CPUS*4) | 26 | #define FBC_BATCH (NR_CPUS*4) |
27 | #endif | 27 | #endif |
28 | 28 | ||
29 | static inline void percpu_counter_init(struct percpu_counter *fbc) | 29 | static inline void percpu_counter_init(struct percpu_counter *fbc, s64 amount) |
30 | { | 30 | { |
31 | spin_lock_init(&fbc->lock); | 31 | spin_lock_init(&fbc->lock); |
32 | fbc->count = 0; | 32 | fbc->count = amount; |
33 | fbc->counters = alloc_percpu(long); | 33 | fbc->counters = alloc_percpu(s32); |
34 | } | 34 | } |
35 | 35 | ||
36 | static inline void percpu_counter_destroy(struct percpu_counter *fbc) | 36 | static inline void percpu_counter_destroy(struct percpu_counter *fbc) |
@@ -38,10 +38,10 @@ static inline void percpu_counter_destroy(struct percpu_counter *fbc) | |||
38 | free_percpu(fbc->counters); | 38 | free_percpu(fbc->counters); |
39 | } | 39 | } |
40 | 40 | ||
41 | void percpu_counter_mod(struct percpu_counter *fbc, long amount); | 41 | void percpu_counter_mod(struct percpu_counter *fbc, s32 amount); |
42 | long percpu_counter_sum(struct percpu_counter *fbc); | 42 | s64 percpu_counter_sum(struct percpu_counter *fbc); |
43 | 43 | ||
44 | static inline long percpu_counter_read(struct percpu_counter *fbc) | 44 | static inline s64 percpu_counter_read(struct percpu_counter *fbc) |
45 | { | 45 | { |
46 | return fbc->count; | 46 | return fbc->count; |
47 | } | 47 | } |
@@ -49,13 +49,14 @@ static inline long percpu_counter_read(struct percpu_counter *fbc) | |||
49 | /* | 49 | /* |
50 | * It is possible for the percpu_counter_read() to return a small negative | 50 | * It is possible for the percpu_counter_read() to return a small negative |
51 | * number for some counter which should never be negative. | 51 | * number for some counter which should never be negative. |
52 | * | ||
52 | */ | 53 | */ |
53 | static inline long percpu_counter_read_positive(struct percpu_counter *fbc) | 54 | static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc) |
54 | { | 55 | { |
55 | long ret = fbc->count; | 56 | s64 ret = fbc->count; |
56 | 57 | ||
57 | barrier(); /* Prevent reloads of fbc->count */ | 58 | barrier(); /* Prevent reloads of fbc->count */ |
58 | if (ret > 0) | 59 | if (ret >= 0) |
59 | return ret; | 60 | return ret; |
60 | return 1; | 61 | return 1; |
61 | } | 62 | } |
@@ -63,12 +64,12 @@ static inline long percpu_counter_read_positive(struct percpu_counter *fbc) | |||
63 | #else | 64 | #else |
64 | 65 | ||
65 | struct percpu_counter { | 66 | struct percpu_counter { |
66 | long count; | 67 | s64 count; |
67 | }; | 68 | }; |
68 | 69 | ||
69 | static inline void percpu_counter_init(struct percpu_counter *fbc) | 70 | static inline void percpu_counter_init(struct percpu_counter *fbc, s64 amount) |
70 | { | 71 | { |
71 | fbc->count = 0; | 72 | fbc->count = amount; |
72 | } | 73 | } |
73 | 74 | ||
74 | static inline void percpu_counter_destroy(struct percpu_counter *fbc) | 75 | static inline void percpu_counter_destroy(struct percpu_counter *fbc) |
@@ -76,24 +77,24 @@ static inline void percpu_counter_destroy(struct percpu_counter *fbc) | |||
76 | } | 77 | } |
77 | 78 | ||
78 | static inline void | 79 | static inline void |
79 | percpu_counter_mod(struct percpu_counter *fbc, long amount) | 80 | percpu_counter_mod(struct percpu_counter *fbc, s32 amount) |
80 | { | 81 | { |
81 | preempt_disable(); | 82 | preempt_disable(); |
82 | fbc->count += amount; | 83 | fbc->count += amount; |
83 | preempt_enable(); | 84 | preempt_enable(); |
84 | } | 85 | } |
85 | 86 | ||
86 | static inline long percpu_counter_read(struct percpu_counter *fbc) | 87 | static inline s64 percpu_counter_read(struct percpu_counter *fbc) |
87 | { | 88 | { |
88 | return fbc->count; | 89 | return fbc->count; |
89 | } | 90 | } |
90 | 91 | ||
91 | static inline long percpu_counter_read_positive(struct percpu_counter *fbc) | 92 | static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc) |
92 | { | 93 | { |
93 | return fbc->count; | 94 | return fbc->count; |
94 | } | 95 | } |
95 | 96 | ||
96 | static inline long percpu_counter_sum(struct percpu_counter *fbc) | 97 | static inline s64 percpu_counter_sum(struct percpu_counter *fbc) |
97 | { | 98 | { |
98 | return percpu_counter_read_positive(fbc); | 99 | return percpu_counter_read_positive(fbc); |
99 | } | 100 | } |
diff --git a/include/linux/plist.h b/include/linux/plist.h new file mode 100644 index 000000000000..b95818a037ad --- /dev/null +++ b/include/linux/plist.h | |||
@@ -0,0 +1,248 @@ | |||
1 | /* | ||
2 | * Descending-priority-sorted double-linked list | ||
3 | * | ||
4 | * (C) 2002-2003 Intel Corp | ||
5 | * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>. | ||
6 | * | ||
7 | * 2001-2005 (c) MontaVista Software, Inc. | ||
8 | * Daniel Walker <dwalker@mvista.com> | ||
9 | * | ||
10 | * (C) 2005 Thomas Gleixner <tglx@linutronix.de> | ||
11 | * | ||
12 | * Simplifications of the original code by | ||
13 | * Oleg Nesterov <oleg@tv-sign.ru> | ||
14 | * | ||
15 | * Licensed under the FSF's GNU Public License v2 or later. | ||
16 | * | ||
17 | * Based on simple lists (include/linux/list.h). | ||
18 | * | ||
19 | * This is a priority-sorted list of nodes; each node has a | ||
20 | * priority from INT_MIN (highest) to INT_MAX (lowest). | ||
21 | * | ||
22 | * Addition is O(K), removal is O(1), change of priority of a node is | ||
23 | * O(K) and K is the number of RT priority levels used in the system. | ||
24 | * (1 <= K <= 99) | ||
25 | * | ||
26 | * This list is really a list of lists: | ||
27 | * | ||
28 | * - The tier 1 list is the prio_list, different priority nodes. | ||
29 | * | ||
30 | * - The tier 2 list is the node_list, serialized nodes. | ||
31 | * | ||
32 | * Simple ASCII art explanation: | ||
33 | * | ||
34 | * |HEAD | | ||
35 | * | | | ||
36 | * |prio_list.prev|<------------------------------------| | ||
37 | * |prio_list.next|<->|pl|<->|pl|<--------------->|pl|<-| | ||
38 | * |10 | |10| |21| |21| |21| |40| (prio) | ||
39 | * | | | | | | | | | | | | | ||
40 | * | | | | | | | | | | | | | ||
41 | * |node_list.next|<->|nl|<->|nl|<->|nl|<->|nl|<->|nl|<-| | ||
42 | * |node_list.prev|<------------------------------------| | ||
43 | * | ||
44 | * The nodes on the prio_list list are sorted by priority to simplify | ||
45 | * the insertion of new nodes. There are no nodes with duplicate | ||
46 | * priorites on the list. | ||
47 | * | ||
48 | * The nodes on the node_list is ordered by priority and can contain | ||
49 | * entries which have the same priority. Those entries are ordered | ||
50 | * FIFO | ||
51 | * | ||
52 | * Addition means: look for the prio_list node in the prio_list | ||
53 | * for the priority of the node and insert it before the node_list | ||
54 | * entry of the next prio_list node. If it is the first node of | ||
55 | * that priority, add it to the prio_list in the right position and | ||
56 | * insert it into the serialized node_list list | ||
57 | * | ||
58 | * Removal means remove it from the node_list and remove it from | ||
59 | * the prio_list if the node_list list_head is non empty. In case | ||
60 | * of removal from the prio_list it must be checked whether other | ||
61 | * entries of the same priority are on the list or not. If there | ||
62 | * is another entry of the same priority then this entry has to | ||
63 | * replace the removed entry on the prio_list. If the entry which | ||
64 | * is removed is the only entry of this priority then a simple | ||
65 | * remove from both list is sufficient. | ||
66 | * | ||
67 | * INT_MIN is the highest priority, 0 is the medium highest, INT_MAX | ||
68 | * is lowest priority. | ||
69 | * | ||
70 | * No locking is done, up to the caller. | ||
71 | * | ||
72 | */ | ||
73 | #ifndef _LINUX_PLIST_H_ | ||
74 | #define _LINUX_PLIST_H_ | ||
75 | |||
76 | #include <linux/kernel.h> | ||
77 | #include <linux/list.h> | ||
78 | #include <linux/spinlock_types.h> | ||
79 | |||
80 | struct plist_head { | ||
81 | struct list_head prio_list; | ||
82 | struct list_head node_list; | ||
83 | #ifdef CONFIG_DEBUG_PI_LIST | ||
84 | spinlock_t *lock; | ||
85 | #endif | ||
86 | }; | ||
87 | |||
88 | struct plist_node { | ||
89 | int prio; | ||
90 | struct plist_head plist; | ||
91 | }; | ||
92 | |||
93 | #ifdef CONFIG_DEBUG_PI_LIST | ||
94 | # define PLIST_HEAD_LOCK_INIT(_lock) .lock = _lock | ||
95 | #else | ||
96 | # define PLIST_HEAD_LOCK_INIT(_lock) | ||
97 | #endif | ||
98 | |||
99 | /** | ||
100 | * #PLIST_HEAD_INIT - static struct plist_head initializer | ||
101 | * | ||
102 | * @head: struct plist_head variable name | ||
103 | */ | ||
104 | #define PLIST_HEAD_INIT(head, _lock) \ | ||
105 | { \ | ||
106 | .prio_list = LIST_HEAD_INIT((head).prio_list), \ | ||
107 | .node_list = LIST_HEAD_INIT((head).node_list), \ | ||
108 | PLIST_HEAD_LOCK_INIT(&(_lock)) \ | ||
109 | } | ||
110 | |||
111 | /** | ||
112 | * #PLIST_NODE_INIT - static struct plist_node initializer | ||
113 | * | ||
114 | * @node: struct plist_node variable name | ||
115 | * @__prio: initial node priority | ||
116 | */ | ||
117 | #define PLIST_NODE_INIT(node, __prio) \ | ||
118 | { \ | ||
119 | .prio = (__prio), \ | ||
120 | .plist = PLIST_HEAD_INIT((node).plist, NULL), \ | ||
121 | } | ||
122 | |||
123 | /** | ||
124 | * plist_head_init - dynamic struct plist_head initializer | ||
125 | * | ||
126 | * @head: &struct plist_head pointer | ||
127 | */ | ||
128 | static inline void | ||
129 | plist_head_init(struct plist_head *head, spinlock_t *lock) | ||
130 | { | ||
131 | INIT_LIST_HEAD(&head->prio_list); | ||
132 | INIT_LIST_HEAD(&head->node_list); | ||
133 | #ifdef CONFIG_DEBUG_PI_LIST | ||
134 | head->lock = lock; | ||
135 | #endif | ||
136 | } | ||
137 | |||
138 | /** | ||
139 | * plist_node_init - Dynamic struct plist_node initializer | ||
140 | * | ||
141 | * @node: &struct plist_node pointer | ||
142 | * @prio: initial node priority | ||
143 | */ | ||
144 | static inline void plist_node_init(struct plist_node *node, int prio) | ||
145 | { | ||
146 | node->prio = prio; | ||
147 | plist_head_init(&node->plist, NULL); | ||
148 | } | ||
149 | |||
150 | extern void plist_add(struct plist_node *node, struct plist_head *head); | ||
151 | extern void plist_del(struct plist_node *node, struct plist_head *head); | ||
152 | |||
153 | /** | ||
154 | * plist_for_each - iterate over the plist | ||
155 | * | ||
156 | * @pos1: the type * to use as a loop counter. | ||
157 | * @head: the head for your list. | ||
158 | */ | ||
159 | #define plist_for_each(pos, head) \ | ||
160 | list_for_each_entry(pos, &(head)->node_list, plist.node_list) | ||
161 | |||
162 | /** | ||
163 | * plist_for_each_entry_safe - iterate over a plist of given type safe | ||
164 | * against removal of list entry | ||
165 | * | ||
166 | * @pos1: the type * to use as a loop counter. | ||
167 | * @n1: another type * to use as temporary storage | ||
168 | * @head: the head for your list. | ||
169 | */ | ||
170 | #define plist_for_each_safe(pos, n, head) \ | ||
171 | list_for_each_entry_safe(pos, n, &(head)->node_list, plist.node_list) | ||
172 | |||
173 | /** | ||
174 | * plist_for_each_entry - iterate over list of given type | ||
175 | * | ||
176 | * @pos: the type * to use as a loop counter. | ||
177 | * @head: the head for your list. | ||
178 | * @member: the name of the list_struct within the struct. | ||
179 | */ | ||
180 | #define plist_for_each_entry(pos, head, mem) \ | ||
181 | list_for_each_entry(pos, &(head)->node_list, mem.plist.node_list) | ||
182 | |||
183 | /** | ||
184 | * plist_for_each_entry_safe - iterate over list of given type safe against | ||
185 | * removal of list entry | ||
186 | * | ||
187 | * @pos: the type * to use as a loop counter. | ||
188 | * @n: another type * to use as temporary storage | ||
189 | * @head: the head for your list. | ||
190 | * @m: the name of the list_struct within the struct. | ||
191 | */ | ||
192 | #define plist_for_each_entry_safe(pos, n, head, m) \ | ||
193 | list_for_each_entry_safe(pos, n, &(head)->node_list, m.plist.node_list) | ||
194 | |||
195 | /** | ||
196 | * plist_head_empty - return !0 if a plist_head is empty | ||
197 | * | ||
198 | * @head: &struct plist_head pointer | ||
199 | */ | ||
200 | static inline int plist_head_empty(const struct plist_head *head) | ||
201 | { | ||
202 | return list_empty(&head->node_list); | ||
203 | } | ||
204 | |||
205 | /** | ||
206 | * plist_node_empty - return !0 if plist_node is not on a list | ||
207 | * | ||
208 | * @node: &struct plist_node pointer | ||
209 | */ | ||
210 | static inline int plist_node_empty(const struct plist_node *node) | ||
211 | { | ||
212 | return plist_head_empty(&node->plist); | ||
213 | } | ||
214 | |||
215 | /* All functions below assume the plist_head is not empty. */ | ||
216 | |||
217 | /** | ||
218 | * plist_first_entry - get the struct for the first entry | ||
219 | * | ||
220 | * @ptr: the &struct plist_head pointer. | ||
221 | * @type: the type of the struct this is embedded in. | ||
222 | * @member: the name of the list_struct within the struct. | ||
223 | */ | ||
224 | #ifdef CONFIG_DEBUG_PI_LIST | ||
225 | # define plist_first_entry(head, type, member) \ | ||
226 | ({ \ | ||
227 | WARN_ON(plist_head_empty(head)); \ | ||
228 | container_of(plist_first(head), type, member); \ | ||
229 | }) | ||
230 | #else | ||
231 | # define plist_first_entry(head, type, member) \ | ||
232 | container_of(plist_first(head), type, member) | ||
233 | #endif | ||
234 | |||
235 | /** | ||
236 | * plist_first - return the first node (and thus, highest priority) | ||
237 | * | ||
238 | * @head: the &struct plist_head pointer | ||
239 | * | ||
240 | * Assumes the plist is _not_ empty. | ||
241 | */ | ||
242 | static inline struct plist_node* plist_first(const struct plist_head *head) | ||
243 | { | ||
244 | return list_entry(head->node_list.next, | ||
245 | struct plist_node, plist.node_list); | ||
246 | } | ||
247 | |||
248 | #endif | ||
diff --git a/include/linux/pm.h b/include/linux/pm.h index 66be58902b17..658c1b93d5bb 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -23,7 +23,6 @@ | |||
23 | 23 | ||
24 | #ifdef __KERNEL__ | 24 | #ifdef __KERNEL__ |
25 | 25 | ||
26 | #include <linux/config.h> | ||
27 | #include <linux/list.h> | 26 | #include <linux/list.h> |
28 | #include <asm/atomic.h> | 27 | #include <asm/atomic.h> |
29 | 28 | ||
diff --git a/include/linux/pm_legacy.h b/include/linux/pm_legacy.h index 008932d73c35..78027c533b94 100644 --- a/include/linux/pm_legacy.h +++ b/include/linux/pm_legacy.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef __LINUX_PM_LEGACY_H__ | 1 | #ifndef __LINUX_PM_LEGACY_H__ |
2 | #define __LINUX_PM_LEGACY_H__ | 2 | #define __LINUX_PM_LEGACY_H__ |
3 | 3 | ||
4 | #include <linux/config.h> | ||
5 | 4 | ||
6 | #ifdef CONFIG_PM_LEGACY | 5 | #ifdef CONFIG_PM_LEGACY |
7 | 6 | ||
diff --git a/include/linux/pmu.h b/include/linux/pmu.h index 217d3daf7336..2ed807ddc08c 100644 --- a/include/linux/pmu.h +++ b/include/linux/pmu.h | |||
@@ -6,7 +6,6 @@ | |||
6 | * Copyright (C) 1998 Paul Mackerras. | 6 | * Copyright (C) 1998 Paul Mackerras. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <linux/config.h> | ||
10 | 9 | ||
11 | #define PMU_DRIVER_VERSION 2 | 10 | #define PMU_DRIVER_VERSION 2 |
12 | 11 | ||
@@ -231,4 +230,8 @@ extern int pmu_battery_count; | |||
231 | extern struct pmu_battery_info pmu_batteries[PMU_MAX_BATTERIES]; | 230 | extern struct pmu_battery_info pmu_batteries[PMU_MAX_BATTERIES]; |
232 | extern unsigned int pmu_power_flags; | 231 | extern unsigned int pmu_power_flags; |
233 | 232 | ||
233 | /* Backlight */ | ||
234 | extern int disable_kernel_backlight; | ||
235 | extern void pmu_backlight_init(struct device_node*); | ||
236 | |||
234 | #endif /* __KERNEL__ */ | 237 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/pnp.h b/include/linux/pnp.h index 93b0959eb40f..ab8a8dd8d64c 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h | |||
@@ -389,7 +389,8 @@ int pnp_start_dev(struct pnp_dev *dev); | |||
389 | int pnp_stop_dev(struct pnp_dev *dev); | 389 | int pnp_stop_dev(struct pnp_dev *dev); |
390 | int pnp_activate_dev(struct pnp_dev *dev); | 390 | int pnp_activate_dev(struct pnp_dev *dev); |
391 | int pnp_disable_dev(struct pnp_dev *dev); | 391 | int pnp_disable_dev(struct pnp_dev *dev); |
392 | void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size); | 392 | void pnp_resource_change(struct resource *resource, resource_size_t start, |
393 | resource_size_t size); | ||
393 | 394 | ||
394 | /* protocol helpers */ | 395 | /* protocol helpers */ |
395 | int pnp_is_active(struct pnp_dev * dev); | 396 | int pnp_is_active(struct pnp_dev * dev); |
@@ -434,7 +435,9 @@ static inline int pnp_start_dev(struct pnp_dev *dev) { return -ENODEV; } | |||
434 | static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; } | 435 | static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; } |
435 | static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; } | 436 | static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; } |
436 | static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; } | 437 | static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; } |
437 | static inline void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size) { } | 438 | static inline void pnp_resource_change(struct resource *resource, |
439 | resource_size_t start, | ||
440 | resource_size_t size) { } | ||
438 | 441 | ||
439 | /* protocol helpers */ | 442 | /* protocol helpers */ |
440 | static inline int pnp_is_active(struct pnp_dev * dev) { return 0; } | 443 | static inline int pnp_is_active(struct pnp_dev * dev) { return 0; } |
diff --git a/include/linux/poison.h b/include/linux/poison.h new file mode 100644 index 000000000000..a5347c02432e --- /dev/null +++ b/include/linux/poison.h | |||
@@ -0,0 +1,58 @@ | |||
1 | #ifndef _LINUX_POISON_H | ||
2 | #define _LINUX_POISON_H | ||
3 | |||
4 | /********** include/linux/list.h **********/ | ||
5 | /* | ||
6 | * These are non-NULL pointers that will result in page faults | ||
7 | * under normal circumstances, used to verify that nobody uses | ||
8 | * non-initialized list entries. | ||
9 | */ | ||
10 | #define LIST_POISON1 ((void *) 0x00100100) | ||
11 | #define LIST_POISON2 ((void *) 0x00200200) | ||
12 | |||
13 | /********** mm/slab.c **********/ | ||
14 | /* | ||
15 | * Magic nums for obj red zoning. | ||
16 | * Placed in the first word before and the first word after an obj. | ||
17 | */ | ||
18 | #define RED_INACTIVE 0x5A2CF071UL /* when obj is inactive */ | ||
19 | #define RED_ACTIVE 0x170FC2A5UL /* when obj is active */ | ||
20 | |||
21 | /* ...and for poisoning */ | ||
22 | #define POISON_INUSE 0x5a /* for use-uninitialised poisoning */ | ||
23 | #define POISON_FREE 0x6b /* for use-after-free poisoning */ | ||
24 | #define POISON_END 0xa5 /* end-byte of poisoning */ | ||
25 | |||
26 | /********** arch/$ARCH/mm/init.c **********/ | ||
27 | #define POISON_FREE_INITMEM 0xcc | ||
28 | |||
29 | /********** arch/x86_64/mm/init.c **********/ | ||
30 | #define POISON_FREE_INITDATA 0xba | ||
31 | |||
32 | /********** arch/ia64/hp/common/sba_iommu.c **********/ | ||
33 | /* | ||
34 | * arch/ia64/hp/common/sba_iommu.c uses a 16-byte poison string with a | ||
35 | * value of "SBAIOMMU POISON\0" for spill-over poisoning. | ||
36 | */ | ||
37 | |||
38 | /********** fs/jbd/journal.c **********/ | ||
39 | #define JBD_POISON_FREE 0x5b | ||
40 | |||
41 | /********** drivers/base/dmapool.c **********/ | ||
42 | #define POOL_POISON_FREED 0xa7 /* !inuse */ | ||
43 | #define POOL_POISON_ALLOCATED 0xa9 /* !initted */ | ||
44 | |||
45 | /********** drivers/atm/ **********/ | ||
46 | #define ATM_POISON_FREE 0x12 | ||
47 | |||
48 | /********** kernel/mutexes **********/ | ||
49 | #define MUTEX_DEBUG_INIT 0x11 | ||
50 | #define MUTEX_DEBUG_FREE 0x22 | ||
51 | |||
52 | /********** security/ **********/ | ||
53 | #define KEY_DESTROY 0xbd | ||
54 | |||
55 | /********** sound/oss/ **********/ | ||
56 | #define OSS_POISON_FREE 0xAB | ||
57 | |||
58 | #endif | ||
diff --git a/include/linux/ppp_defs.h b/include/linux/ppp_defs.h index 402056cd049d..c6b13ff85028 100644 --- a/include/linux/ppp_defs.h +++ b/include/linux/ppp_defs.h | |||
@@ -42,8 +42,6 @@ | |||
42 | #ifndef _PPP_DEFS_H_ | 42 | #ifndef _PPP_DEFS_H_ |
43 | #define _PPP_DEFS_H_ | 43 | #define _PPP_DEFS_H_ |
44 | 44 | ||
45 | #include <linux/crc-ccitt.h> | ||
46 | |||
47 | /* | 45 | /* |
48 | * The basic PPP frame. | 46 | * The basic PPP frame. |
49 | */ | 47 | */ |
@@ -97,7 +95,11 @@ | |||
97 | 95 | ||
98 | #define PPP_INITFCS 0xffff /* Initial FCS value */ | 96 | #define PPP_INITFCS 0xffff /* Initial FCS value */ |
99 | #define PPP_GOODFCS 0xf0b8 /* Good final FCS value */ | 97 | #define PPP_GOODFCS 0xf0b8 /* Good final FCS value */ |
98 | |||
99 | #ifdef __KERNEL__ | ||
100 | #include <linux/crc-ccitt.h> | ||
100 | #define PPP_FCS(fcs, c) crc_ccitt_byte(fcs, c) | 101 | #define PPP_FCS(fcs, c) crc_ccitt_byte(fcs, c) |
102 | #endif | ||
101 | 103 | ||
102 | /* | 104 | /* |
103 | * Extended asyncmap - allows any character to be escaped. | 105 | * Extended asyncmap - allows any character to be escaped. |
@@ -179,12 +181,4 @@ struct ppp_idle { | |||
179 | time_t recv_idle; /* time since last NP packet received */ | 181 | time_t recv_idle; /* time since last NP packet received */ |
180 | }; | 182 | }; |
181 | 183 | ||
182 | #ifndef __P | ||
183 | #ifdef __STDC__ | ||
184 | #define __P(x) x | ||
185 | #else | ||
186 | #define __P(x) () | ||
187 | #endif | ||
188 | #endif | ||
189 | |||
190 | #endif /* _PPP_DEFS_H_ */ | 184 | #endif /* _PPP_DEFS_H_ */ |
diff --git a/include/linux/prctl.h b/include/linux/prctl.h index bf022c43a18e..52a9be41250d 100644 --- a/include/linux/prctl.h +++ b/include/linux/prctl.h | |||
@@ -52,4 +52,11 @@ | |||
52 | #define PR_SET_NAME 15 /* Set process name */ | 52 | #define PR_SET_NAME 15 /* Set process name */ |
53 | #define PR_GET_NAME 16 /* Get process name */ | 53 | #define PR_GET_NAME 16 /* Get process name */ |
54 | 54 | ||
55 | /* Get/set process endian */ | ||
56 | #define PR_GET_ENDIAN 19 | ||
57 | #define PR_SET_ENDIAN 20 | ||
58 | # define PR_ENDIAN_BIG 0 | ||
59 | # define PR_ENDIAN_LITTLE 1 /* True little endian mode */ | ||
60 | # define PR_ENDIAN_PPC_LITTLE 2 /* "PowerPC" pseudo little endian */ | ||
61 | |||
55 | #endif /* _LINUX_PRCTL_H */ | 62 | #endif /* _LINUX_PRCTL_H */ |
diff --git a/include/linux/preempt.h b/include/linux/preempt.h index 5769d14d1e6a..d0926d63406c 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h | |||
@@ -6,7 +6,6 @@ | |||
6 | * preempt_count (used for kernel preemption, interrupt count, etc.) | 6 | * preempt_count (used for kernel preemption, interrupt count, etc.) |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <linux/config.h> | ||
10 | #include <linux/thread_info.h> | 9 | #include <linux/thread_info.h> |
11 | #include <linux/linkage.h> | 10 | #include <linux/linkage.h> |
12 | 11 | ||
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 4b47a0253425..17e75783e3a5 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _LINUX_PROC_FS_H | 1 | #ifndef _LINUX_PROC_FS_H |
2 | #define _LINUX_PROC_FS_H | 2 | #define _LINUX_PROC_FS_H |
3 | 3 | ||
4 | #include <linux/config.h> | ||
5 | #include <linux/slab.h> | 4 | #include <linux/slab.h> |
6 | #include <linux/fs.h> | 5 | #include <linux/fs.h> |
7 | #include <linux/spinlock.h> | 6 | #include <linux/spinlock.h> |
@@ -100,9 +99,8 @@ extern void proc_misc_init(void); | |||
100 | 99 | ||
101 | struct mm_struct; | 100 | struct mm_struct; |
102 | 101 | ||
102 | void proc_flush_task(struct task_struct *task); | ||
103 | struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *); | 103 | struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *); |
104 | struct dentry *proc_pid_unhash(struct task_struct *p); | ||
105 | void proc_pid_flush(struct dentry *proc_dentry); | ||
106 | int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir); | 104 | int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir); |
107 | unsigned long task_vsize(struct mm_struct *); | 105 | unsigned long task_vsize(struct mm_struct *); |
108 | int task_statm(struct mm_struct *, int *, int *, int *, int *); | 106 | int task_statm(struct mm_struct *, int *, int *, int *, int *); |
@@ -212,8 +210,7 @@ static inline void proc_net_remove(const char *name) | |||
212 | #define proc_net_create(name, mode, info) ({ (void)(mode), NULL; }) | 210 | #define proc_net_create(name, mode, info) ({ (void)(mode), NULL; }) |
213 | static inline void proc_net_remove(const char *name) {} | 211 | static inline void proc_net_remove(const char *name) {} |
214 | 212 | ||
215 | static inline struct dentry *proc_pid_unhash(struct task_struct *p) { return NULL; } | 213 | static inline void proc_flush_task(struct task_struct *task) { } |
216 | static inline void proc_pid_flush(struct dentry *proc_dentry) { } | ||
217 | 214 | ||
218 | static inline struct proc_dir_entry *create_proc_entry(const char *name, | 215 | static inline struct proc_dir_entry *create_proc_entry(const char *name, |
219 | mode_t mode, struct proc_dir_entry *parent) { return NULL; } | 216 | mode_t mode, struct proc_dir_entry *parent) { return NULL; } |
@@ -249,8 +246,8 @@ extern void kclist_add(struct kcore_list *, void *, size_t); | |||
249 | #endif | 246 | #endif |
250 | 247 | ||
251 | struct proc_inode { | 248 | struct proc_inode { |
252 | struct task_struct *task; | 249 | struct pid *pid; |
253 | int type; | 250 | int fd; |
254 | union { | 251 | union { |
255 | int (*proc_get_link)(struct inode *, struct dentry **, struct vfsmount **); | 252 | int (*proc_get_link)(struct inode *, struct dentry **, struct vfsmount **); |
256 | int (*proc_read)(struct task_struct *task, char *page); | 253 | int (*proc_read)(struct task_struct *task, char *page); |
@@ -269,4 +266,10 @@ static inline struct proc_dir_entry *PDE(const struct inode *inode) | |||
269 | return PROC_I(inode)->pde; | 266 | return PROC_I(inode)->pde; |
270 | } | 267 | } |
271 | 268 | ||
269 | struct proc_maps_private { | ||
270 | struct pid *pid; | ||
271 | struct task_struct *task; | ||
272 | struct vm_area_struct *tail_vma; | ||
273 | }; | ||
274 | |||
272 | #endif /* _LINUX_PROC_FS_H */ | 275 | #endif /* _LINUX_PROC_FS_H */ |
diff --git a/include/linux/profile.h b/include/linux/profile.h index 1f2fea6640a4..e633004ae052 100644 --- a/include/linux/profile.h +++ b/include/linux/profile.h | |||
@@ -4,7 +4,6 @@ | |||
4 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
5 | 5 | ||
6 | #include <linux/kernel.h> | 6 | #include <linux/kernel.h> |
7 | #include <linux/config.h> | ||
8 | #include <linux/init.h> | 7 | #include <linux/init.h> |
9 | #include <linux/cpumask.h> | 8 | #include <linux/cpumask.h> |
10 | #include <asm/errno.h> | 9 | #include <asm/errno.h> |
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 0d36750fc0f1..8b2749a259dc 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
@@ -51,6 +51,10 @@ | |||
51 | #ifdef __KERNEL__ | 51 | #ifdef __KERNEL__ |
52 | /* | 52 | /* |
53 | * Ptrace flags | 53 | * Ptrace flags |
54 | * | ||
55 | * The owner ship rules for task->ptrace which holds the ptrace | ||
56 | * flags is simple. When a task is running it owns it's task->ptrace | ||
57 | * flags. When the a task is stopped the ptracer owns task->ptrace. | ||
54 | */ | 58 | */ |
55 | 59 | ||
56 | #define PT_PTRACED 0x00000001 | 60 | #define PT_PTRACED 0x00000001 |
@@ -84,7 +88,6 @@ extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __us | |||
84 | extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len); | 88 | extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len); |
85 | extern int ptrace_attach(struct task_struct *tsk); | 89 | extern int ptrace_attach(struct task_struct *tsk); |
86 | extern int ptrace_detach(struct task_struct *, unsigned int); | 90 | extern int ptrace_detach(struct task_struct *, unsigned int); |
87 | extern void __ptrace_detach(struct task_struct *, unsigned int); | ||
88 | extern void ptrace_disable(struct task_struct *); | 91 | extern void ptrace_disable(struct task_struct *); |
89 | extern int ptrace_check_attach(struct task_struct *task, int kill); | 92 | extern int ptrace_check_attach(struct task_struct *task, int kill); |
90 | extern int ptrace_request(struct task_struct *child, long request, long addr, long data); | 93 | extern int ptrace_request(struct task_struct *child, long request, long addr, long data); |
diff --git a/include/linux/quota.h b/include/linux/quota.h index 2dab71e1c3d1..b8fbf26eb885 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
@@ -37,8 +37,6 @@ | |||
37 | 37 | ||
38 | #include <linux/errno.h> | 38 | #include <linux/errno.h> |
39 | #include <linux/types.h> | 39 | #include <linux/types.h> |
40 | #include <linux/spinlock.h> | ||
41 | #include <linux/mutex.h> | ||
42 | 40 | ||
43 | #define __DQUOT_VERSION__ "dquot_6.5.1" | 41 | #define __DQUOT_VERSION__ "dquot_6.5.1" |
44 | #define __DQUOT_NUM_VERSION__ 6*10000+5*100+1 | 42 | #define __DQUOT_NUM_VERSION__ 6*10000+5*100+1 |
@@ -133,6 +131,8 @@ struct if_dqinfo { | |||
133 | }; | 131 | }; |
134 | 132 | ||
135 | #ifdef __KERNEL__ | 133 | #ifdef __KERNEL__ |
134 | #include <linux/spinlock.h> | ||
135 | #include <linux/mutex.h> | ||
136 | 136 | ||
137 | #include <linux/dqblk_xfs.h> | 137 | #include <linux/dqblk_xfs.h> |
138 | #include <linux/dqblk_v1.h> | 138 | #include <linux/dqblk_v1.h> |
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index 21e5a9124856..5110201a4159 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h | |||
@@ -10,7 +10,6 @@ | |||
10 | #ifndef _LINUX_QUOTAOPS_ | 10 | #ifndef _LINUX_QUOTAOPS_ |
11 | #define _LINUX_QUOTAOPS_ | 11 | #define _LINUX_QUOTAOPS_ |
12 | 12 | ||
13 | #include <linux/config.h> | ||
14 | #include <linux/smp_lock.h> | 13 | #include <linux/smp_lock.h> |
15 | 14 | ||
16 | #include <linux/fs.h> | 15 | #include <linux/fs.h> |
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index dd83cca28001..9158a68140c9 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h | |||
@@ -23,6 +23,9 @@ | |||
23 | #include <linux/preempt.h> | 23 | #include <linux/preempt.h> |
24 | #include <linux/types.h> | 24 | #include <linux/types.h> |
25 | 25 | ||
26 | #define RADIX_TREE_MAX_TAGS 2 | ||
27 | |||
28 | /* root tags are stored in gfp_mask, shifted by __GFP_BITS_SHIFT */ | ||
26 | struct radix_tree_root { | 29 | struct radix_tree_root { |
27 | unsigned int height; | 30 | unsigned int height; |
28 | gfp_t gfp_mask; | 31 | gfp_t gfp_mask; |
@@ -45,8 +48,6 @@ do { \ | |||
45 | (root)->rnode = NULL; \ | 48 | (root)->rnode = NULL; \ |
46 | } while (0) | 49 | } while (0) |
47 | 50 | ||
48 | #define RADIX_TREE_MAX_TAGS 2 | ||
49 | |||
50 | int radix_tree_insert(struct radix_tree_root *, unsigned long, void *); | 51 | int radix_tree_insert(struct radix_tree_root *, unsigned long, void *); |
51 | void *radix_tree_lookup(struct radix_tree_root *, unsigned long); | 52 | void *radix_tree_lookup(struct radix_tree_root *, unsigned long); |
52 | void **radix_tree_lookup_slot(struct radix_tree_root *, unsigned long); | 53 | void **radix_tree_lookup_slot(struct radix_tree_root *, unsigned long); |
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h index 899437802aea..63df898fe2e9 100644 --- a/include/linux/raid/bitmap.h +++ b/include/linux/raid/bitmap.h | |||
@@ -140,6 +140,7 @@ typedef __u16 bitmap_counter_t; | |||
140 | enum bitmap_state { | 140 | enum bitmap_state { |
141 | BITMAP_ACTIVE = 0x001, /* the bitmap is in use */ | 141 | BITMAP_ACTIVE = 0x001, /* the bitmap is in use */ |
142 | BITMAP_STALE = 0x002, /* the bitmap file is out of date or had -EIO */ | 142 | BITMAP_STALE = 0x002, /* the bitmap file is out of date or had -EIO */ |
143 | BITMAP_WRITE_ERROR = 0x004, /* A write error has occurred */ | ||
143 | BITMAP_HOSTENDIAN = 0x8000, | 144 | BITMAP_HOSTENDIAN = 0x8000, |
144 | }; | 145 | }; |
145 | 146 | ||
@@ -244,15 +245,9 @@ struct bitmap { | |||
244 | unsigned long daemon_lastrun; /* jiffies of last run */ | 245 | unsigned long daemon_lastrun; /* jiffies of last run */ |
245 | unsigned long daemon_sleep; /* how many seconds between updates? */ | 246 | unsigned long daemon_sleep; /* how many seconds between updates? */ |
246 | 247 | ||
247 | /* | 248 | atomic_t pending_writes; /* pending writes to the bitmap file */ |
248 | * bitmap_writeback_daemon waits for file-pages that have been written, | ||
249 | * as there is no way to get a call-back when a page write completes. | ||
250 | */ | ||
251 | mdk_thread_t *writeback_daemon; | ||
252 | spinlock_t write_lock; | ||
253 | wait_queue_head_t write_wait; | 249 | wait_queue_head_t write_wait; |
254 | struct list_head complete_pages; | 250 | |
255 | mempool_t *write_pool; | ||
256 | }; | 251 | }; |
257 | 252 | ||
258 | /* the bitmap API */ | 253 | /* the bitmap API */ |
diff --git a/include/linux/raid/linear.h b/include/linux/raid/linear.h index 7eaf290e10e7..ba15469daf11 100644 --- a/include/linux/raid/linear.h +++ b/include/linux/raid/linear.h | |||
@@ -13,8 +13,10 @@ typedef struct dev_info dev_info_t; | |||
13 | 13 | ||
14 | struct linear_private_data | 14 | struct linear_private_data |
15 | { | 15 | { |
16 | struct linear_private_data *prev; /* earlier version */ | ||
16 | dev_info_t **hash_table; | 17 | dev_info_t **hash_table; |
17 | sector_t hash_spacing; | 18 | sector_t hash_spacing; |
19 | sector_t array_size; | ||
18 | int preshift; /* shift before dividing by hash_spacing */ | 20 | int preshift; /* shift before dividing by hash_spacing */ |
19 | dev_info_t disks[0]; | 21 | dev_info_t disks[0]; |
20 | }; | 22 | }; |
diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h index 66b44e5e0d6e..eb3e547c8fee 100644 --- a/include/linux/raid/md.h +++ b/include/linux/raid/md.h | |||
@@ -85,8 +85,6 @@ extern void md_done_sync(mddev_t *mddev, int blocks, int ok); | |||
85 | extern void md_error (mddev_t *mddev, mdk_rdev_t *rdev); | 85 | extern void md_error (mddev_t *mddev, mdk_rdev_t *rdev); |
86 | extern void md_unplug_mddev(mddev_t *mddev); | 86 | extern void md_unplug_mddev(mddev_t *mddev); |
87 | 87 | ||
88 | extern void md_print_devices (void); | ||
89 | |||
90 | extern void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev, | 88 | extern void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev, |
91 | sector_t sector, int size, struct page *page); | 89 | sector_t sector, int size, struct page *page); |
92 | extern void md_super_wait(mddev_t *mddev); | 90 | extern void md_super_wait(mddev_t *mddev); |
@@ -97,7 +95,5 @@ extern void md_new_event(mddev_t *mddev); | |||
97 | 95 | ||
98 | extern void md_update_sb(mddev_t * mddev); | 96 | extern void md_update_sb(mddev_t * mddev); |
99 | 97 | ||
100 | #define MD_BUG(x...) { printk("md: bug in file %s, line %d\n", __FILE__, __LINE__); md_print_devices(); } | ||
101 | |||
102 | #endif | 98 | #endif |
103 | 99 | ||
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index e2df61f5b09a..c1e0ac55bab5 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h | |||
@@ -40,7 +40,8 @@ typedef struct mdk_rdev_s mdk_rdev_t; | |||
40 | * options passed in raidrun: | 40 | * options passed in raidrun: |
41 | */ | 41 | */ |
42 | 42 | ||
43 | #define MAX_CHUNK_SIZE (4096*1024) | 43 | /* Currently this must fix in an 'int' */ |
44 | #define MAX_CHUNK_SIZE (1<<30) | ||
44 | 45 | ||
45 | /* | 46 | /* |
46 | * MD's 'extended' device | 47 | * MD's 'extended' device |
@@ -57,6 +58,7 @@ struct mdk_rdev_s | |||
57 | 58 | ||
58 | struct page *sb_page; | 59 | struct page *sb_page; |
59 | int sb_loaded; | 60 | int sb_loaded; |
61 | __u64 sb_events; | ||
60 | sector_t data_offset; /* start of data in array */ | 62 | sector_t data_offset; /* start of data in array */ |
61 | sector_t sb_offset; | 63 | sector_t sb_offset; |
62 | int sb_size; /* bytes in the superblock */ | 64 | int sb_size; /* bytes in the superblock */ |
@@ -87,6 +89,10 @@ struct mdk_rdev_s | |||
87 | * array and could again if we did a partial | 89 | * array and could again if we did a partial |
88 | * resync from the bitmap | 90 | * resync from the bitmap |
89 | */ | 91 | */ |
92 | sector_t recovery_offset;/* If this device has been partially | ||
93 | * recovered, this is where we were | ||
94 | * up to. | ||
95 | */ | ||
90 | 96 | ||
91 | atomic_t nr_pending; /* number of pending requests. | 97 | atomic_t nr_pending; /* number of pending requests. |
92 | * only maintained for arrays that | 98 | * only maintained for arrays that |
@@ -182,6 +188,8 @@ struct mddev_s | |||
182 | #define MD_RECOVERY_REQUESTED 6 | 188 | #define MD_RECOVERY_REQUESTED 6 |
183 | #define MD_RECOVERY_CHECK 7 | 189 | #define MD_RECOVERY_CHECK 7 |
184 | #define MD_RECOVERY_RESHAPE 8 | 190 | #define MD_RECOVERY_RESHAPE 8 |
191 | #define MD_RECOVERY_FROZEN 9 | ||
192 | |||
185 | unsigned long recovery; | 193 | unsigned long recovery; |
186 | 194 | ||
187 | int in_sync; /* know to not need resync */ | 195 | int in_sync; /* know to not need resync */ |
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h index f1fbae7e390e..b6ebc69bae54 100644 --- a/include/linux/raid/md_p.h +++ b/include/linux/raid/md_p.h | |||
@@ -265,9 +265,12 @@ struct mdp_superblock_1 { | |||
265 | 265 | ||
266 | /* feature_map bits */ | 266 | /* feature_map bits */ |
267 | #define MD_FEATURE_BITMAP_OFFSET 1 | 267 | #define MD_FEATURE_BITMAP_OFFSET 1 |
268 | #define MD_FEATURE_RECOVERY_OFFSET 2 /* recovery_offset is present and | ||
269 | * must be honoured | ||
270 | */ | ||
268 | #define MD_FEATURE_RESHAPE_ACTIVE 4 | 271 | #define MD_FEATURE_RESHAPE_ACTIVE 4 |
269 | 272 | ||
270 | #define MD_FEATURE_ALL 5 | 273 | #define MD_FEATURE_ALL (1|2|4) |
271 | 274 | ||
272 | #endif | 275 | #endif |
273 | 276 | ||
diff --git a/include/linux/raid/raid10.h b/include/linux/raid/raid10.h index b1103298a8c2..c41e56a7c090 100644 --- a/include/linux/raid/raid10.h +++ b/include/linux/raid/raid10.h | |||
@@ -24,11 +24,16 @@ struct r10_private_data_s { | |||
24 | int far_copies; /* number of copies layed out | 24 | int far_copies; /* number of copies layed out |
25 | * at large strides across drives | 25 | * at large strides across drives |
26 | */ | 26 | */ |
27 | int far_offset; /* far_copies are offset by 1 stripe | ||
28 | * instead of many | ||
29 | */ | ||
27 | int copies; /* near_copies * far_copies. | 30 | int copies; /* near_copies * far_copies. |
28 | * must be <= raid_disks | 31 | * must be <= raid_disks |
29 | */ | 32 | */ |
30 | sector_t stride; /* distance between far copies. | 33 | sector_t stride; /* distance between far copies. |
31 | * This is size / far_copies | 34 | * This is size / far_copies unless |
35 | * far_offset, in which case it is | ||
36 | * 1 stripe. | ||
32 | */ | 37 | */ |
33 | 38 | ||
34 | int chunk_shift; /* shift from chunks to sectors */ | 39 | int chunk_shift; /* shift from chunks to sectors */ |
diff --git a/include/linux/raid/raid5.h b/include/linux/raid/raid5.h index 914af667044f..20ed4c997636 100644 --- a/include/linux/raid/raid5.h +++ b/include/linux/raid/raid5.h | |||
@@ -212,6 +212,7 @@ struct raid5_private_data { | |||
212 | mddev_t *mddev; | 212 | mddev_t *mddev; |
213 | struct disk_info *spare; | 213 | struct disk_info *spare; |
214 | int chunk_size, level, algorithm; | 214 | int chunk_size, level, algorithm; |
215 | int max_degraded; | ||
215 | int raid_disks, working_disks, failed_disks; | 216 | int raid_disks, working_disks, failed_disks; |
216 | int max_nr_stripes; | 217 | int max_nr_stripes; |
217 | 218 | ||
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h index 78ecfa28b1c2..00b340ba6612 100644 --- a/include/linux/ramfs.h +++ b/include/linux/ramfs.h | |||
@@ -2,8 +2,8 @@ | |||
2 | #define _LINUX_RAMFS_H | 2 | #define _LINUX_RAMFS_H |
3 | 3 | ||
4 | struct inode *ramfs_get_inode(struct super_block *sb, int mode, dev_t dev); | 4 | struct inode *ramfs_get_inode(struct super_block *sb, int mode, dev_t dev); |
5 | struct super_block *ramfs_get_sb(struct file_system_type *fs_type, | 5 | extern int ramfs_get_sb(struct file_system_type *fs_type, |
6 | int flags, const char *dev_name, void *data); | 6 | int flags, const char *dev_name, void *data, struct vfsmount *mnt); |
7 | 7 | ||
8 | #ifndef CONFIG_MMU | 8 | #ifndef CONFIG_MMU |
9 | extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file, | 9 | extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file, |
diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h index 4b7cc4fe366d..8d5382e62c08 100644 --- a/include/linux/rbtree.h +++ b/include/linux/rbtree.h | |||
@@ -99,22 +99,43 @@ static inline struct page * rb_insert_page_cache(struct inode * inode, | |||
99 | 99 | ||
100 | struct rb_node | 100 | struct rb_node |
101 | { | 101 | { |
102 | struct rb_node *rb_parent; | 102 | unsigned long rb_parent_color; |
103 | int rb_color; | ||
104 | #define RB_RED 0 | 103 | #define RB_RED 0 |
105 | #define RB_BLACK 1 | 104 | #define RB_BLACK 1 |
106 | struct rb_node *rb_right; | 105 | struct rb_node *rb_right; |
107 | struct rb_node *rb_left; | 106 | struct rb_node *rb_left; |
108 | }; | 107 | } __attribute__((aligned(sizeof(long)))); |
108 | /* The alignment might seem pointless, but allegedly CRIS needs it */ | ||
109 | 109 | ||
110 | struct rb_root | 110 | struct rb_root |
111 | { | 111 | { |
112 | struct rb_node *rb_node; | 112 | struct rb_node *rb_node; |
113 | }; | 113 | }; |
114 | 114 | ||
115 | |||
116 | #define rb_parent(r) ((struct rb_node *)((r)->rb_parent_color & ~3)) | ||
117 | #define rb_color(r) ((r)->rb_parent_color & 1) | ||
118 | #define rb_is_red(r) (!rb_color(r)) | ||
119 | #define rb_is_black(r) rb_color(r) | ||
120 | #define rb_set_red(r) do { (r)->rb_parent_color &= ~1; } while (0) | ||
121 | #define rb_set_black(r) do { (r)->rb_parent_color |= 1; } while (0) | ||
122 | |||
123 | static inline void rb_set_parent(struct rb_node *rb, struct rb_node *p) | ||
124 | { | ||
125 | rb->rb_parent_color = (rb->rb_parent_color & 3) | (unsigned long)p; | ||
126 | } | ||
127 | static inline void rb_set_color(struct rb_node *rb, int color) | ||
128 | { | ||
129 | rb->rb_parent_color = (rb->rb_parent_color & ~1) | color; | ||
130 | } | ||
131 | |||
115 | #define RB_ROOT (struct rb_root) { NULL, } | 132 | #define RB_ROOT (struct rb_root) { NULL, } |
116 | #define rb_entry(ptr, type, member) container_of(ptr, type, member) | 133 | #define rb_entry(ptr, type, member) container_of(ptr, type, member) |
117 | 134 | ||
135 | #define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL) | ||
136 | #define RB_EMPTY_NODE(node) (rb_parent(node) != node) | ||
137 | #define RB_CLEAR_NODE(node) (rb_set_parent(node, node)) | ||
138 | |||
118 | extern void rb_insert_color(struct rb_node *, struct rb_root *); | 139 | extern void rb_insert_color(struct rb_node *, struct rb_root *); |
119 | extern void rb_erase(struct rb_node *, struct rb_root *); | 140 | extern void rb_erase(struct rb_node *, struct rb_root *); |
120 | 141 | ||
@@ -131,8 +152,7 @@ extern void rb_replace_node(struct rb_node *victim, struct rb_node *new, | |||
131 | static inline void rb_link_node(struct rb_node * node, struct rb_node * parent, | 152 | static inline void rb_link_node(struct rb_node * node, struct rb_node * parent, |
132 | struct rb_node ** rb_link) | 153 | struct rb_node ** rb_link) |
133 | { | 154 | { |
134 | node->rb_parent = parent; | 155 | node->rb_parent_color = (unsigned long )parent; |
135 | node->rb_color = RB_RED; | ||
136 | node->rb_left = node->rb_right = NULL; | 156 | node->rb_left = node->rb_right = NULL; |
137 | 157 | ||
138 | *rb_link = node; | 158 | *rb_link = node; |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 970284f571a6..b4ca73d65891 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -163,14 +163,22 @@ extern int rcu_needs_cpu(int cpu); | |||
163 | * | 163 | * |
164 | * It is illegal to block while in an RCU read-side critical section. | 164 | * It is illegal to block while in an RCU read-side critical section. |
165 | */ | 165 | */ |
166 | #define rcu_read_lock() preempt_disable() | 166 | #define rcu_read_lock() \ |
167 | do { \ | ||
168 | preempt_disable(); \ | ||
169 | __acquire(RCU); \ | ||
170 | } while(0) | ||
167 | 171 | ||
168 | /** | 172 | /** |
169 | * rcu_read_unlock - marks the end of an RCU read-side critical section. | 173 | * rcu_read_unlock - marks the end of an RCU read-side critical section. |
170 | * | 174 | * |
171 | * See rcu_read_lock() for more information. | 175 | * See rcu_read_lock() for more information. |
172 | */ | 176 | */ |
173 | #define rcu_read_unlock() preempt_enable() | 177 | #define rcu_read_unlock() \ |
178 | do { \ | ||
179 | __release(RCU); \ | ||
180 | preempt_enable(); \ | ||
181 | } while(0) | ||
174 | 182 | ||
175 | /* | 183 | /* |
176 | * So where is rcu_write_lock()? It does not exist, as there is no | 184 | * So where is rcu_write_lock()? It does not exist, as there is no |
@@ -193,14 +201,22 @@ extern int rcu_needs_cpu(int cpu); | |||
193 | * can use just rcu_read_lock(). | 201 | * can use just rcu_read_lock(). |
194 | * | 202 | * |
195 | */ | 203 | */ |
196 | #define rcu_read_lock_bh() local_bh_disable() | 204 | #define rcu_read_lock_bh() \ |
205 | do { \ | ||
206 | local_bh_disable(); \ | ||
207 | __acquire(RCU_BH); \ | ||
208 | } while(0) | ||
197 | 209 | ||
198 | /* | 210 | /* |
199 | * rcu_read_unlock_bh - marks the end of a softirq-only RCU critical section | 211 | * rcu_read_unlock_bh - marks the end of a softirq-only RCU critical section |
200 | * | 212 | * |
201 | * See rcu_read_lock_bh() for more information. | 213 | * See rcu_read_lock_bh() for more information. |
202 | */ | 214 | */ |
203 | #define rcu_read_unlock_bh() local_bh_enable() | 215 | #define rcu_read_unlock_bh() \ |
216 | do { \ | ||
217 | __release(RCU_BH); \ | ||
218 | local_bh_enable(); \ | ||
219 | } while(0) | ||
204 | 220 | ||
205 | /** | 221 | /** |
206 | * rcu_dereference - fetch an RCU-protected pointer in an | 222 | * rcu_dereference - fetch an RCU-protected pointer in an |
@@ -246,7 +262,7 @@ extern int rcu_needs_cpu(int cpu); | |||
246 | * softirq handlers will have completed, since in some kernels, these | 262 | * softirq handlers will have completed, since in some kernels, these |
247 | * handlers can run in process context, and can block. | 263 | * handlers can run in process context, and can block. |
248 | * | 264 | * |
249 | * This primitive provides the guarantees made by the (deprecated) | 265 | * This primitive provides the guarantees made by the (now removed) |
250 | * synchronize_kernel() API. In contrast, synchronize_rcu() only | 266 | * synchronize_kernel() API. In contrast, synchronize_rcu() only |
251 | * guarantees that rcu_read_lock() sections will have completed. | 267 | * guarantees that rcu_read_lock() sections will have completed. |
252 | * In "classic RCU", these two guarantees happen to be one and | 268 | * In "classic RCU", these two guarantees happen to be one and |
@@ -258,13 +274,13 @@ extern void rcu_init(void); | |||
258 | extern void rcu_check_callbacks(int cpu, int user); | 274 | extern void rcu_check_callbacks(int cpu, int user); |
259 | extern void rcu_restart_cpu(int cpu); | 275 | extern void rcu_restart_cpu(int cpu); |
260 | extern long rcu_batches_completed(void); | 276 | extern long rcu_batches_completed(void); |
277 | extern long rcu_batches_completed_bh(void); | ||
261 | 278 | ||
262 | /* Exported interfaces */ | 279 | /* Exported interfaces */ |
263 | extern void FASTCALL(call_rcu(struct rcu_head *head, | 280 | extern void FASTCALL(call_rcu(struct rcu_head *head, |
264 | void (*func)(struct rcu_head *head))); | 281 | void (*func)(struct rcu_head *head))); |
265 | extern void FASTCALL(call_rcu_bh(struct rcu_head *head, | 282 | extern void FASTCALL(call_rcu_bh(struct rcu_head *head, |
266 | void (*func)(struct rcu_head *head))); | 283 | void (*func)(struct rcu_head *head))); |
267 | extern __deprecated_for_modules void synchronize_kernel(void); | ||
268 | extern void synchronize_rcu(void); | 284 | extern void synchronize_rcu(void); |
269 | void synchronize_idle(void); | 285 | void synchronize_idle(void); |
270 | extern void rcu_barrier(void); | 286 | extern void rcu_barrier(void); |
diff --git a/include/linux/reboot.h b/include/linux/reboot.h index 015297ff73fa..1dd1c707311f 100644 --- a/include/linux/reboot.h +++ b/include/linux/reboot.h | |||
@@ -59,13 +59,13 @@ 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); | ||
63 | extern void kernel_shutdown_prepare(enum system_states state); | 62 | extern void kernel_shutdown_prepare(enum system_states state); |
64 | 63 | ||
65 | extern void kernel_restart(char *cmd); | 64 | extern void kernel_restart(char *cmd); |
66 | extern void kernel_halt(void); | 65 | extern void kernel_halt(void); |
67 | extern void kernel_power_off(void); | 66 | extern void kernel_power_off(void); |
68 | extern void kernel_kexec(void); | 67 | |
68 | void ctrl_alt_del(void); | ||
69 | 69 | ||
70 | /* | 70 | /* |
71 | * Emergency restart, callable from an interrupt handler. | 71 | * Emergency restart, callable from an interrupt handler. |
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index 5676c4210e2c..daa2d83cefe8 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -1973,7 +1973,7 @@ void reiserfs_unmap_buffer(struct buffer_head *); | |||
1973 | /* file.c */ | 1973 | /* file.c */ |
1974 | extern struct inode_operations reiserfs_file_inode_operations; | 1974 | extern struct inode_operations reiserfs_file_inode_operations; |
1975 | extern const struct file_operations reiserfs_file_operations; | 1975 | extern const struct file_operations reiserfs_file_operations; |
1976 | extern struct address_space_operations reiserfs_address_space_operations; | 1976 | extern const struct address_space_operations reiserfs_address_space_operations; |
1977 | 1977 | ||
1978 | /* fix_nodes.c */ | 1978 | /* fix_nodes.c */ |
1979 | 1979 | ||
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h index 5353afb11db3..5e961035c725 100644 --- a/include/linux/reiserfs_xattr.h +++ b/include/linux/reiserfs_xattr.h | |||
@@ -2,8 +2,6 @@ | |||
2 | File: linux/reiserfs_xattr.h | 2 | File: linux/reiserfs_xattr.h |
3 | */ | 3 | */ |
4 | 4 | ||
5 | #include <linux/config.h> | ||
6 | #include <linux/init.h> | ||
7 | #include <linux/xattr.h> | 5 | #include <linux/xattr.h> |
8 | 6 | ||
9 | /* Magic value in header */ | 7 | /* Magic value in header */ |
@@ -15,6 +13,7 @@ struct reiserfs_xattr_header { | |||
15 | }; | 13 | }; |
16 | 14 | ||
17 | #ifdef __KERNEL__ | 15 | #ifdef __KERNEL__ |
16 | #include <linux/init.h> | ||
18 | 17 | ||
19 | struct reiserfs_xattr_handler { | 18 | struct reiserfs_xattr_handler { |
20 | char *prefix; | 19 | char *prefix; |
diff --git a/include/linux/relay.h b/include/linux/relay.h index 4bcc1531d6a9..24accb483849 100644 --- a/include/linux/relay.h +++ b/include/linux/relay.h | |||
@@ -10,7 +10,6 @@ | |||
10 | #ifndef _LINUX_RELAY_H | 10 | #ifndef _LINUX_RELAY_H |
11 | #define _LINUX_RELAY_H | 11 | #define _LINUX_RELAY_H |
12 | 12 | ||
13 | #include <linux/config.h> | ||
14 | #include <linux/types.h> | 13 | #include <linux/types.h> |
15 | #include <linux/sched.h> | 14 | #include <linux/sched.h> |
16 | #include <linux/wait.h> | 15 | #include <linux/wait.h> |
diff --git a/include/linux/resource.h b/include/linux/resource.h index 21a86cb6acdb..ae13db714742 100644 --- a/include/linux/resource.h +++ b/include/linux/resource.h | |||
@@ -3,6 +3,8 @@ | |||
3 | 3 | ||
4 | #include <linux/time.h> | 4 | #include <linux/time.h> |
5 | 5 | ||
6 | struct task_struct; | ||
7 | |||
6 | /* | 8 | /* |
7 | * Resource control/accounting header file for linux | 9 | * Resource control/accounting header file for linux |
8 | */ | 10 | */ |
@@ -67,4 +69,6 @@ struct rlimit { | |||
67 | */ | 69 | */ |
68 | #include <asm/resource.h> | 70 | #include <asm/resource.h> |
69 | 71 | ||
72 | int getrusage(struct task_struct *p, int who, struct rusage __user *ru); | ||
73 | |||
70 | #endif | 74 | #endif |
diff --git a/include/linux/resume-trace.h b/include/linux/resume-trace.h new file mode 100644 index 000000000000..a376bd4ade39 --- /dev/null +++ b/include/linux/resume-trace.h | |||
@@ -0,0 +1,30 @@ | |||
1 | #ifndef RESUME_TRACE_H | ||
2 | #define RESUME_TRACE_H | ||
3 | |||
4 | #ifdef CONFIG_PM_TRACE | ||
5 | |||
6 | struct device; | ||
7 | extern void set_trace_device(struct device *); | ||
8 | extern void generate_resume_trace(void *tracedata, unsigned int user); | ||
9 | |||
10 | #define TRACE_DEVICE(dev) set_trace_device(dev) | ||
11 | #define TRACE_RESUME(user) do { \ | ||
12 | void *tracedata; \ | ||
13 | asm volatile("movl $1f,%0\n" \ | ||
14 | ".section .tracedata,\"a\"\n" \ | ||
15 | "1:\t.word %c1\n" \ | ||
16 | "\t.long %c2\n" \ | ||
17 | ".previous" \ | ||
18 | :"=r" (tracedata) \ | ||
19 | : "i" (__LINE__), "i" (__FILE__)); \ | ||
20 | generate_resume_trace(tracedata, user); \ | ||
21 | } while (0) | ||
22 | |||
23 | #else | ||
24 | |||
25 | #define TRACE_DEVICE(dev) do { } while (0) | ||
26 | #define TRACE_RESUME(dev) do { } while (0) | ||
27 | |||
28 | #endif | ||
29 | |||
30 | #endif | ||
diff --git a/include/linux/rio.h b/include/linux/rio.h index c7e907faae9c..d93857056cb9 100644 --- a/include/linux/rio.h +++ b/include/linux/rio.h | |||
@@ -17,7 +17,6 @@ | |||
17 | #ifdef __KERNEL__ | 17 | #ifdef __KERNEL__ |
18 | 18 | ||
19 | #include <linux/types.h> | 19 | #include <linux/types.h> |
20 | #include <linux/config.h> | ||
21 | #include <linux/ioport.h> | 20 | #include <linux/ioport.h> |
22 | #include <linux/list.h> | 21 | #include <linux/list.h> |
23 | #include <linux/errno.h> | 22 | #include <linux/errno.h> |
diff --git a/include/linux/rio_drv.h b/include/linux/rio_drv.h index f54772d0e7f8..7adb2a1aac92 100644 --- a/include/linux/rio_drv.h +++ b/include/linux/rio_drv.h | |||
@@ -16,7 +16,6 @@ | |||
16 | #ifdef __KERNEL__ | 16 | #ifdef __KERNEL__ |
17 | 17 | ||
18 | #include <linux/types.h> | 18 | #include <linux/types.h> |
19 | #include <linux/config.h> | ||
20 | #include <linux/ioport.h> | 19 | #include <linux/ioport.h> |
21 | #include <linux/list.h> | 20 | #include <linux/list.h> |
22 | #include <linux/errno.h> | 21 | #include <linux/errno.h> |
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index d6b9bcd1384c..bf97b0900014 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -4,7 +4,6 @@ | |||
4 | * Declarations for Reverse Mapping functions in mm/rmap.c | 4 | * Declarations for Reverse Mapping functions in mm/rmap.c |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #include <linux/config.h> | ||
8 | #include <linux/list.h> | 7 | #include <linux/list.h> |
9 | #include <linux/slab.h> | 8 | #include <linux/slab.h> |
10 | #include <linux/mm.h> | 9 | #include <linux/mm.h> |
@@ -92,7 +91,6 @@ static inline void page_dup_rmap(struct page *page) | |||
92 | */ | 91 | */ |
93 | int page_referenced(struct page *, int is_locked); | 92 | int page_referenced(struct page *, int is_locked); |
94 | int try_to_unmap(struct page *, int ignore_refs); | 93 | int try_to_unmap(struct page *, int ignore_refs); |
95 | void remove_from_swap(struct page *page); | ||
96 | 94 | ||
97 | /* | 95 | /* |
98 | * Called from mm/filemap_xip.c to unmap empty zero page | 96 | * Called from mm/filemap_xip.c to unmap empty zero page |
diff --git a/include/linux/rtc-v3020.h b/include/linux/rtc-v3020.h new file mode 100644 index 000000000000..bf74e63c98fe --- /dev/null +++ b/include/linux/rtc-v3020.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * v3020.h - Registers definition and platform data structure for the v3020 RTC. | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2006, 8D Technologies inc. | ||
9 | */ | ||
10 | #ifndef __LINUX_V3020_H | ||
11 | #define __LINUX_V3020_H | ||
12 | |||
13 | /* The v3020 has only one data pin but which one | ||
14 | * is used depends on the board. */ | ||
15 | struct v3020_platform_data { | ||
16 | int leftshift; /* (1<<(leftshift)) & readl() */ | ||
17 | }; | ||
18 | |||
19 | #define V3020_STATUS_0 0x00 | ||
20 | #define V3020_STATUS_1 0x01 | ||
21 | #define V3020_SECONDS 0x02 | ||
22 | #define V3020_MINUTES 0x03 | ||
23 | #define V3020_HOURS 0x04 | ||
24 | #define V3020_MONTH_DAY 0x05 | ||
25 | #define V3020_MONTH 0x06 | ||
26 | #define V3020_YEAR 0x07 | ||
27 | #define V3020_WEEK_DAY 0x08 | ||
28 | #define V3020_WEEK 0x09 | ||
29 | |||
30 | #define V3020_IS_COMMAND(val) ((val)>=0x0E) | ||
31 | |||
32 | #define V3020_CMD_RAM2CLOCK 0x0E | ||
33 | #define V3020_CMD_CLOCK2RAM 0x0F | ||
34 | |||
35 | #endif /* __LINUX_V3020_H */ | ||
diff --git a/include/linux/rtc.h b/include/linux/rtc.h index ab61cd1199f2..5371e4e74595 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h | |||
@@ -34,8 +34,8 @@ struct rtc_time { | |||
34 | * alarm API. | 34 | * alarm API. |
35 | */ | 35 | */ |
36 | struct rtc_wkalrm { | 36 | struct rtc_wkalrm { |
37 | unsigned char enabled; /* 0 = alarm disable, 1 = alarm disabled */ | 37 | unsigned char enabled; /* 0 = alarm disabled, 1 = alarm enabled */ |
38 | unsigned char pending; /* 0 = alarm pending, 1 = alarm not pending */ | 38 | unsigned char pending; /* 0 = alarm not pending, 1 = alarm pending */ |
39 | struct rtc_time time; /* time the alarm is set to */ | 39 | struct rtc_time time; /* time the alarm is set to */ |
40 | }; | 40 | }; |
41 | 41 | ||
@@ -102,6 +102,7 @@ struct rtc_pll_info { | |||
102 | #include <linux/interrupt.h> | 102 | #include <linux/interrupt.h> |
103 | 103 | ||
104 | extern int rtc_month_days(unsigned int month, unsigned int year); | 104 | extern int rtc_month_days(unsigned int month, unsigned int year); |
105 | extern int rtc_year_days(unsigned int day, unsigned int month, unsigned int year); | ||
105 | extern int rtc_valid_tm(struct rtc_time *tm); | 106 | extern int rtc_valid_tm(struct rtc_time *tm); |
106 | extern int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time); | 107 | extern int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time); |
107 | extern void rtc_time_to_tm(unsigned long time, struct rtc_time *tm); | 108 | extern void rtc_time_to_tm(unsigned long time, struct rtc_time *tm); |
@@ -155,6 +156,17 @@ struct rtc_device | |||
155 | struct rtc_task *irq_task; | 156 | struct rtc_task *irq_task; |
156 | spinlock_t irq_task_lock; | 157 | spinlock_t irq_task_lock; |
157 | int irq_freq; | 158 | int irq_freq; |
159 | int max_user_freq; | ||
160 | #ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL | ||
161 | struct work_struct uie_task; | ||
162 | struct timer_list uie_timer; | ||
163 | /* Those fields are protected by rtc->irq_lock */ | ||
164 | unsigned int oldsecs; | ||
165 | unsigned int irq_active:1; | ||
166 | unsigned int stop_uie_polling:1; | ||
167 | unsigned int uie_task_active:1; | ||
168 | unsigned int uie_timer_active:1; | ||
169 | #endif | ||
158 | }; | 170 | }; |
159 | #define to_rtc_device(d) container_of(d, struct rtc_device, class_dev) | 171 | #define to_rtc_device(d) container_of(d, struct rtc_device, class_dev) |
160 | 172 | ||
diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h new file mode 100644 index 000000000000..fa4a3b82ba70 --- /dev/null +++ b/include/linux/rtmutex.h | |||
@@ -0,0 +1,117 @@ | |||
1 | /* | ||
2 | * RT Mutexes: blocking mutual exclusion locks with PI support | ||
3 | * | ||
4 | * started by Ingo Molnar and Thomas Gleixner: | ||
5 | * | ||
6 | * Copyright (C) 2004-2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com> | ||
7 | * Copyright (C) 2006, Timesys Corp., Thomas Gleixner <tglx@timesys.com> | ||
8 | * | ||
9 | * This file contains the public data structure and API definitions. | ||
10 | */ | ||
11 | |||
12 | #ifndef __LINUX_RT_MUTEX_H | ||
13 | #define __LINUX_RT_MUTEX_H | ||
14 | |||
15 | #include <linux/linkage.h> | ||
16 | #include <linux/plist.h> | ||
17 | #include <linux/spinlock_types.h> | ||
18 | |||
19 | /* | ||
20 | * The rt_mutex structure | ||
21 | * | ||
22 | * @wait_lock: spinlock to protect the structure | ||
23 | * @wait_list: pilist head to enqueue waiters in priority order | ||
24 | * @owner: the mutex owner | ||
25 | */ | ||
26 | struct rt_mutex { | ||
27 | spinlock_t wait_lock; | ||
28 | struct plist_head wait_list; | ||
29 | struct task_struct *owner; | ||
30 | #ifdef CONFIG_DEBUG_RT_MUTEXES | ||
31 | int save_state; | ||
32 | struct list_head held_list_entry; | ||
33 | unsigned long acquire_ip; | ||
34 | const char *name, *file; | ||
35 | int line; | ||
36 | void *magic; | ||
37 | #endif | ||
38 | }; | ||
39 | |||
40 | struct rt_mutex_waiter; | ||
41 | struct hrtimer_sleeper; | ||
42 | |||
43 | #ifdef CONFIG_DEBUG_RT_MUTEXES | ||
44 | extern int rt_mutex_debug_check_no_locks_freed(const void *from, | ||
45 | unsigned long len); | ||
46 | extern void rt_mutex_debug_check_no_locks_held(struct task_struct *task); | ||
47 | #else | ||
48 | static inline int rt_mutex_debug_check_no_locks_freed(const void *from, | ||
49 | unsigned long len) | ||
50 | { | ||
51 | return 0; | ||
52 | } | ||
53 | # define rt_mutex_debug_check_no_locks_held(task) do { } while (0) | ||
54 | #endif | ||
55 | |||
56 | #ifdef CONFIG_DEBUG_RT_MUTEXES | ||
57 | # define __DEBUG_RT_MUTEX_INITIALIZER(mutexname) \ | ||
58 | , .name = #mutexname, .file = __FILE__, .line = __LINE__ | ||
59 | # define rt_mutex_init(mutex) __rt_mutex_init(mutex, __FUNCTION__) | ||
60 | extern void rt_mutex_debug_task_free(struct task_struct *tsk); | ||
61 | #else | ||
62 | # define __DEBUG_RT_MUTEX_INITIALIZER(mutexname) | ||
63 | # define rt_mutex_init(mutex) __rt_mutex_init(mutex, NULL) | ||
64 | # define rt_mutex_debug_task_free(t) do { } while (0) | ||
65 | #endif | ||
66 | |||
67 | #define __RT_MUTEX_INITIALIZER(mutexname) \ | ||
68 | { .wait_lock = SPIN_LOCK_UNLOCKED \ | ||
69 | , .wait_list = PLIST_HEAD_INIT(mutexname.wait_list, mutexname.wait_lock) \ | ||
70 | , .owner = NULL \ | ||
71 | __DEBUG_RT_MUTEX_INITIALIZER(mutexname)} | ||
72 | |||
73 | #define DEFINE_RT_MUTEX(mutexname) \ | ||
74 | struct rt_mutex mutexname = __RT_MUTEX_INITIALIZER(mutexname) | ||
75 | |||
76 | /*** | ||
77 | * rt_mutex_is_locked - is the mutex locked | ||
78 | * @lock: the mutex to be queried | ||
79 | * | ||
80 | * Returns 1 if the mutex is locked, 0 if unlocked. | ||
81 | */ | ||
82 | static inline int rt_mutex_is_locked(struct rt_mutex *lock) | ||
83 | { | ||
84 | return lock->owner != NULL; | ||
85 | } | ||
86 | |||
87 | extern void __rt_mutex_init(struct rt_mutex *lock, const char *name); | ||
88 | extern void rt_mutex_destroy(struct rt_mutex *lock); | ||
89 | |||
90 | extern void rt_mutex_lock(struct rt_mutex *lock); | ||
91 | extern int rt_mutex_lock_interruptible(struct rt_mutex *lock, | ||
92 | int detect_deadlock); | ||
93 | extern int rt_mutex_timed_lock(struct rt_mutex *lock, | ||
94 | struct hrtimer_sleeper *timeout, | ||
95 | int detect_deadlock); | ||
96 | |||
97 | extern int rt_mutex_trylock(struct rt_mutex *lock); | ||
98 | |||
99 | extern void rt_mutex_unlock(struct rt_mutex *lock); | ||
100 | |||
101 | #ifdef CONFIG_DEBUG_RT_MUTEXES | ||
102 | # define INIT_RT_MUTEX_DEBUG(tsk) \ | ||
103 | .held_list_head = LIST_HEAD_INIT(tsk.held_list_head), \ | ||
104 | .held_list_lock = SPIN_LOCK_UNLOCKED | ||
105 | #else | ||
106 | # define INIT_RT_MUTEX_DEBUG(tsk) | ||
107 | #endif | ||
108 | |||
109 | #ifdef CONFIG_RT_MUTEXES | ||
110 | # define INIT_RT_MUTEXES(tsk) \ | ||
111 | .pi_waiters = PLIST_HEAD_INIT(tsk.pi_waiters, tsk.pi_lock), \ | ||
112 | INIT_RT_MUTEX_DEBUG(tsk) | ||
113 | #else | ||
114 | # define INIT_RT_MUTEXES(tsk) | ||
115 | #endif | ||
116 | |||
117 | #endif | ||
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index df0cdd41085c..facd9ee37b76 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -909,7 +909,6 @@ struct tcamsg | |||
909 | 909 | ||
910 | #ifdef __KERNEL__ | 910 | #ifdef __KERNEL__ |
911 | 911 | ||
912 | #include <linux/config.h> | ||
913 | #include <linux/mutex.h> | 912 | #include <linux/mutex.h> |
914 | 913 | ||
915 | extern size_t rtattr_strlcpy(char *dest, const struct rtattr *rta, size_t size); | 914 | extern size_t rtattr_strlcpy(char *dest, const struct rtattr *rta, size_t size); |
diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h index bfb988885002..f99fe90732ab 100644 --- a/include/linux/rwsem.h +++ b/include/linux/rwsem.h | |||
@@ -13,7 +13,6 @@ | |||
13 | 13 | ||
14 | #ifdef __KERNEL__ | 14 | #ifdef __KERNEL__ |
15 | 15 | ||
16 | #include <linux/config.h> | ||
17 | #include <linux/types.h> | 16 | #include <linux/types.h> |
18 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
19 | #include <asm/system.h> | 18 | #include <asm/system.h> |
diff --git a/include/linux/scc.h b/include/linux/scc.h index 885a4a02b23c..3495bd953cc6 100644 --- a/include/linux/scc.h +++ b/include/linux/scc.h | |||
@@ -3,7 +3,6 @@ | |||
3 | #ifndef _SCC_H | 3 | #ifndef _SCC_H |
4 | #define _SCC_H | 4 | #define _SCC_H |
5 | 5 | ||
6 | #include <linux/config.h> | ||
7 | 6 | ||
8 | /* selection of hardware types */ | 7 | /* selection of hardware types */ |
9 | 8 | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index 29b7d4f87d20..aaf723308ed4 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1,9 +1,46 @@ | |||
1 | #ifndef _LINUX_SCHED_H | 1 | #ifndef _LINUX_SCHED_H |
2 | #define _LINUX_SCHED_H | 2 | #define _LINUX_SCHED_H |
3 | 3 | ||
4 | #include <linux/auxvec.h> /* For AT_VECTOR_SIZE */ | ||
5 | |||
6 | /* | ||
7 | * cloning flags: | ||
8 | */ | ||
9 | #define CSIGNAL 0x000000ff /* signal mask to be sent at exit */ | ||
10 | #define CLONE_VM 0x00000100 /* set if VM shared between processes */ | ||
11 | #define CLONE_FS 0x00000200 /* set if fs info shared between processes */ | ||
12 | #define CLONE_FILES 0x00000400 /* set if open files shared between processes */ | ||
13 | #define CLONE_SIGHAND 0x00000800 /* set if signal handlers and blocked signals shared */ | ||
14 | #define CLONE_PTRACE 0x00002000 /* set if we want to let tracing continue on the child too */ | ||
15 | #define CLONE_VFORK 0x00004000 /* set if the parent wants the child to wake it up on mm_release */ | ||
16 | #define CLONE_PARENT 0x00008000 /* set if we want to have the same parent as the cloner */ | ||
17 | #define CLONE_THREAD 0x00010000 /* Same thread group? */ | ||
18 | #define CLONE_NEWNS 0x00020000 /* New namespace group? */ | ||
19 | #define CLONE_SYSVSEM 0x00040000 /* share system V SEM_UNDO semantics */ | ||
20 | #define CLONE_SETTLS 0x00080000 /* create a new TLS for the child */ | ||
21 | #define CLONE_PARENT_SETTID 0x00100000 /* set the TID in the parent */ | ||
22 | #define CLONE_CHILD_CLEARTID 0x00200000 /* clear the TID in the child */ | ||
23 | #define CLONE_DETACHED 0x00400000 /* Unused, ignored */ | ||
24 | #define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */ | ||
25 | #define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */ | ||
26 | #define CLONE_STOPPED 0x02000000 /* Start in stopped state */ | ||
27 | |||
28 | /* | ||
29 | * Scheduling policies | ||
30 | */ | ||
31 | #define SCHED_NORMAL 0 | ||
32 | #define SCHED_FIFO 1 | ||
33 | #define SCHED_RR 2 | ||
34 | #define SCHED_BATCH 3 | ||
35 | |||
36 | #ifdef __KERNEL__ | ||
37 | |||
38 | struct sched_param { | ||
39 | int sched_priority; | ||
40 | }; | ||
41 | |||
4 | #include <asm/param.h> /* for HZ */ | 42 | #include <asm/param.h> /* for HZ */ |
5 | 43 | ||
6 | #include <linux/config.h> | ||
7 | #include <linux/capability.h> | 44 | #include <linux/capability.h> |
8 | #include <linux/threads.h> | 45 | #include <linux/threads.h> |
9 | #include <linux/kernel.h> | 46 | #include <linux/kernel.h> |
@@ -36,32 +73,18 @@ | |||
36 | #include <linux/seccomp.h> | 73 | #include <linux/seccomp.h> |
37 | #include <linux/rcupdate.h> | 74 | #include <linux/rcupdate.h> |
38 | #include <linux/futex.h> | 75 | #include <linux/futex.h> |
76 | #include <linux/rtmutex.h> | ||
39 | 77 | ||
40 | #include <linux/auxvec.h> /* For AT_VECTOR_SIZE */ | 78 | #include <linux/time.h> |
79 | #include <linux/param.h> | ||
80 | #include <linux/resource.h> | ||
81 | #include <linux/timer.h> | ||
82 | #include <linux/hrtimer.h> | ||
41 | 83 | ||
42 | struct exec_domain; | 84 | #include <asm/processor.h> |
43 | 85 | ||
44 | /* | 86 | struct exec_domain; |
45 | * cloning flags: | 87 | struct futex_pi_state; |
46 | */ | ||
47 | #define CSIGNAL 0x000000ff /* signal mask to be sent at exit */ | ||
48 | #define CLONE_VM 0x00000100 /* set if VM shared between processes */ | ||
49 | #define CLONE_FS 0x00000200 /* set if fs info shared between processes */ | ||
50 | #define CLONE_FILES 0x00000400 /* set if open files shared between processes */ | ||
51 | #define CLONE_SIGHAND 0x00000800 /* set if signal handlers and blocked signals shared */ | ||
52 | #define CLONE_PTRACE 0x00002000 /* set if we want to let tracing continue on the child too */ | ||
53 | #define CLONE_VFORK 0x00004000 /* set if the parent wants the child to wake it up on mm_release */ | ||
54 | #define CLONE_PARENT 0x00008000 /* set if we want to have the same parent as the cloner */ | ||
55 | #define CLONE_THREAD 0x00010000 /* Same thread group? */ | ||
56 | #define CLONE_NEWNS 0x00020000 /* New namespace group? */ | ||
57 | #define CLONE_SYSVSEM 0x00040000 /* share system V SEM_UNDO semantics */ | ||
58 | #define CLONE_SETTLS 0x00080000 /* create a new TLS for the child */ | ||
59 | #define CLONE_PARENT_SETTID 0x00100000 /* set the TID in the parent */ | ||
60 | #define CLONE_CHILD_CLEARTID 0x00200000 /* clear the TID in the child */ | ||
61 | #define CLONE_DETACHED 0x00400000 /* Unused, ignored */ | ||
62 | #define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */ | ||
63 | #define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */ | ||
64 | #define CLONE_STOPPED 0x02000000 /* Start in stopped state */ | ||
65 | 88 | ||
66 | /* | 89 | /* |
67 | * List of flags we want to share for kernel threads, | 90 | * List of flags we want to share for kernel threads, |
@@ -102,14 +125,8 @@ extern unsigned long nr_running(void); | |||
102 | extern unsigned long nr_uninterruptible(void); | 125 | extern unsigned long nr_uninterruptible(void); |
103 | extern unsigned long nr_active(void); | 126 | extern unsigned long nr_active(void); |
104 | extern unsigned long nr_iowait(void); | 127 | extern unsigned long nr_iowait(void); |
128 | extern unsigned long weighted_cpuload(const int cpu); | ||
105 | 129 | ||
106 | #include <linux/time.h> | ||
107 | #include <linux/param.h> | ||
108 | #include <linux/resource.h> | ||
109 | #include <linux/timer.h> | ||
110 | #include <linux/hrtimer.h> | ||
111 | |||
112 | #include <asm/processor.h> | ||
113 | 130 | ||
114 | /* | 131 | /* |
115 | * Task state bitmask. NOTE! These bits are also | 132 | * Task state bitmask. NOTE! These bits are also |
@@ -156,20 +173,6 @@ extern unsigned long nr_iowait(void); | |||
156 | /* Task command name length */ | 173 | /* Task command name length */ |
157 | #define TASK_COMM_LEN 16 | 174 | #define TASK_COMM_LEN 16 |
158 | 175 | ||
159 | /* | ||
160 | * Scheduling policies | ||
161 | */ | ||
162 | #define SCHED_NORMAL 0 | ||
163 | #define SCHED_FIFO 1 | ||
164 | #define SCHED_RR 2 | ||
165 | #define SCHED_BATCH 3 | ||
166 | |||
167 | struct sched_param { | ||
168 | int sched_priority; | ||
169 | }; | ||
170 | |||
171 | #ifdef __KERNEL__ | ||
172 | |||
173 | #include <linux/spinlock.h> | 176 | #include <linux/spinlock.h> |
174 | 177 | ||
175 | /* | 178 | /* |
@@ -358,6 +361,14 @@ struct sighand_struct { | |||
358 | spinlock_t siglock; | 361 | spinlock_t siglock; |
359 | }; | 362 | }; |
360 | 363 | ||
364 | struct pacct_struct { | ||
365 | int ac_flag; | ||
366 | long ac_exitcode; | ||
367 | unsigned long ac_mem; | ||
368 | cputime_t ac_utime, ac_stime; | ||
369 | unsigned long ac_minflt, ac_majflt; | ||
370 | }; | ||
371 | |||
361 | /* | 372 | /* |
362 | * NOTE! "signal_struct" does not have it's own | 373 | * NOTE! "signal_struct" does not have it's own |
363 | * locking, because a shared signal_struct always | 374 | * locking, because a shared signal_struct always |
@@ -449,6 +460,9 @@ struct signal_struct { | |||
449 | struct key *session_keyring; /* keyring inherited over fork */ | 460 | struct key *session_keyring; /* keyring inherited over fork */ |
450 | struct key *process_keyring; /* keyring private to this process */ | 461 | struct key *process_keyring; /* keyring private to this process */ |
451 | #endif | 462 | #endif |
463 | #ifdef CONFIG_BSD_PROCESS_ACCT | ||
464 | struct pacct_struct pacct; /* per-process accounting information */ | ||
465 | #endif | ||
452 | }; | 466 | }; |
453 | 467 | ||
454 | /* Context switch must be unlocked if interrupts are to be enabled */ | 468 | /* Context switch must be unlocked if interrupts are to be enabled */ |
@@ -483,8 +497,11 @@ struct signal_struct { | |||
483 | 497 | ||
484 | #define MAX_PRIO (MAX_RT_PRIO + 40) | 498 | #define MAX_PRIO (MAX_RT_PRIO + 40) |
485 | 499 | ||
486 | #define rt_task(p) (unlikely((p)->prio < MAX_RT_PRIO)) | 500 | #define rt_prio(prio) unlikely((prio) < MAX_RT_PRIO) |
501 | #define rt_task(p) rt_prio((p)->prio) | ||
487 | #define batch_task(p) (unlikely((p)->policy == SCHED_BATCH)) | 502 | #define batch_task(p) (unlikely((p)->policy == SCHED_BATCH)) |
503 | #define has_rt_policy(p) \ | ||
504 | unlikely((p)->policy != SCHED_NORMAL && (p)->policy != SCHED_BATCH) | ||
488 | 505 | ||
489 | /* | 506 | /* |
490 | * Some day this will be a full-fledged user tracking system.. | 507 | * Some day this will be a full-fledged user tracking system.. |
@@ -494,7 +511,7 @@ struct user_struct { | |||
494 | atomic_t processes; /* How many processes does this user have? */ | 511 | atomic_t processes; /* How many processes does this user have? */ |
495 | atomic_t files; /* How many open files does this user have? */ | 512 | atomic_t files; /* How many open files does this user have? */ |
496 | atomic_t sigpending; /* How many pending signals does this user have? */ | 513 | atomic_t sigpending; /* How many pending signals does this user have? */ |
497 | #ifdef CONFIG_INOTIFY | 514 | #ifdef CONFIG_INOTIFY_USER |
498 | atomic_t inotify_watches; /* How many inotify watches does this user have? */ | 515 | atomic_t inotify_watches; /* How many inotify watches does this user have? */ |
499 | atomic_t inotify_devs; /* How many inotify devs does this user have opened? */ | 516 | atomic_t inotify_devs; /* How many inotify devs does this user have opened? */ |
500 | #endif | 517 | #endif |
@@ -547,9 +564,9 @@ enum idle_type | |||
547 | /* | 564 | /* |
548 | * sched-domains (multiprocessor balancing) declarations: | 565 | * sched-domains (multiprocessor balancing) declarations: |
549 | */ | 566 | */ |
550 | #ifdef CONFIG_SMP | ||
551 | #define SCHED_LOAD_SCALE 128UL /* increase resolution of load */ | 567 | #define SCHED_LOAD_SCALE 128UL /* increase resolution of load */ |
552 | 568 | ||
569 | #ifdef CONFIG_SMP | ||
553 | #define SD_LOAD_BALANCE 1 /* Do load balancing on this domain. */ | 570 | #define SD_LOAD_BALANCE 1 /* Do load balancing on this domain. */ |
554 | #define SD_BALANCE_NEWIDLE 2 /* Balance when about to become idle */ | 571 | #define SD_BALANCE_NEWIDLE 2 /* Balance when about to become idle */ |
555 | #define SD_BALANCE_EXEC 4 /* Balance on exec */ | 572 | #define SD_BALANCE_EXEC 4 /* Balance on exec */ |
@@ -558,6 +575,11 @@ enum idle_type | |||
558 | #define SD_WAKE_AFFINE 32 /* Wake task to waking CPU */ | 575 | #define SD_WAKE_AFFINE 32 /* Wake task to waking CPU */ |
559 | #define SD_WAKE_BALANCE 64 /* Perform balancing at task wakeup */ | 576 | #define SD_WAKE_BALANCE 64 /* Perform balancing at task wakeup */ |
560 | #define SD_SHARE_CPUPOWER 128 /* Domain members share cpu power */ | 577 | #define SD_SHARE_CPUPOWER 128 /* Domain members share cpu power */ |
578 | #define SD_POWERSAVINGS_BALANCE 256 /* Balance for power savings */ | ||
579 | |||
580 | #define BALANCE_FOR_POWER ((sched_mc_power_savings || sched_smt_power_savings) \ | ||
581 | ? SD_POWERSAVINGS_BALANCE : 0) | ||
582 | |||
561 | 583 | ||
562 | struct sched_group { | 584 | struct sched_group { |
563 | struct sched_group *next; /* Must be a circular list */ | 585 | struct sched_group *next; /* Must be a circular list */ |
@@ -627,7 +649,7 @@ struct sched_domain { | |||
627 | #endif | 649 | #endif |
628 | }; | 650 | }; |
629 | 651 | ||
630 | extern void partition_sched_domains(cpumask_t *partition1, | 652 | extern int partition_sched_domains(cpumask_t *partition1, |
631 | cpumask_t *partition2); | 653 | cpumask_t *partition2); |
632 | 654 | ||
633 | /* | 655 | /* |
@@ -702,10 +724,13 @@ struct task_struct { | |||
702 | 724 | ||
703 | int lock_depth; /* BKL lock depth */ | 725 | int lock_depth; /* BKL lock depth */ |
704 | 726 | ||
705 | #if defined(CONFIG_SMP) && defined(__ARCH_WANT_UNLOCKED_CTXSW) | 727 | #ifdef CONFIG_SMP |
728 | #ifdef __ARCH_WANT_UNLOCKED_CTXSW | ||
706 | int oncpu; | 729 | int oncpu; |
707 | #endif | 730 | #endif |
708 | int prio, static_prio; | 731 | #endif |
732 | int load_weight; /* for niceness load balancing purposes */ | ||
733 | int prio, static_prio, normal_prio; | ||
709 | struct list_head run_list; | 734 | struct list_head run_list; |
710 | prio_array_t *array; | 735 | prio_array_t *array; |
711 | 736 | ||
@@ -831,8 +856,20 @@ struct task_struct { | |||
831 | u32 self_exec_id; | 856 | u32 self_exec_id; |
832 | /* Protection of (de-)allocation: mm, files, fs, tty, keyrings */ | 857 | /* Protection of (de-)allocation: mm, files, fs, tty, keyrings */ |
833 | spinlock_t alloc_lock; | 858 | spinlock_t alloc_lock; |
834 | /* Protection of proc_dentry: nesting proc_lock, dcache_lock, write_lock_irq(&tasklist_lock); */ | 859 | |
835 | spinlock_t proc_lock; | 860 | /* Protection of the PI data structures: */ |
861 | spinlock_t pi_lock; | ||
862 | |||
863 | #ifdef CONFIG_RT_MUTEXES | ||
864 | /* PI waiters blocked on a rt_mutex held by this task */ | ||
865 | struct plist_head pi_waiters; | ||
866 | /* Deadlock detection and priority inheritance handling */ | ||
867 | struct rt_mutex_waiter *pi_blocked_on; | ||
868 | # ifdef CONFIG_DEBUG_RT_MUTEXES | ||
869 | spinlock_t held_list_lock; | ||
870 | struct list_head held_list_head; | ||
871 | # endif | ||
872 | #endif | ||
836 | 873 | ||
837 | #ifdef CONFIG_DEBUG_MUTEXES | 874 | #ifdef CONFIG_DEBUG_MUTEXES |
838 | /* mutex deadlock detection */ | 875 | /* mutex deadlock detection */ |
@@ -845,7 +882,6 @@ struct task_struct { | |||
845 | /* VM state */ | 882 | /* VM state */ |
846 | struct reclaim_state *reclaim_state; | 883 | struct reclaim_state *reclaim_state; |
847 | 884 | ||
848 | struct dentry *proc_dentry; | ||
849 | struct backing_dev_info *backing_dev_info; | 885 | struct backing_dev_info *backing_dev_info; |
850 | 886 | ||
851 | struct io_context *io_context; | 887 | struct io_context *io_context; |
@@ -880,6 +916,8 @@ struct task_struct { | |||
880 | #ifdef CONFIG_COMPAT | 916 | #ifdef CONFIG_COMPAT |
881 | struct compat_robust_list_head __user *compat_robust_list; | 917 | struct compat_robust_list_head __user *compat_robust_list; |
882 | #endif | 918 | #endif |
919 | struct list_head pi_state_list; | ||
920 | struct futex_pi_state *pi_state_cache; | ||
883 | 921 | ||
884 | atomic_t fs_excl; /* holding fs exclusive resources */ | 922 | atomic_t fs_excl; /* holding fs exclusive resources */ |
885 | struct rcu_head rcu; | 923 | struct rcu_head rcu; |
@@ -941,13 +979,13 @@ static inline void put_task_struct(struct task_struct *t) | |||
941 | #define PF_KSWAPD 0x00040000 /* I am kswapd */ | 979 | #define PF_KSWAPD 0x00040000 /* I am kswapd */ |
942 | #define PF_SWAPOFF 0x00080000 /* I am in swapoff */ | 980 | #define PF_SWAPOFF 0x00080000 /* I am in swapoff */ |
943 | #define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */ | 981 | #define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */ |
944 | #define PF_SYNCWRITE 0x00200000 /* I am doing a sync write */ | 982 | #define PF_BORROWED_MM 0x00200000 /* I am a kthread doing use_mm */ |
945 | #define PF_BORROWED_MM 0x00400000 /* I am a kthread doing use_mm */ | 983 | #define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */ |
946 | #define PF_RANDOMIZE 0x00800000 /* randomize virtual address space */ | 984 | #define PF_SWAPWRITE 0x00800000 /* Allowed to write to swap */ |
947 | #define PF_SWAPWRITE 0x01000000 /* Allowed to write to swap */ | 985 | #define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */ |
948 | #define PF_SPREAD_PAGE 0x04000000 /* Spread page cache over cpuset */ | 986 | #define PF_SPREAD_SLAB 0x02000000 /* Spread some slab caches over cpuset */ |
949 | #define PF_SPREAD_SLAB 0x08000000 /* Spread some slab caches over cpuset */ | ||
950 | #define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ | 987 | #define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ |
988 | #define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ | ||
951 | 989 | ||
952 | /* | 990 | /* |
953 | * Only the _current_ task can read/write to tsk->flags, but other | 991 | * Only the _current_ task can read/write to tsk->flags, but other |
@@ -1002,6 +1040,19 @@ static inline void idle_task_exit(void) {} | |||
1002 | #endif | 1040 | #endif |
1003 | 1041 | ||
1004 | extern void sched_idle_next(void); | 1042 | extern void sched_idle_next(void); |
1043 | |||
1044 | #ifdef CONFIG_RT_MUTEXES | ||
1045 | extern int rt_mutex_getprio(task_t *p); | ||
1046 | extern void rt_mutex_setprio(task_t *p, int prio); | ||
1047 | extern void rt_mutex_adjust_pi(task_t *p); | ||
1048 | #else | ||
1049 | static inline int rt_mutex_getprio(task_t *p) | ||
1050 | { | ||
1051 | return p->normal_prio; | ||
1052 | } | ||
1053 | # define rt_mutex_adjust_pi(p) do { } while (0) | ||
1054 | #endif | ||
1055 | |||
1005 | extern void set_user_nice(task_t *p, long nice); | 1056 | extern void set_user_nice(task_t *p, long nice); |
1006 | extern int task_prio(const task_t *p); | 1057 | extern int task_prio(const task_t *p); |
1007 | extern int task_nice(const task_t *p); | 1058 | extern int task_nice(const task_t *p); |
@@ -1102,7 +1153,7 @@ extern int force_sig_info(int, struct siginfo *, struct task_struct *); | |||
1102 | extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp); | 1153 | extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp); |
1103 | extern int kill_pg_info(int, struct siginfo *, pid_t); | 1154 | extern int kill_pg_info(int, struct siginfo *, pid_t); |
1104 | extern int kill_proc_info(int, struct siginfo *, pid_t); | 1155 | extern int kill_proc_info(int, struct siginfo *, pid_t); |
1105 | extern int kill_proc_info_as_uid(int, struct siginfo *, pid_t, uid_t, uid_t); | 1156 | extern int kill_proc_info_as_uid(int, struct siginfo *, pid_t, uid_t, uid_t, u32); |
1106 | extern void do_notify_parent(struct task_struct *, int); | 1157 | extern void do_notify_parent(struct task_struct *, int); |
1107 | extern void force_sig(int, struct task_struct *); | 1158 | extern void force_sig(int, struct task_struct *); |
1108 | extern void force_sig_specific(int, struct task_struct *); | 1159 | extern void force_sig_specific(int, struct task_struct *); |
@@ -1225,7 +1276,7 @@ static inline int thread_group_empty(task_t *p) | |||
1225 | (thread_group_leader(p) && !thread_group_empty(p)) | 1276 | (thread_group_leader(p) && !thread_group_empty(p)) |
1226 | 1277 | ||
1227 | /* | 1278 | /* |
1228 | * Protects ->fs, ->files, ->mm, ->ptrace, ->group_info, ->comm, keyring | 1279 | * Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring |
1229 | * subscriptions and synchronises with wait4(). Also used in procfs. Also | 1280 | * subscriptions and synchronises with wait4(). Also used in procfs. Also |
1230 | * pins the final release of task.io_context. Also protects ->cpuset. | 1281 | * pins the final release of task.io_context. Also protects ->cpuset. |
1231 | * | 1282 | * |
@@ -1401,6 +1452,11 @@ static inline void arch_pick_mmap_layout(struct mm_struct *mm) | |||
1401 | extern long sched_setaffinity(pid_t pid, cpumask_t new_mask); | 1452 | extern long sched_setaffinity(pid_t pid, cpumask_t new_mask); |
1402 | extern long sched_getaffinity(pid_t pid, cpumask_t *mask); | 1453 | extern long sched_getaffinity(pid_t pid, cpumask_t *mask); |
1403 | 1454 | ||
1455 | #include <linux/sysdev.h> | ||
1456 | extern int sched_mc_power_savings, sched_smt_power_savings; | ||
1457 | extern struct sysdev_attribute attr_sched_mc_power_savings, attr_sched_smt_power_savings; | ||
1458 | extern int sched_create_sysfs_power_savings_entries(struct sysdev_class *cls); | ||
1459 | |||
1404 | extern void normalize_rt_tasks(void); | 1460 | extern void normalize_rt_tasks(void); |
1405 | 1461 | ||
1406 | #ifdef CONFIG_PM | 1462 | #ifdef CONFIG_PM |
diff --git a/include/linux/scx200.h b/include/linux/scx200.h index a22f9e173ad2..693c0557e70b 100644 --- a/include/linux/scx200.h +++ b/include/linux/scx200.h | |||
@@ -49,10 +49,3 @@ extern unsigned scx200_cb_base; | |||
49 | #define SCx200_REV 0x3d /* Revision Register */ | 49 | #define SCx200_REV 0x3d /* Revision Register */ |
50 | #define SCx200_CBA 0x3e /* Configuration Base Address Register */ | 50 | #define SCx200_CBA 0x3e /* Configuration Base Address Register */ |
51 | #define SCx200_CBA_SCRATCH 0x64 /* Configuration Base Address Scratchpad */ | 51 | #define SCx200_CBA_SCRATCH 0x64 /* Configuration Base Address Scratchpad */ |
52 | |||
53 | /* | ||
54 | Local variables: | ||
55 | compile-command: "make -C ../.. bzImage modules" | ||
56 | c-basic-offset: 8 | ||
57 | End: | ||
58 | */ | ||
diff --git a/include/linux/scx200_gpio.h b/include/linux/scx200_gpio.h index 30cdd648ba79..90dd069cc145 100644 --- a/include/linux/scx200_gpio.h +++ b/include/linux/scx200_gpio.h | |||
@@ -1,6 +1,6 @@ | |||
1 | #include <linux/spinlock.h> | 1 | #include <linux/spinlock.h> |
2 | 2 | ||
3 | u32 scx200_gpio_configure(int index, u32 set, u32 clear); | 3 | u32 scx200_gpio_configure(unsigned index, u32 set, u32 clear); |
4 | 4 | ||
5 | extern unsigned scx200_gpio_base; | 5 | extern unsigned scx200_gpio_base; |
6 | extern long scx200_gpio_shadow[2]; | 6 | extern long scx200_gpio_shadow[2]; |
@@ -17,7 +17,7 @@ extern long scx200_gpio_shadow[2]; | |||
17 | 17 | ||
18 | /* returns the value of the GPIO pin */ | 18 | /* returns the value of the GPIO pin */ |
19 | 19 | ||
20 | static inline int scx200_gpio_get(int index) { | 20 | static inline int scx200_gpio_get(unsigned index) { |
21 | __SCx200_GPIO_BANK; | 21 | __SCx200_GPIO_BANK; |
22 | __SCx200_GPIO_IOADDR + 0x04; | 22 | __SCx200_GPIO_IOADDR + 0x04; |
23 | __SCx200_GPIO_INDEX; | 23 | __SCx200_GPIO_INDEX; |
@@ -29,7 +29,7 @@ static inline int scx200_gpio_get(int index) { | |||
29 | driven if the GPIO is configured as an output, it might not be the | 29 | driven if the GPIO is configured as an output, it might not be the |
30 | state of the GPIO right now if the GPIO is configured as an input) */ | 30 | state of the GPIO right now if the GPIO is configured as an input) */ |
31 | 31 | ||
32 | static inline int scx200_gpio_current(int index) { | 32 | static inline int scx200_gpio_current(unsigned index) { |
33 | __SCx200_GPIO_BANK; | 33 | __SCx200_GPIO_BANK; |
34 | __SCx200_GPIO_INDEX; | 34 | __SCx200_GPIO_INDEX; |
35 | 35 | ||
@@ -38,7 +38,7 @@ static inline int scx200_gpio_current(int index) { | |||
38 | 38 | ||
39 | /* drive the GPIO signal high */ | 39 | /* drive the GPIO signal high */ |
40 | 40 | ||
41 | static inline void scx200_gpio_set_high(int index) { | 41 | static inline void scx200_gpio_set_high(unsigned index) { |
42 | __SCx200_GPIO_BANK; | 42 | __SCx200_GPIO_BANK; |
43 | __SCx200_GPIO_IOADDR; | 43 | __SCx200_GPIO_IOADDR; |
44 | __SCx200_GPIO_SHADOW; | 44 | __SCx200_GPIO_SHADOW; |
@@ -49,7 +49,7 @@ static inline void scx200_gpio_set_high(int index) { | |||
49 | 49 | ||
50 | /* drive the GPIO signal low */ | 50 | /* drive the GPIO signal low */ |
51 | 51 | ||
52 | static inline void scx200_gpio_set_low(int index) { | 52 | static inline void scx200_gpio_set_low(unsigned index) { |
53 | __SCx200_GPIO_BANK; | 53 | __SCx200_GPIO_BANK; |
54 | __SCx200_GPIO_IOADDR; | 54 | __SCx200_GPIO_IOADDR; |
55 | __SCx200_GPIO_SHADOW; | 55 | __SCx200_GPIO_SHADOW; |
@@ -60,7 +60,7 @@ static inline void scx200_gpio_set_low(int index) { | |||
60 | 60 | ||
61 | /* drive the GPIO signal to state */ | 61 | /* drive the GPIO signal to state */ |
62 | 62 | ||
63 | static inline void scx200_gpio_set(int index, int state) { | 63 | static inline void scx200_gpio_set(unsigned index, int state) { |
64 | __SCx200_GPIO_BANK; | 64 | __SCx200_GPIO_BANK; |
65 | __SCx200_GPIO_IOADDR; | 65 | __SCx200_GPIO_IOADDR; |
66 | __SCx200_GPIO_SHADOW; | 66 | __SCx200_GPIO_SHADOW; |
@@ -73,7 +73,7 @@ static inline void scx200_gpio_set(int index, int state) { | |||
73 | } | 73 | } |
74 | 74 | ||
75 | /* toggle the GPIO signal */ | 75 | /* toggle the GPIO signal */ |
76 | static inline void scx200_gpio_change(int index) { | 76 | static inline void scx200_gpio_change(unsigned index) { |
77 | __SCx200_GPIO_BANK; | 77 | __SCx200_GPIO_BANK; |
78 | __SCx200_GPIO_IOADDR; | 78 | __SCx200_GPIO_IOADDR; |
79 | __SCx200_GPIO_SHADOW; | 79 | __SCx200_GPIO_SHADOW; |
@@ -87,10 +87,3 @@ static inline void scx200_gpio_change(int index) { | |||
87 | #undef __SCx200_GPIO_SHADOW | 87 | #undef __SCx200_GPIO_SHADOW |
88 | #undef __SCx200_GPIO_INDEX | 88 | #undef __SCx200_GPIO_INDEX |
89 | #undef __SCx200_GPIO_OUT | 89 | #undef __SCx200_GPIO_OUT |
90 | |||
91 | /* | ||
92 | Local variables: | ||
93 | compile-command: "make -C ../.. bzImage modules" | ||
94 | c-basic-offset: 8 | ||
95 | End: | ||
96 | */ | ||
diff --git a/include/linux/seccomp.h b/include/linux/seccomp.h index cd2773b29a64..3e8b1cf54303 100644 --- a/include/linux/seccomp.h +++ b/include/linux/seccomp.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _LINUX_SECCOMP_H | 1 | #ifndef _LINUX_SECCOMP_H |
2 | #define _LINUX_SECCOMP_H | 2 | #define _LINUX_SECCOMP_H |
3 | 3 | ||
4 | #include <linux/config.h> | ||
5 | 4 | ||
6 | #ifdef CONFIG_SECCOMP | 5 | #ifdef CONFIG_SECCOMP |
7 | 6 | ||
diff --git a/include/linux/security.h b/include/linux/security.h index 4dfb1b84a9b3..f75303831d09 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -67,7 +67,7 @@ struct xfrm_state; | |||
67 | struct xfrm_user_sec_ctx; | 67 | struct xfrm_user_sec_ctx; |
68 | 68 | ||
69 | extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb); | 69 | extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb); |
70 | extern int cap_netlink_recv(struct sk_buff *skb); | 70 | extern int cap_netlink_recv(struct sk_buff *skb, int cap); |
71 | 71 | ||
72 | /* | 72 | /* |
73 | * Values used in the task_security_ops calls | 73 | * Values used in the task_security_ops calls |
@@ -171,9 +171,9 @@ struct swap_info_struct; | |||
171 | * Deallocate and clear the sb->s_security field. | 171 | * Deallocate and clear the sb->s_security field. |
172 | * @sb contains the super_block structure to be modified. | 172 | * @sb contains the super_block structure to be modified. |
173 | * @sb_statfs: | 173 | * @sb_statfs: |
174 | * Check permission before obtaining filesystem statistics for the @sb | 174 | * Check permission before obtaining filesystem statistics for the @mnt |
175 | * filesystem. | 175 | * mountpoint. |
176 | * @sb contains the super_block structure for the filesystem. | 176 | * @dentry is a handle on the superblock for the filesystem. |
177 | * Return 0 if permission is granted. | 177 | * Return 0 if permission is granted. |
178 | * @sb_mount: | 178 | * @sb_mount: |
179 | * Check permission before an object specified by @dev_name is mounted on | 179 | * Check permission before an object specified by @dev_name is mounted on |
@@ -567,6 +567,9 @@ struct swap_info_struct; | |||
567 | * @p. | 567 | * @p. |
568 | * @p contains the task_struct for the process. | 568 | * @p contains the task_struct for the process. |
569 | * Return 0 if permission is granted. | 569 | * Return 0 if permission is granted. |
570 | * @task_getsecid: | ||
571 | * Retrieve the security identifier of the process @p. | ||
572 | * @p contains the task_struct for the process and place is into @secid. | ||
570 | * @task_setgroups: | 573 | * @task_setgroups: |
571 | * Check permission before setting the supplementary group set of the | 574 | * Check permission before setting the supplementary group set of the |
572 | * current process. | 575 | * current process. |
@@ -577,6 +580,15 @@ struct swap_info_struct; | |||
577 | * @p contains the task_struct of process. | 580 | * @p contains the task_struct of process. |
578 | * @nice contains the new nice value. | 581 | * @nice contains the new nice value. |
579 | * Return 0 if permission is granted. | 582 | * Return 0 if permission is granted. |
583 | * @task_setioprio | ||
584 | * Check permission before setting the ioprio value of @p to @ioprio. | ||
585 | * @p contains the task_struct of process. | ||
586 | * @ioprio contains the new ioprio value | ||
587 | * Return 0 if permission is granted. | ||
588 | * @task_getioprio | ||
589 | * Check permission before getting the ioprio value of @p. | ||
590 | * @p contains the task_struct of process. | ||
591 | * Return 0 if permission is granted. | ||
580 | * @task_setrlimit: | 592 | * @task_setrlimit: |
581 | * Check permission before setting the resource limits of the current | 593 | * Check permission before setting the resource limits of the current |
582 | * process for @resource to @new_rlim. The old resource limit values can | 594 | * process for @resource to @new_rlim. The old resource limit values can |
@@ -596,6 +608,10 @@ struct swap_info_struct; | |||
596 | * @p. | 608 | * @p. |
597 | * @p contains the task_struct for process. | 609 | * @p contains the task_struct for process. |
598 | * Return 0 if permission is granted. | 610 | * Return 0 if permission is granted. |
611 | * @task_movememory | ||
612 | * Check permission before moving memory owned by process @p. | ||
613 | * @p contains the task_struct for process. | ||
614 | * Return 0 if permission is granted. | ||
599 | * @task_kill: | 615 | * @task_kill: |
600 | * Check permission before sending signal @sig to @p. @info can be NULL, | 616 | * Check permission before sending signal @sig to @p. @info can be NULL, |
601 | * the constant 1, or a pointer to a siginfo structure. If @info is 1 or | 617 | * the constant 1, or a pointer to a siginfo structure. If @info is 1 or |
@@ -606,6 +622,7 @@ struct swap_info_struct; | |||
606 | * @p contains the task_struct for process. | 622 | * @p contains the task_struct for process. |
607 | * @info contains the signal information. | 623 | * @info contains the signal information. |
608 | * @sig contains the signal value. | 624 | * @sig contains the signal value. |
625 | * @secid contains the sid of the process where the signal originated | ||
609 | * Return 0 if permission is granted. | 626 | * Return 0 if permission is granted. |
610 | * @task_wait: | 627 | * @task_wait: |
611 | * Check permission before allowing a process to reap a child process @p | 628 | * Check permission before allowing a process to reap a child process @p |
@@ -647,6 +664,7 @@ struct swap_info_struct; | |||
647 | * Check permission before processing the received netlink message in | 664 | * Check permission before processing the received netlink message in |
648 | * @skb. | 665 | * @skb. |
649 | * @skb contains the sk_buff structure for the netlink message. | 666 | * @skb contains the sk_buff structure for the netlink message. |
667 | * @cap indicates the capability required | ||
650 | * Return 0 if permission is granted. | 668 | * Return 0 if permission is granted. |
651 | * | 669 | * |
652 | * Security hooks for Unix domain networking. | 670 | * Security hooks for Unix domain networking. |
@@ -853,6 +871,7 @@ struct swap_info_struct; | |||
853 | * Permit allocation of a key and assign security data. Note that key does | 871 | * Permit allocation of a key and assign security data. Note that key does |
854 | * not have a serial number assigned at this point. | 872 | * not have a serial number assigned at this point. |
855 | * @key points to the key. | 873 | * @key points to the key. |
874 | * @flags is the allocation flags | ||
856 | * Return 0 if permission is granted, -ve error otherwise. | 875 | * Return 0 if permission is granted, -ve error otherwise. |
857 | * @key_free: | 876 | * @key_free: |
858 | * Notification of destruction; free security data. | 877 | * Notification of destruction; free security data. |
@@ -1127,7 +1146,7 @@ struct security_operations { | |||
1127 | int (*sb_copy_data)(struct file_system_type *type, | 1146 | int (*sb_copy_data)(struct file_system_type *type, |
1128 | void *orig, void *copy); | 1147 | void *orig, void *copy); |
1129 | int (*sb_kern_mount) (struct super_block *sb, void *data); | 1148 | int (*sb_kern_mount) (struct super_block *sb, void *data); |
1130 | int (*sb_statfs) (struct super_block * sb); | 1149 | int (*sb_statfs) (struct dentry *dentry); |
1131 | int (*sb_mount) (char *dev_name, struct nameidata * nd, | 1150 | int (*sb_mount) (char *dev_name, struct nameidata * nd, |
1132 | char *type, unsigned long flags, void *data); | 1151 | char *type, unsigned long flags, void *data); |
1133 | int (*sb_check_sb) (struct vfsmount * mnt, struct nameidata * nd); | 1152 | int (*sb_check_sb) (struct vfsmount * mnt, struct nameidata * nd); |
@@ -1208,14 +1227,18 @@ struct security_operations { | |||
1208 | int (*task_setpgid) (struct task_struct * p, pid_t pgid); | 1227 | int (*task_setpgid) (struct task_struct * p, pid_t pgid); |
1209 | int (*task_getpgid) (struct task_struct * p); | 1228 | int (*task_getpgid) (struct task_struct * p); |
1210 | int (*task_getsid) (struct task_struct * p); | 1229 | int (*task_getsid) (struct task_struct * p); |
1230 | void (*task_getsecid) (struct task_struct * p, u32 * secid); | ||
1211 | int (*task_setgroups) (struct group_info *group_info); | 1231 | int (*task_setgroups) (struct group_info *group_info); |
1212 | int (*task_setnice) (struct task_struct * p, int nice); | 1232 | int (*task_setnice) (struct task_struct * p, int nice); |
1233 | int (*task_setioprio) (struct task_struct * p, int ioprio); | ||
1234 | int (*task_getioprio) (struct task_struct * p); | ||
1213 | int (*task_setrlimit) (unsigned int resource, struct rlimit * new_rlim); | 1235 | int (*task_setrlimit) (unsigned int resource, struct rlimit * new_rlim); |
1214 | int (*task_setscheduler) (struct task_struct * p, int policy, | 1236 | int (*task_setscheduler) (struct task_struct * p, int policy, |
1215 | struct sched_param * lp); | 1237 | struct sched_param * lp); |
1216 | int (*task_getscheduler) (struct task_struct * p); | 1238 | int (*task_getscheduler) (struct task_struct * p); |
1239 | int (*task_movememory) (struct task_struct * p); | ||
1217 | int (*task_kill) (struct task_struct * p, | 1240 | int (*task_kill) (struct task_struct * p, |
1218 | struct siginfo * info, int sig); | 1241 | struct siginfo * info, int sig, u32 secid); |
1219 | int (*task_wait) (struct task_struct * p); | 1242 | int (*task_wait) (struct task_struct * p); |
1220 | int (*task_prctl) (int option, unsigned long arg2, | 1243 | int (*task_prctl) (int option, unsigned long arg2, |
1221 | unsigned long arg3, unsigned long arg4, | 1244 | unsigned long arg3, unsigned long arg4, |
@@ -1254,7 +1277,7 @@ struct security_operations { | |||
1254 | struct sembuf * sops, unsigned nsops, int alter); | 1277 | struct sembuf * sops, unsigned nsops, int alter); |
1255 | 1278 | ||
1256 | int (*netlink_send) (struct sock * sk, struct sk_buff * skb); | 1279 | int (*netlink_send) (struct sock * sk, struct sk_buff * skb); |
1257 | int (*netlink_recv) (struct sk_buff * skb); | 1280 | int (*netlink_recv) (struct sk_buff * skb, int cap); |
1258 | 1281 | ||
1259 | /* allow module stacking */ | 1282 | /* allow module stacking */ |
1260 | int (*register_security) (const char *name, | 1283 | int (*register_security) (const char *name, |
@@ -1313,7 +1336,7 @@ struct security_operations { | |||
1313 | 1336 | ||
1314 | /* key management security hooks */ | 1337 | /* key management security hooks */ |
1315 | #ifdef CONFIG_KEYS | 1338 | #ifdef CONFIG_KEYS |
1316 | int (*key_alloc)(struct key *key); | 1339 | int (*key_alloc)(struct key *key, struct task_struct *tsk, unsigned long flags); |
1317 | void (*key_free)(struct key *key); | 1340 | void (*key_free)(struct key *key); |
1318 | int (*key_permission)(key_ref_t key_ref, | 1341 | int (*key_permission)(key_ref_t key_ref, |
1319 | struct task_struct *context, | 1342 | struct task_struct *context, |
@@ -1450,9 +1473,9 @@ static inline int security_sb_kern_mount (struct super_block *sb, void *data) | |||
1450 | return security_ops->sb_kern_mount (sb, data); | 1473 | return security_ops->sb_kern_mount (sb, data); |
1451 | } | 1474 | } |
1452 | 1475 | ||
1453 | static inline int security_sb_statfs (struct super_block *sb) | 1476 | static inline int security_sb_statfs (struct dentry *dentry) |
1454 | { | 1477 | { |
1455 | return security_ops->sb_statfs (sb); | 1478 | return security_ops->sb_statfs (dentry); |
1456 | } | 1479 | } |
1457 | 1480 | ||
1458 | static inline int security_sb_mount (char *dev_name, struct nameidata *nd, | 1481 | static inline int security_sb_mount (char *dev_name, struct nameidata *nd, |
@@ -1826,6 +1849,11 @@ static inline int security_task_getsid (struct task_struct *p) | |||
1826 | return security_ops->task_getsid (p); | 1849 | return security_ops->task_getsid (p); |
1827 | } | 1850 | } |
1828 | 1851 | ||
1852 | static inline void security_task_getsecid (struct task_struct *p, u32 *secid) | ||
1853 | { | ||
1854 | security_ops->task_getsecid (p, secid); | ||
1855 | } | ||
1856 | |||
1829 | static inline int security_task_setgroups (struct group_info *group_info) | 1857 | static inline int security_task_setgroups (struct group_info *group_info) |
1830 | { | 1858 | { |
1831 | return security_ops->task_setgroups (group_info); | 1859 | return security_ops->task_setgroups (group_info); |
@@ -1836,6 +1864,16 @@ static inline int security_task_setnice (struct task_struct *p, int nice) | |||
1836 | return security_ops->task_setnice (p, nice); | 1864 | return security_ops->task_setnice (p, nice); |
1837 | } | 1865 | } |
1838 | 1866 | ||
1867 | static inline int security_task_setioprio (struct task_struct *p, int ioprio) | ||
1868 | { | ||
1869 | return security_ops->task_setioprio (p, ioprio); | ||
1870 | } | ||
1871 | |||
1872 | static inline int security_task_getioprio (struct task_struct *p) | ||
1873 | { | ||
1874 | return security_ops->task_getioprio (p); | ||
1875 | } | ||
1876 | |||
1839 | static inline int security_task_setrlimit (unsigned int resource, | 1877 | static inline int security_task_setrlimit (unsigned int resource, |
1840 | struct rlimit *new_rlim) | 1878 | struct rlimit *new_rlim) |
1841 | { | 1879 | { |
@@ -1854,10 +1892,16 @@ static inline int security_task_getscheduler (struct task_struct *p) | |||
1854 | return security_ops->task_getscheduler (p); | 1892 | return security_ops->task_getscheduler (p); |
1855 | } | 1893 | } |
1856 | 1894 | ||
1895 | static inline int security_task_movememory (struct task_struct *p) | ||
1896 | { | ||
1897 | return security_ops->task_movememory (p); | ||
1898 | } | ||
1899 | |||
1857 | static inline int security_task_kill (struct task_struct *p, | 1900 | static inline int security_task_kill (struct task_struct *p, |
1858 | struct siginfo *info, int sig) | 1901 | struct siginfo *info, int sig, |
1902 | u32 secid) | ||
1859 | { | 1903 | { |
1860 | return security_ops->task_kill (p, info, sig); | 1904 | return security_ops->task_kill (p, info, sig, secid); |
1861 | } | 1905 | } |
1862 | 1906 | ||
1863 | static inline int security_task_wait (struct task_struct *p) | 1907 | static inline int security_task_wait (struct task_struct *p) |
@@ -2010,9 +2054,9 @@ static inline int security_netlink_send(struct sock *sk, struct sk_buff * skb) | |||
2010 | return security_ops->netlink_send(sk, skb); | 2054 | return security_ops->netlink_send(sk, skb); |
2011 | } | 2055 | } |
2012 | 2056 | ||
2013 | static inline int security_netlink_recv(struct sk_buff * skb) | 2057 | static inline int security_netlink_recv(struct sk_buff * skb, int cap) |
2014 | { | 2058 | { |
2015 | return security_ops->netlink_recv(skb); | 2059 | return security_ops->netlink_recv(skb, cap); |
2016 | } | 2060 | } |
2017 | 2061 | ||
2018 | /* prototypes */ | 2062 | /* prototypes */ |
@@ -2162,7 +2206,7 @@ static inline int security_sb_kern_mount (struct super_block *sb, void *data) | |||
2162 | return 0; | 2206 | return 0; |
2163 | } | 2207 | } |
2164 | 2208 | ||
2165 | static inline int security_sb_statfs (struct super_block *sb) | 2209 | static inline int security_sb_statfs (struct dentry *dentry) |
2166 | { | 2210 | { |
2167 | return 0; | 2211 | return 0; |
2168 | } | 2212 | } |
@@ -2468,6 +2512,9 @@ static inline int security_task_getsid (struct task_struct *p) | |||
2468 | return 0; | 2512 | return 0; |
2469 | } | 2513 | } |
2470 | 2514 | ||
2515 | static inline void security_task_getsecid (struct task_struct *p, u32 *secid) | ||
2516 | { } | ||
2517 | |||
2471 | static inline int security_task_setgroups (struct group_info *group_info) | 2518 | static inline int security_task_setgroups (struct group_info *group_info) |
2472 | { | 2519 | { |
2473 | return 0; | 2520 | return 0; |
@@ -2478,6 +2525,16 @@ static inline int security_task_setnice (struct task_struct *p, int nice) | |||
2478 | return 0; | 2525 | return 0; |
2479 | } | 2526 | } |
2480 | 2527 | ||
2528 | static inline int security_task_setioprio (struct task_struct *p, int ioprio) | ||
2529 | { | ||
2530 | return 0; | ||
2531 | } | ||
2532 | |||
2533 | static inline int security_task_getioprio (struct task_struct *p) | ||
2534 | { | ||
2535 | return 0; | ||
2536 | } | ||
2537 | |||
2481 | static inline int security_task_setrlimit (unsigned int resource, | 2538 | static inline int security_task_setrlimit (unsigned int resource, |
2482 | struct rlimit *new_rlim) | 2539 | struct rlimit *new_rlim) |
2483 | { | 2540 | { |
@@ -2496,8 +2553,14 @@ static inline int security_task_getscheduler (struct task_struct *p) | |||
2496 | return 0; | 2553 | return 0; |
2497 | } | 2554 | } |
2498 | 2555 | ||
2556 | static inline int security_task_movememory (struct task_struct *p) | ||
2557 | { | ||
2558 | return 0; | ||
2559 | } | ||
2560 | |||
2499 | static inline int security_task_kill (struct task_struct *p, | 2561 | static inline int security_task_kill (struct task_struct *p, |
2500 | struct siginfo *info, int sig) | 2562 | struct siginfo *info, int sig, |
2563 | u32 secid) | ||
2501 | { | 2564 | { |
2502 | return 0; | 2565 | return 0; |
2503 | } | 2566 | } |
@@ -2638,9 +2701,9 @@ static inline int security_netlink_send (struct sock *sk, struct sk_buff *skb) | |||
2638 | return cap_netlink_send (sk, skb); | 2701 | return cap_netlink_send (sk, skb); |
2639 | } | 2702 | } |
2640 | 2703 | ||
2641 | static inline int security_netlink_recv (struct sk_buff *skb) | 2704 | static inline int security_netlink_recv (struct sk_buff *skb, int cap) |
2642 | { | 2705 | { |
2643 | return cap_netlink_recv (skb); | 2706 | return cap_netlink_recv (skb, cap); |
2644 | } | 2707 | } |
2645 | 2708 | ||
2646 | static inline struct dentry *securityfs_create_dir(const char *name, | 2709 | static inline struct dentry *securityfs_create_dir(const char *name, |
@@ -3008,9 +3071,11 @@ static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 sk_sid | |||
3008 | 3071 | ||
3009 | #ifdef CONFIG_KEYS | 3072 | #ifdef CONFIG_KEYS |
3010 | #ifdef CONFIG_SECURITY | 3073 | #ifdef CONFIG_SECURITY |
3011 | static inline int security_key_alloc(struct key *key) | 3074 | static inline int security_key_alloc(struct key *key, |
3075 | struct task_struct *tsk, | ||
3076 | unsigned long flags) | ||
3012 | { | 3077 | { |
3013 | return security_ops->key_alloc(key); | 3078 | return security_ops->key_alloc(key, tsk, flags); |
3014 | } | 3079 | } |
3015 | 3080 | ||
3016 | static inline void security_key_free(struct key *key) | 3081 | static inline void security_key_free(struct key *key) |
@@ -3027,7 +3092,9 @@ static inline int security_key_permission(key_ref_t key_ref, | |||
3027 | 3092 | ||
3028 | #else | 3093 | #else |
3029 | 3094 | ||
3030 | static inline int security_key_alloc(struct key *key) | 3095 | static inline int security_key_alloc(struct key *key, |
3096 | struct task_struct *tsk, | ||
3097 | unsigned long flags) | ||
3031 | { | 3098 | { |
3032 | return 0; | 3099 | return 0; |
3033 | } | 3100 | } |
diff --git a/include/linux/sem.h b/include/linux/sem.h index 3c1f1120fe88..9aaffb0b1d81 100644 --- a/include/linux/sem.h +++ b/include/linux/sem.h | |||
@@ -2,7 +2,6 @@ | |||
2 | #define _LINUX_SEM_H | 2 | #define _LINUX_SEM_H |
3 | 3 | ||
4 | #include <linux/ipc.h> | 4 | #include <linux/ipc.h> |
5 | #include <asm/atomic.h> | ||
6 | 5 | ||
7 | /* semop flags */ | 6 | /* semop flags */ |
8 | #define SEM_UNDO 0x1000 /* undo the operation on exit */ | 7 | #define SEM_UNDO 0x1000 /* undo the operation on exit */ |
@@ -78,6 +77,7 @@ struct seminfo { | |||
78 | #define SEMUSZ 20 /* sizeof struct sem_undo */ | 77 | #define SEMUSZ 20 /* sizeof struct sem_undo */ |
79 | 78 | ||
80 | #ifdef __KERNEL__ | 79 | #ifdef __KERNEL__ |
80 | #include <asm/atomic.h> | ||
81 | 81 | ||
82 | struct task_struct; | 82 | struct task_struct; |
83 | 83 | ||
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index 5a095572881d..7bc5c7c12b54 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h | |||
@@ -26,7 +26,6 @@ | |||
26 | * by Keith Owens and Andrea Arcangeli | 26 | * by Keith Owens and Andrea Arcangeli |
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include <linux/config.h> | ||
30 | #include <linux/spinlock.h> | 29 | #include <linux/spinlock.h> |
31 | #include <linux/preempt.h> | 30 | #include <linux/preempt.h> |
32 | 31 | ||
diff --git a/include/linux/serialP.h b/include/linux/serialP.h index 2b9e6b9554d5..e811a615f696 100644 --- a/include/linux/serialP.h +++ b/include/linux/serialP.h | |||
@@ -19,7 +19,6 @@ | |||
19 | * For definitions of the flags field, see tty.h | 19 | * For definitions of the flags field, see tty.h |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <linux/config.h> | ||
23 | #include <linux/termios.h> | 22 | #include <linux/termios.h> |
24 | #include <linux/workqueue.h> | 23 | #include <linux/workqueue.h> |
25 | #include <linux/interrupt.h> | 24 | #include <linux/interrupt.h> |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index bd14858121ea..fc1104a2cfa9 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -67,8 +67,8 @@ | |||
67 | /* Parisc type numbers. */ | 67 | /* Parisc type numbers. */ |
68 | #define PORT_MUX 48 | 68 | #define PORT_MUX 48 |
69 | 69 | ||
70 | /* Atmel AT91RM9200 SoC */ | 70 | /* Atmel AT91xxx SoC */ |
71 | #define PORT_AT91RM9200 49 | 71 | #define PORT_AT91 49 |
72 | 72 | ||
73 | /* Macintosh Zilog type numbers */ | 73 | /* Macintosh Zilog type numbers */ |
74 | #define PORT_MAC_ZILOG 50 /* m68k : not yet implemented */ | 74 | #define PORT_MAC_ZILOG 50 /* m68k : not yet implemented */ |
@@ -130,9 +130,11 @@ | |||
130 | /* SUN4V Hypervisor Console */ | 130 | /* SUN4V Hypervisor Console */ |
131 | #define PORT_SUNHV 72 | 131 | #define PORT_SUNHV 72 |
132 | 132 | ||
133 | #define PORT_S3C2412 73 | ||
134 | |||
135 | |||
133 | #ifdef __KERNEL__ | 136 | #ifdef __KERNEL__ |
134 | 137 | ||
135 | #include <linux/config.h> | ||
136 | #include <linux/compiler.h> | 138 | #include <linux/compiler.h> |
137 | #include <linux/interrupt.h> | 139 | #include <linux/interrupt.h> |
138 | #include <linux/circ_buf.h> | 140 | #include <linux/circ_buf.h> |
@@ -334,7 +336,6 @@ struct uart_driver { | |||
334 | struct module *owner; | 336 | struct module *owner; |
335 | const char *driver_name; | 337 | const char *driver_name; |
336 | const char *dev_name; | 338 | const char *dev_name; |
337 | const char *devfs_name; | ||
338 | int major; | 339 | int major; |
339 | int minor; | 340 | int minor; |
340 | int nr; | 341 | int nr; |
diff --git a/include/linux/signal.h b/include/linux/signal.h index 70739f51a09f..117135e33d67 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h | |||
@@ -1,38 +1,12 @@ | |||
1 | #ifndef _LINUX_SIGNAL_H | 1 | #ifndef _LINUX_SIGNAL_H |
2 | #define _LINUX_SIGNAL_H | 2 | #define _LINUX_SIGNAL_H |
3 | 3 | ||
4 | #include <linux/list.h> | ||
5 | #include <linux/spinlock.h> | ||
6 | #include <asm/signal.h> | 4 | #include <asm/signal.h> |
7 | #include <asm/siginfo.h> | 5 | #include <asm/siginfo.h> |
8 | 6 | ||
9 | #ifdef __KERNEL__ | 7 | #ifdef __KERNEL__ |
10 | 8 | #include <linux/list.h> | |
11 | /* | 9 | #include <linux/spinlock.h> |
12 | * These values of sa_flags are used only by the kernel as part of the | ||
13 | * irq handling routines. | ||
14 | * | ||
15 | * SA_INTERRUPT is also used by the irq handling routines. | ||
16 | * SA_SHIRQ is for shared interrupt support on PCI and EISA. | ||
17 | * SA_PROBEIRQ is set by callers when they expect sharing mismatches to occur | ||
18 | */ | ||
19 | #define SA_SAMPLE_RANDOM SA_RESTART | ||
20 | #define SA_SHIRQ 0x04000000 | ||
21 | #define SA_PROBEIRQ 0x08000000 | ||
22 | |||
23 | /* | ||
24 | * As above, these correspond to the IORESOURCE_IRQ_* defines in | ||
25 | * linux/ioport.h to select the interrupt line behaviour. When | ||
26 | * requesting an interrupt without specifying a SA_TRIGGER, the | ||
27 | * setting should be assumed to be "as already configured", which | ||
28 | * may be as per machine or firmware initialisation. | ||
29 | */ | ||
30 | #define SA_TRIGGER_LOW 0x00000008 | ||
31 | #define SA_TRIGGER_HIGH 0x00000004 | ||
32 | #define SA_TRIGGER_FALLING 0x00000002 | ||
33 | #define SA_TRIGGER_RISING 0x00000001 | ||
34 | #define SA_TRIGGER_MASK (SA_TRIGGER_HIGH|SA_TRIGGER_LOW|\ | ||
35 | SA_TRIGGER_RISING|SA_TRIGGER_FALLING) | ||
36 | 10 | ||
37 | /* | 11 | /* |
38 | * Real Time signals may be queued. | 12 | * Real Time signals may be queued. |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 93e4db221585..57d7d4965f9a 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -14,7 +14,6 @@ | |||
14 | #ifndef _LINUX_SKBUFF_H | 14 | #ifndef _LINUX_SKBUFF_H |
15 | #define _LINUX_SKBUFF_H | 15 | #define _LINUX_SKBUFF_H |
16 | 16 | ||
17 | #include <linux/config.h> | ||
18 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
19 | #include <linux/compiler.h> | 18 | #include <linux/compiler.h> |
20 | #include <linux/time.h> | 19 | #include <linux/time.h> |
@@ -135,9 +134,10 @@ struct skb_frag_struct { | |||
135 | struct skb_shared_info { | 134 | struct skb_shared_info { |
136 | atomic_t dataref; | 135 | atomic_t dataref; |
137 | unsigned short nr_frags; | 136 | unsigned short nr_frags; |
138 | unsigned short tso_size; | 137 | unsigned short gso_size; |
139 | unsigned short tso_segs; | 138 | /* Warning: this field is not always filled in (UFO)! */ |
140 | unsigned short ufo_size; | 139 | unsigned short gso_segs; |
140 | unsigned short gso_type; | ||
141 | unsigned int ip6_frag_id; | 141 | unsigned int ip6_frag_id; |
142 | struct sk_buff *frag_list; | 142 | struct sk_buff *frag_list; |
143 | skb_frag_t frags[MAX_SKB_FRAGS]; | 143 | skb_frag_t frags[MAX_SKB_FRAGS]; |
@@ -169,6 +169,19 @@ enum { | |||
169 | SKB_FCLONE_CLONE, | 169 | SKB_FCLONE_CLONE, |
170 | }; | 170 | }; |
171 | 171 | ||
172 | enum { | ||
173 | SKB_GSO_TCPV4 = 1 << 0, | ||
174 | SKB_GSO_UDP = 1 << 1, | ||
175 | |||
176 | /* This indicates the skb is from an untrusted source. */ | ||
177 | SKB_GSO_DODGY = 1 << 2, | ||
178 | |||
179 | /* This indicates the tcp segment has CWR set. */ | ||
180 | SKB_GSO_TCP_ECN = 1 << 3, | ||
181 | |||
182 | SKB_GSO_TCPV6 = 1 << 4, | ||
183 | }; | ||
184 | |||
172 | /** | 185 | /** |
173 | * struct sk_buff - socket buffer | 186 | * struct sk_buff - socket buffer |
174 | * @next: Next buffer in list | 187 | * @next: Next buffer in list |
@@ -210,6 +223,8 @@ enum { | |||
210 | * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c | 223 | * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c |
211 | * @tc_index: Traffic control index | 224 | * @tc_index: Traffic control index |
212 | * @tc_verd: traffic control verdict | 225 | * @tc_verd: traffic control verdict |
226 | * @dma_cookie: a cookie to one of several possible DMA operations | ||
227 | * done by skb DMA functions | ||
213 | * @secmark: security marking | 228 | * @secmark: security marking |
214 | */ | 229 | */ |
215 | 230 | ||
@@ -346,7 +361,7 @@ extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, | |||
346 | extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb, | 361 | extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb, |
347 | int newheadroom, int newtailroom, | 362 | int newheadroom, int newtailroom, |
348 | gfp_t priority); | 363 | gfp_t priority); |
349 | extern struct sk_buff * skb_pad(struct sk_buff *skb, int pad); | 364 | extern int skb_pad(struct sk_buff *skb, int pad); |
350 | #define dev_kfree_skb(a) kfree_skb(a) | 365 | #define dev_kfree_skb(a) kfree_skb(a) |
351 | extern void skb_over_panic(struct sk_buff *skb, int len, | 366 | extern void skb_over_panic(struct sk_buff *skb, int len, |
352 | void *here); | 367 | void *here); |
@@ -1123,16 +1138,15 @@ static inline int skb_cow(struct sk_buff *skb, unsigned int headroom) | |||
1123 | * | 1138 | * |
1124 | * Pads up a buffer to ensure the trailing bytes exist and are | 1139 | * Pads up a buffer to ensure the trailing bytes exist and are |
1125 | * blanked. If the buffer already contains sufficient data it | 1140 | * blanked. If the buffer already contains sufficient data it |
1126 | * is untouched. Returns the buffer, which may be a replacement | 1141 | * is untouched. Otherwise it is extended. Returns zero on |
1127 | * for the original, or NULL for out of memory - in which case | 1142 | * success. The skb is freed on error. |
1128 | * the original buffer is still freed. | ||
1129 | */ | 1143 | */ |
1130 | 1144 | ||
1131 | static inline struct sk_buff *skb_padto(struct sk_buff *skb, unsigned int len) | 1145 | static inline int skb_padto(struct sk_buff *skb, unsigned int len) |
1132 | { | 1146 | { |
1133 | unsigned int size = skb->len; | 1147 | unsigned int size = skb->len; |
1134 | if (likely(size >= len)) | 1148 | if (likely(size >= len)) |
1135 | return skb; | 1149 | return 0; |
1136 | return skb_pad(skb, len-size); | 1150 | return skb_pad(skb, len-size); |
1137 | } | 1151 | } |
1138 | 1152 | ||
@@ -1292,7 +1306,7 @@ extern void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to); | |||
1292 | extern void skb_split(struct sk_buff *skb, | 1306 | extern void skb_split(struct sk_buff *skb, |
1293 | struct sk_buff *skb1, const u32 len); | 1307 | struct sk_buff *skb1, const u32 len); |
1294 | 1308 | ||
1295 | extern void skb_release_data(struct sk_buff *skb); | 1309 | extern struct sk_buff *skb_segment(struct sk_buff *skb, int features); |
1296 | 1310 | ||
1297 | static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, | 1311 | static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, |
1298 | int len, void *buffer) | 1312 | int len, void *buffer) |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 2d985d59c7b8..45ad55b70d1c 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -11,7 +11,6 @@ | |||
11 | 11 | ||
12 | typedef struct kmem_cache kmem_cache_t; | 12 | typedef struct kmem_cache kmem_cache_t; |
13 | 13 | ||
14 | #include <linux/config.h> /* kmalloc_sizes.h needs CONFIG_ options */ | ||
15 | #include <linux/gfp.h> | 14 | #include <linux/gfp.h> |
16 | #include <linux/init.h> | 15 | #include <linux/init.h> |
17 | #include <linux/types.h> | 16 | #include <linux/types.h> |
@@ -87,6 +86,51 @@ extern void *__kmalloc_track_caller(size_t, gfp_t, void*); | |||
87 | __kmalloc_track_caller(size, flags, __builtin_return_address(0)) | 86 | __kmalloc_track_caller(size, flags, __builtin_return_address(0)) |
88 | #endif | 87 | #endif |
89 | 88 | ||
89 | /** | ||
90 | * kmalloc - allocate memory | ||
91 | * @size: how many bytes of memory are required. | ||
92 | * @flags: the type of memory to allocate. | ||
93 | * | ||
94 | * kmalloc is the normal method of allocating memory | ||
95 | * in the kernel. | ||
96 | * | ||
97 | * The @flags argument may be one of: | ||
98 | * | ||
99 | * %GFP_USER - Allocate memory on behalf of user. May sleep. | ||
100 | * | ||
101 | * %GFP_KERNEL - Allocate normal kernel ram. May sleep. | ||
102 | * | ||
103 | * %GFP_ATOMIC - Allocation will not sleep. | ||
104 | * For example, use this inside interrupt handlers. | ||
105 | * | ||
106 | * %GFP_HIGHUSER - Allocate pages from high memory. | ||
107 | * | ||
108 | * %GFP_NOIO - Do not do any I/O at all while trying to get memory. | ||
109 | * | ||
110 | * %GFP_NOFS - Do not make any fs calls while trying to get memory. | ||
111 | * | ||
112 | * Also it is possible to set different flags by OR'ing | ||
113 | * in one or more of the following additional @flags: | ||
114 | * | ||
115 | * %__GFP_COLD - Request cache-cold pages instead of | ||
116 | * trying to return cache-warm pages. | ||
117 | * | ||
118 | * %__GFP_DMA - Request memory from the DMA-capable zone. | ||
119 | * | ||
120 | * %__GFP_HIGH - This allocation has high priority and may use emergency pools. | ||
121 | * | ||
122 | * %__GFP_HIGHMEM - Allocated memory may be from highmem. | ||
123 | * | ||
124 | * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail | ||
125 | * (think twice before using). | ||
126 | * | ||
127 | * %__GFP_NORETRY - If memory is not immediately available, | ||
128 | * then give up at once. | ||
129 | * | ||
130 | * %__GFP_NOWARN - If allocation fails, don't issue any warnings. | ||
131 | * | ||
132 | * %__GFP_REPEAT - If allocation fails initially, try once more before failing. | ||
133 | */ | ||
90 | static inline void *kmalloc(size_t size, gfp_t flags) | 134 | static inline void *kmalloc(size_t size, gfp_t flags) |
91 | { | 135 | { |
92 | if (__builtin_constant_p(size)) { | 136 | if (__builtin_constant_p(size)) { |
@@ -112,6 +156,11 @@ found: | |||
112 | 156 | ||
113 | extern void *__kzalloc(size_t, gfp_t); | 157 | extern void *__kzalloc(size_t, gfp_t); |
114 | 158 | ||
159 | /** | ||
160 | * kzalloc - allocate memory. The memory is set to zero. | ||
161 | * @size: how many bytes of memory are required. | ||
162 | * @flags: the type of memory to allocate (see kmalloc). | ||
163 | */ | ||
115 | static inline void *kzalloc(size_t size, gfp_t flags) | 164 | static inline void *kzalloc(size_t size, gfp_t flags) |
116 | { | 165 | { |
117 | if (__builtin_constant_p(size)) { | 166 | if (__builtin_constant_p(size)) { |
diff --git a/include/linux/smb_fs.h b/include/linux/smb_fs.h index 621a3d3662f3..367d6c3e8ed4 100644 --- a/include/linux/smb_fs.h +++ b/include/linux/smb_fs.h | |||
@@ -10,8 +10,6 @@ | |||
10 | #define _LINUX_SMB_FS_H | 10 | #define _LINUX_SMB_FS_H |
11 | 11 | ||
12 | #include <linux/smb.h> | 12 | #include <linux/smb.h> |
13 | #include <linux/smb_fs_i.h> | ||
14 | #include <linux/smb_fs_sb.h> | ||
15 | 13 | ||
16 | /* | 14 | /* |
17 | * ioctl commands | 15 | * ioctl commands |
@@ -24,6 +22,8 @@ | |||
24 | 22 | ||
25 | 23 | ||
26 | #ifdef __KERNEL__ | 24 | #ifdef __KERNEL__ |
25 | #include <linux/smb_fs_i.h> | ||
26 | #include <linux/smb_fs_sb.h> | ||
27 | 27 | ||
28 | #include <linux/fs.h> | 28 | #include <linux/fs.h> |
29 | #include <linux/pagemap.h> | 29 | #include <linux/pagemap.h> |
diff --git a/include/linux/smp.h b/include/linux/smp.h index e2fa3ab4afc5..837e8bce1349 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -6,7 +6,6 @@ | |||
6 | * Alan Cox. <alan@redhat.com> | 6 | * Alan Cox. <alan@redhat.com> |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <linux/config.h> | ||
10 | 9 | ||
11 | extern void cpu_idle(void); | 10 | extern void cpu_idle(void); |
12 | 11 | ||
@@ -126,4 +125,6 @@ static inline void smp_send_reschedule(int cpu) { } | |||
126 | #define put_cpu() preempt_enable() | 125 | #define put_cpu() preempt_enable() |
127 | #define put_cpu_no_resched() preempt_enable_no_resched() | 126 | #define put_cpu_no_resched() preempt_enable_no_resched() |
128 | 127 | ||
128 | void smp_setup_processor_id(void); | ||
129 | |||
129 | #endif /* __LINUX_SMP_H */ | 130 | #endif /* __LINUX_SMP_H */ |
diff --git a/include/linux/smp_lock.h b/include/linux/smp_lock.h index fa1ff3b165fe..cf715a40d833 100644 --- a/include/linux/smp_lock.h +++ b/include/linux/smp_lock.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef __LINUX_SMPLOCK_H | 1 | #ifndef __LINUX_SMPLOCK_H |
2 | #define __LINUX_SMPLOCK_H | 2 | #define __LINUX_SMPLOCK_H |
3 | 3 | ||
4 | #include <linux/config.h> | ||
5 | #ifdef CONFIG_LOCK_KERNEL | 4 | #ifdef CONFIG_LOCK_KERNEL |
6 | #include <linux/sched.h> | 5 | #include <linux/sched.h> |
7 | #include <linux/spinlock.h> | 6 | #include <linux/spinlock.h> |
diff --git a/include/linux/socket.h b/include/linux/socket.h index 9ab2ddd80221..361409094649 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
@@ -18,8 +18,6 @@ struct __kernel_sockaddr_storage { | |||
18 | 18 | ||
19 | #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) | 19 | #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) |
20 | 20 | ||
21 | #include <linux/config.h> /* for CONFIG_COMPAT */ | ||
22 | #include <linux/linkage.h> | ||
23 | #include <asm/socket.h> /* arch-dependent defines */ | 21 | #include <asm/socket.h> /* arch-dependent defines */ |
24 | #include <linux/sockios.h> /* the SIOCxxx I/O controls */ | 22 | #include <linux/sockios.h> /* the SIOCxxx I/O controls */ |
25 | #include <linux/uio.h> /* iovec support */ | 23 | #include <linux/uio.h> /* iovec support */ |
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index e928c0dcc297..c8bb68099eb9 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
@@ -642,10 +642,14 @@ struct spi_board_info { | |||
642 | u16 bus_num; | 642 | u16 bus_num; |
643 | u16 chip_select; | 643 | u16 chip_select; |
644 | 644 | ||
645 | /* mode becomes spi_device.mode, and is essential for chips | ||
646 | * where the default of SPI_CS_HIGH = 0 is wrong. | ||
647 | */ | ||
648 | u8 mode; | ||
649 | |||
645 | /* ... may need additional spi_device chip config data here. | 650 | /* ... may need additional spi_device chip config data here. |
646 | * avoid stuff protocol drivers can set; but include stuff | 651 | * avoid stuff protocol drivers can set; but include stuff |
647 | * needed to behave without being bound to a driver: | 652 | * needed to behave without being bound to a driver: |
648 | * - chipselect polarity | ||
649 | * - quirks like clock rate mattering when not selected | 653 | * - quirks like clock rate mattering when not selected |
650 | */ | 654 | */ |
651 | }; | 655 | }; |
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 799be6747944..ae23beef9cc9 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
@@ -46,7 +46,6 @@ | |||
46 | * linux/spinlock.h: builds the final spin_*() APIs. | 46 | * linux/spinlock.h: builds the final spin_*() APIs. |
47 | */ | 47 | */ |
48 | 48 | ||
49 | #include <linux/config.h> | ||
50 | #include <linux/preempt.h> | 49 | #include <linux/preempt.h> |
51 | #include <linux/linkage.h> | 50 | #include <linux/linkage.h> |
52 | #include <linux/compiler.h> | 51 | #include <linux/compiler.h> |
diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h index 151a803ed0ed..5bfc553bdb21 100644 --- a/include/linux/stop_machine.h +++ b/include/linux/stop_machine.h | |||
@@ -4,7 +4,6 @@ | |||
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 | diables preeempt. */ |
7 | #include <linux/config.h> | ||
8 | #include <linux/cpu.h> | 7 | #include <linux/cpu.h> |
9 | #include <asm/system.h> | 8 | #include <asm/system.h> |
10 | 9 | ||
diff --git a/include/linux/string.h b/include/linux/string.h index c61306da8c52..e4c755860316 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
@@ -56,6 +56,7 @@ extern char * strnchr(const char *, size_t, int); | |||
56 | #ifndef __HAVE_ARCH_STRRCHR | 56 | #ifndef __HAVE_ARCH_STRRCHR |
57 | extern char * strrchr(const char *,int); | 57 | extern char * strrchr(const char *,int); |
58 | #endif | 58 | #endif |
59 | extern char * strstrip(char *); | ||
59 | #ifndef __HAVE_ARCH_STRSTR | 60 | #ifndef __HAVE_ARCH_STRSTR |
60 | extern char * strstr(const char *,const char *); | 61 | extern char * strstr(const char *,const char *); |
61 | #endif | 62 | #endif |
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index be4772ed43c0..a6de332e57d4 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h | |||
@@ -11,7 +11,6 @@ | |||
11 | 11 | ||
12 | #ifdef __KERNEL__ | 12 | #ifdef __KERNEL__ |
13 | 13 | ||
14 | #include <linux/config.h> | ||
15 | #include <linux/sunrpc/sched.h> | 14 | #include <linux/sunrpc/sched.h> |
16 | #include <linux/sunrpc/msg_prot.h> | 15 | #include <linux/sunrpc/msg_prot.h> |
17 | #include <linux/sunrpc/xdr.h> | 16 | #include <linux/sunrpc/xdr.h> |
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h index 1a42d902bc11..e4729aa67654 100644 --- a/include/linux/sunrpc/debug.h +++ b/include/linux/sunrpc/debug.h | |||
@@ -9,19 +9,6 @@ | |||
9 | #ifndef _LINUX_SUNRPC_DEBUG_H_ | 9 | #ifndef _LINUX_SUNRPC_DEBUG_H_ |
10 | #define _LINUX_SUNRPC_DEBUG_H_ | 10 | #define _LINUX_SUNRPC_DEBUG_H_ |
11 | 11 | ||
12 | #include <linux/config.h> | ||
13 | |||
14 | #include <linux/timer.h> | ||
15 | #include <linux/workqueue.h> | ||
16 | |||
17 | /* | ||
18 | * Enable RPC debugging/profiling. | ||
19 | */ | ||
20 | #ifdef CONFIG_SYSCTL | ||
21 | #define RPC_DEBUG | ||
22 | #endif | ||
23 | /* #define RPC_PROFILE */ | ||
24 | |||
25 | /* | 12 | /* |
26 | * RPC debug facilities | 13 | * RPC debug facilities |
27 | */ | 14 | */ |
@@ -41,6 +28,17 @@ | |||
41 | 28 | ||
42 | #ifdef __KERNEL__ | 29 | #ifdef __KERNEL__ |
43 | 30 | ||
31 | #include <linux/timer.h> | ||
32 | #include <linux/workqueue.h> | ||
33 | |||
34 | /* | ||
35 | * Enable RPC debugging/profiling. | ||
36 | */ | ||
37 | #ifdef CONFIG_SYSCTL | ||
38 | #define RPC_DEBUG | ||
39 | #endif | ||
40 | /* #define RPC_PROFILE */ | ||
41 | |||
44 | /* | 42 | /* |
45 | * Debugging macros etc | 43 | * Debugging macros etc |
46 | */ | 44 | */ |
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h index 9b8bcf125c18..6e112cc5cdda 100644 --- a/include/linux/sunrpc/gss_api.h +++ b/include/linux/sunrpc/gss_api.h | |||
@@ -126,7 +126,7 @@ struct gss_api_mech *gss_mech_get_by_pseudoflavor(u32); | |||
126 | /* Just increments the mechanism's reference count and returns its input: */ | 126 | /* Just increments the mechanism's reference count and returns its input: */ |
127 | struct gss_api_mech * gss_mech_get(struct gss_api_mech *); | 127 | struct gss_api_mech * gss_mech_get(struct gss_api_mech *); |
128 | 128 | ||
129 | /* For every succesful gss_mech_get or gss_mech_get_by_* call there must be a | 129 | /* For every successful gss_mech_get or gss_mech_get_by_* call there must be a |
130 | * corresponding call to gss_mech_put. */ | 130 | * corresponding call to gss_mech_put. */ |
131 | void gss_mech_put(struct gss_api_mech *); | 131 | void gss_mech_put(struct gss_api_mech *); |
132 | 132 | ||
diff --git a/include/linux/sunrpc/stats.h b/include/linux/sunrpc/stats.h index d93c24b47f3f..5fa0f2084307 100644 --- a/include/linux/sunrpc/stats.h +++ b/include/linux/sunrpc/stats.h | |||
@@ -9,7 +9,6 @@ | |||
9 | #ifndef _LINUX_SUNRPC_STATS_H | 9 | #ifndef _LINUX_SUNRPC_STATS_H |
10 | #define _LINUX_SUNRPC_STATS_H | 10 | #define _LINUX_SUNRPC_STATS_H |
11 | 11 | ||
12 | #include <linux/config.h> | ||
13 | #include <linux/proc_fs.h> | 12 | #include <linux/proc_fs.h> |
14 | 13 | ||
15 | struct rpc_stat { | 14 | struct rpc_stat { |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 503564384545..7b27c09b5604 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -159,7 +159,9 @@ struct svc_rqst { | |||
159 | * determine what device number | 159 | * determine what device number |
160 | * to report (real or virtual) | 160 | * to report (real or virtual) |
161 | */ | 161 | */ |
162 | 162 | int rq_sendfile_ok; /* turned off in gss privacy | |
163 | * to prevent encrypting page | ||
164 | * cache pages */ | ||
163 | wait_queue_head_t rq_wait; /* synchronization */ | 165 | wait_queue_head_t rq_wait; /* synchronization */ |
164 | }; | 166 | }; |
165 | 167 | ||
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index 84c35d42d250..e6d3d349506c 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
@@ -194,6 +194,7 @@ extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages, | |||
194 | extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, uint32_t *p); | 194 | extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, uint32_t *p); |
195 | extern uint32_t *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes); | 195 | extern uint32_t *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes); |
196 | extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len); | 196 | extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len); |
197 | extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len); | ||
197 | 198 | ||
198 | #endif /* __KERNEL__ */ | 199 | #endif /* __KERNEL__ */ |
199 | 200 | ||
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 37c1c76fd547..96e31aa64cc7 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -6,7 +6,6 @@ | |||
6 | #endif | 6 | #endif |
7 | #include <linux/swap.h> | 7 | #include <linux/swap.h> |
8 | #include <linux/notifier.h> | 8 | #include <linux/notifier.h> |
9 | #include <linux/config.h> | ||
10 | #include <linux/init.h> | 9 | #include <linux/init.h> |
11 | #include <linux/pm.h> | 10 | #include <linux/pm.h> |
12 | 11 | ||
diff --git a/include/linux/swap.h b/include/linux/swap.h index f03c24719302..cf6ca6e377bd 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _LINUX_SWAP_H | 1 | #ifndef _LINUX_SWAP_H |
2 | #define _LINUX_SWAP_H | 2 | #define _LINUX_SWAP_H |
3 | 3 | ||
4 | #include <linux/config.h> | ||
5 | #include <linux/spinlock.h> | 4 | #include <linux/spinlock.h> |
6 | #include <linux/linkage.h> | 5 | #include <linux/linkage.h> |
7 | #include <linux/mmzone.h> | 6 | #include <linux/mmzone.h> |
@@ -29,7 +28,14 @@ static inline int current_is_kswapd(void) | |||
29 | * the type/offset into the pte as 5/27 as well. | 28 | * the type/offset into the pte as 5/27 as well. |
30 | */ | 29 | */ |
31 | #define MAX_SWAPFILES_SHIFT 5 | 30 | #define MAX_SWAPFILES_SHIFT 5 |
31 | #ifndef CONFIG_MIGRATION | ||
32 | #define MAX_SWAPFILES (1 << MAX_SWAPFILES_SHIFT) | 32 | #define MAX_SWAPFILES (1 << MAX_SWAPFILES_SHIFT) |
33 | #else | ||
34 | /* Use last two entries for page migration swap entries */ | ||
35 | #define MAX_SWAPFILES ((1 << MAX_SWAPFILES_SHIFT)-2) | ||
36 | #define SWP_MIGRATION_READ MAX_SWAPFILES | ||
37 | #define SWP_MIGRATION_WRITE (MAX_SWAPFILES + 1) | ||
38 | #endif | ||
33 | 39 | ||
34 | /* | 40 | /* |
35 | * Magic header for a swap area. The first part of the union is | 41 | * Magic header for a swap area. The first part of the union is |
@@ -49,12 +55,14 @@ union swap_header { | |||
49 | char magic[10]; /* SWAP-SPACE or SWAPSPACE2 */ | 55 | char magic[10]; /* SWAP-SPACE or SWAPSPACE2 */ |
50 | } magic; | 56 | } magic; |
51 | struct { | 57 | struct { |
52 | char bootbits[1024]; /* Space for disklabel etc. */ | 58 | char bootbits[1024]; /* Space for disklabel etc. */ |
53 | unsigned int version; | 59 | __u32 version; |
54 | unsigned int last_page; | 60 | __u32 last_page; |
55 | unsigned int nr_badpages; | 61 | __u32 nr_badpages; |
56 | unsigned int padding[125]; | 62 | unsigned char sws_uuid[16]; |
57 | unsigned int badpages[1]; | 63 | unsigned char sws_volume[16]; |
64 | __u32 padding[117]; | ||
65 | __u32 badpages[1]; | ||
58 | } info; | 66 | } info; |
59 | }; | 67 | }; |
60 | 68 | ||
@@ -177,24 +185,10 @@ extern unsigned long try_to_free_pages(struct zone **, gfp_t); | |||
177 | extern unsigned long shrink_all_memory(unsigned long nr_pages); | 185 | extern unsigned long shrink_all_memory(unsigned long nr_pages); |
178 | extern int vm_swappiness; | 186 | extern int vm_swappiness; |
179 | extern int remove_mapping(struct address_space *mapping, struct page *page); | 187 | extern int remove_mapping(struct address_space *mapping, struct page *page); |
180 | 188 | extern long vm_total_pages; | |
181 | /* possible outcome of pageout() */ | ||
182 | typedef enum { | ||
183 | /* failed to write page out, page is locked */ | ||
184 | PAGE_KEEP, | ||
185 | /* move page to the active list, page is locked */ | ||
186 | PAGE_ACTIVATE, | ||
187 | /* page has been sent to the disk successfully, page is unlocked */ | ||
188 | PAGE_SUCCESS, | ||
189 | /* page is clean and locked */ | ||
190 | PAGE_CLEAN, | ||
191 | } pageout_t; | ||
192 | |||
193 | extern pageout_t pageout(struct page *page, struct address_space *mapping); | ||
194 | 189 | ||
195 | #ifdef CONFIG_NUMA | 190 | #ifdef CONFIG_NUMA |
196 | extern int zone_reclaim_mode; | 191 | extern int zone_reclaim_mode; |
197 | extern int zone_reclaim_interval; | ||
198 | extern int zone_reclaim(struct zone *, gfp_t, unsigned int); | 192 | extern int zone_reclaim(struct zone *, gfp_t, unsigned int); |
199 | #else | 193 | #else |
200 | #define zone_reclaim_mode 0 | 194 | #define zone_reclaim_mode 0 |
@@ -204,6 +198,8 @@ static inline int zone_reclaim(struct zone *z, gfp_t mask, unsigned int order) | |||
204 | } | 198 | } |
205 | #endif | 199 | #endif |
206 | 200 | ||
201 | extern int kswapd_run(int nid); | ||
202 | |||
207 | #ifdef CONFIG_MMU | 203 | #ifdef CONFIG_MMU |
208 | /* linux/mm/shmem.c */ | 204 | /* linux/mm/shmem.c */ |
209 | extern int shmem_unuse(swp_entry_t entry, struct page *page); | 205 | extern int shmem_unuse(swp_entry_t entry, struct page *page); |
@@ -251,7 +247,6 @@ extern int remove_exclusive_swap_page(struct page *); | |||
251 | struct backing_dev_info; | 247 | struct backing_dev_info; |
252 | 248 | ||
253 | extern spinlock_t swap_lock; | 249 | extern spinlock_t swap_lock; |
254 | extern int remove_vma_swap(struct vm_area_struct *vma, struct page *page); | ||
255 | 250 | ||
256 | /* linux/mm/thrash.c */ | 251 | /* linux/mm/thrash.c */ |
257 | extern struct mm_struct * swap_token_mm; | 252 | extern struct mm_struct * swap_token_mm; |
@@ -289,18 +284,60 @@ static inline void disable_swap_token(void) | |||
289 | #define free_pages_and_swap_cache(pages, nr) \ | 284 | #define free_pages_and_swap_cache(pages, nr) \ |
290 | release_pages((pages), (nr), 0); | 285 | release_pages((pages), (nr), 0); |
291 | 286 | ||
292 | #define show_swap_cache_info() /*NOTHING*/ | 287 | static inline void show_swap_cache_info(void) |
293 | #define free_swap_and_cache(swp) /*NOTHING*/ | 288 | { |
294 | #define swap_duplicate(swp) /*NOTHING*/ | 289 | } |
295 | #define swap_free(swp) /*NOTHING*/ | 290 | |
296 | #define read_swap_cache_async(swp,vma,addr) NULL | 291 | static inline void free_swap_and_cache(swp_entry_t swp) |
297 | #define lookup_swap_cache(swp) NULL | 292 | { |
298 | #define valid_swaphandles(swp, off) 0 | 293 | } |
294 | |||
295 | static inline int swap_duplicate(swp_entry_t swp) | ||
296 | { | ||
297 | return 0; | ||
298 | } | ||
299 | |||
300 | static inline void swap_free(swp_entry_t swp) | ||
301 | { | ||
302 | } | ||
303 | |||
304 | static inline struct page *read_swap_cache_async(swp_entry_t swp, | ||
305 | struct vm_area_struct *vma, unsigned long addr) | ||
306 | { | ||
307 | return NULL; | ||
308 | } | ||
309 | |||
310 | static inline struct page *lookup_swap_cache(swp_entry_t swp) | ||
311 | { | ||
312 | return NULL; | ||
313 | } | ||
314 | |||
315 | static inline int valid_swaphandles(swp_entry_t entry, unsigned long *offset) | ||
316 | { | ||
317 | return 0; | ||
318 | } | ||
319 | |||
299 | #define can_share_swap_page(p) (page_mapcount(p) == 1) | 320 | #define can_share_swap_page(p) (page_mapcount(p) == 1) |
300 | #define move_to_swap_cache(p, swp) 1 | 321 | |
301 | #define move_from_swap_cache(p, i, m) 1 | 322 | static inline int move_to_swap_cache(struct page *page, swp_entry_t entry) |
302 | #define __delete_from_swap_cache(p) /*NOTHING*/ | 323 | { |
303 | #define delete_from_swap_cache(p) /*NOTHING*/ | 324 | return 1; |
325 | } | ||
326 | |||
327 | static inline int move_from_swap_cache(struct page *page, unsigned long index, | ||
328 | struct address_space *mapping) | ||
329 | { | ||
330 | return 1; | ||
331 | } | ||
332 | |||
333 | static inline void __delete_from_swap_cache(struct page *page) | ||
334 | { | ||
335 | } | ||
336 | |||
337 | static inline void delete_from_swap_cache(struct page *page) | ||
338 | { | ||
339 | } | ||
340 | |||
304 | #define swap_token_default_timeout 0 | 341 | #define swap_token_default_timeout 0 |
305 | 342 | ||
306 | static inline int remove_exclusive_swap_page(struct page *p) | 343 | static inline int remove_exclusive_swap_page(struct page *p) |
diff --git a/include/linux/swapops.h b/include/linux/swapops.h index 87b9d14c710d..ec639aa3a1d3 100644 --- a/include/linux/swapops.h +++ b/include/linux/swapops.h | |||
@@ -67,3 +67,56 @@ static inline pte_t swp_entry_to_pte(swp_entry_t entry) | |||
67 | BUG_ON(pte_file(__swp_entry_to_pte(arch_entry))); | 67 | BUG_ON(pte_file(__swp_entry_to_pte(arch_entry))); |
68 | return __swp_entry_to_pte(arch_entry); | 68 | return __swp_entry_to_pte(arch_entry); |
69 | } | 69 | } |
70 | |||
71 | #ifdef CONFIG_MIGRATION | ||
72 | static inline swp_entry_t make_migration_entry(struct page *page, int write) | ||
73 | { | ||
74 | BUG_ON(!PageLocked(page)); | ||
75 | return swp_entry(write ? SWP_MIGRATION_WRITE : SWP_MIGRATION_READ, | ||
76 | page_to_pfn(page)); | ||
77 | } | ||
78 | |||
79 | static inline int is_migration_entry(swp_entry_t entry) | ||
80 | { | ||
81 | return unlikely(swp_type(entry) == SWP_MIGRATION_READ || | ||
82 | swp_type(entry) == SWP_MIGRATION_WRITE); | ||
83 | } | ||
84 | |||
85 | static inline int is_write_migration_entry(swp_entry_t entry) | ||
86 | { | ||
87 | return unlikely(swp_type(entry) == SWP_MIGRATION_WRITE); | ||
88 | } | ||
89 | |||
90 | static inline struct page *migration_entry_to_page(swp_entry_t entry) | ||
91 | { | ||
92 | struct page *p = pfn_to_page(swp_offset(entry)); | ||
93 | /* | ||
94 | * Any use of migration entries may only occur while the | ||
95 | * corresponding page is locked | ||
96 | */ | ||
97 | BUG_ON(!PageLocked(p)); | ||
98 | return p; | ||
99 | } | ||
100 | |||
101 | static inline void make_migration_entry_read(swp_entry_t *entry) | ||
102 | { | ||
103 | *entry = swp_entry(SWP_MIGRATION_READ, swp_offset(*entry)); | ||
104 | } | ||
105 | |||
106 | extern void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, | ||
107 | unsigned long address); | ||
108 | #else | ||
109 | |||
110 | #define make_migration_entry(page, write) swp_entry(0, 0) | ||
111 | #define is_migration_entry(swp) 0 | ||
112 | #define migration_entry_to_page(swp) NULL | ||
113 | static inline void make_migration_entry_read(swp_entry_t *entryp) { } | ||
114 | static inline void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, | ||
115 | unsigned long address) { } | ||
116 | static inline int is_write_migration_entry(swp_entry_t entry) | ||
117 | { | ||
118 | return 0; | ||
119 | } | ||
120 | |||
121 | #endif | ||
122 | |||
diff --git a/include/linux/synclink.h b/include/linux/synclink.h index 2993302f7923..0577f5284cbc 100644 --- a/include/linux/synclink.h +++ b/include/linux/synclink.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * SyncLink Multiprotocol Serial Adapter Driver | 2 | * SyncLink Multiprotocol Serial Adapter Driver |
3 | * | 3 | * |
4 | * $Id: synclink.h,v 3.11 2006/02/06 21:20:29 paulkf Exp $ | 4 | * $Id: synclink.h,v 3.13 2006/05/23 18:25:06 paulkf Exp $ |
5 | * | 5 | * |
6 | * Copyright (C) 1998-2000 by Microgate Corporation | 6 | * Copyright (C) 1998-2000 by Microgate Corporation |
7 | * | 7 | * |
@@ -97,6 +97,8 @@ | |||
97 | #define HDLC_TXIDLE_ALT_MARK_SPACE 4 | 97 | #define HDLC_TXIDLE_ALT_MARK_SPACE 4 |
98 | #define HDLC_TXIDLE_SPACE 5 | 98 | #define HDLC_TXIDLE_SPACE 5 |
99 | #define HDLC_TXIDLE_MARK 6 | 99 | #define HDLC_TXIDLE_MARK 6 |
100 | #define HDLC_TXIDLE_CUSTOM_8 0x10000000 | ||
101 | #define HDLC_TXIDLE_CUSTOM_16 0x20000000 | ||
100 | 102 | ||
101 | #define HDLC_ENCODING_NRZ 0 | 103 | #define HDLC_ENCODING_NRZ 0 |
102 | #define HDLC_ENCODING_NRZB 1 | 104 | #define HDLC_ENCODING_NRZB 1 |
@@ -170,6 +172,7 @@ typedef struct _MGSL_PARAMS | |||
170 | #define SYNCLINK_GT_DEVICE_ID 0x0070 | 172 | #define SYNCLINK_GT_DEVICE_ID 0x0070 |
171 | #define SYNCLINK_GT4_DEVICE_ID 0x0080 | 173 | #define SYNCLINK_GT4_DEVICE_ID 0x0080 |
172 | #define SYNCLINK_AC_DEVICE_ID 0x0090 | 174 | #define SYNCLINK_AC_DEVICE_ID 0x0090 |
175 | #define SYNCLINK_GT2_DEVICE_ID 0x00A0 | ||
173 | #define MGSL_MAX_SERIAL_NUMBER 30 | 176 | #define MGSL_MAX_SERIAL_NUMBER 30 |
174 | 177 | ||
175 | /* | 178 | /* |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 60d49e5456e7..008f04c56737 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -54,7 +54,6 @@ struct compat_stat; | |||
54 | struct compat_timeval; | 54 | struct compat_timeval; |
55 | struct robust_list_head; | 55 | struct robust_list_head; |
56 | 56 | ||
57 | #include <linux/config.h> | ||
58 | #include <linux/types.h> | 57 | #include <linux/types.h> |
59 | #include <linux/aio_abi.h> | 58 | #include <linux/aio_abi.h> |
60 | #include <linux/capability.h> | 59 | #include <linux/capability.h> |
@@ -175,9 +174,9 @@ asmlinkage long sys_waitid(int which, pid_t pid, | |||
175 | int options, struct rusage __user *ru); | 174 | int options, struct rusage __user *ru); |
176 | asmlinkage long sys_waitpid(pid_t pid, int __user *stat_addr, int options); | 175 | asmlinkage long sys_waitpid(pid_t pid, int __user *stat_addr, int options); |
177 | asmlinkage long sys_set_tid_address(int __user *tidptr); | 176 | asmlinkage long sys_set_tid_address(int __user *tidptr); |
178 | asmlinkage long sys_futex(u32 __user *uaddr, int op, int val, | 177 | asmlinkage long sys_futex(u32 __user *uaddr, int op, u32 val, |
179 | struct timespec __user *utime, u32 __user *uaddr2, | 178 | struct timespec __user *utime, u32 __user *uaddr2, |
180 | int val3); | 179 | u32 val3); |
181 | 180 | ||
182 | asmlinkage long sys_init_module(void __user *umod, unsigned long len, | 181 | asmlinkage long sys_init_module(void __user *umod, unsigned long len, |
183 | const char __user *uargs); | 182 | const char __user *uargs); |
@@ -517,6 +516,16 @@ asmlinkage long sys_set_mempolicy(int mode, unsigned long __user *nmask, | |||
517 | asmlinkage long sys_migrate_pages(pid_t pid, unsigned long maxnode, | 516 | asmlinkage long sys_migrate_pages(pid_t pid, unsigned long maxnode, |
518 | const unsigned long __user *from, | 517 | const unsigned long __user *from, |
519 | const unsigned long __user *to); | 518 | const unsigned long __user *to); |
519 | asmlinkage long sys_move_pages(pid_t pid, unsigned long nr_pages, | ||
520 | const void __user * __user *pages, | ||
521 | const int __user *nodes, | ||
522 | int __user *status, | ||
523 | int flags); | ||
524 | asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_page, | ||
525 | __u32 __user *pages, | ||
526 | const int __user *nodes, | ||
527 | int __user *status, | ||
528 | int flags); | ||
520 | asmlinkage long sys_mbind(unsigned long start, unsigned long len, | 529 | asmlinkage long sys_mbind(unsigned long start, unsigned long len, |
521 | unsigned long mode, | 530 | unsigned long mode, |
522 | unsigned long __user *nmask, | 531 | unsigned long __user *nmask, |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index cee944dbdcd4..46e4d8f2771f 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -55,7 +55,7 @@ enum | |||
55 | CTL_KERN=1, /* General kernel info and control */ | 55 | CTL_KERN=1, /* General kernel info and control */ |
56 | CTL_VM=2, /* VM management */ | 56 | CTL_VM=2, /* VM management */ |
57 | CTL_NET=3, /* Networking */ | 57 | CTL_NET=3, /* Networking */ |
58 | CTL_PROC=4, /* Process info */ | 58 | /* was CTL_PROC */ |
59 | CTL_FS=5, /* Filesystems */ | 59 | CTL_FS=5, /* Filesystems */ |
60 | CTL_DEBUG=6, /* Debugging */ | 60 | CTL_DEBUG=6, /* Debugging */ |
61 | CTL_DEV=7, /* Devices */ | 61 | CTL_DEV=7, /* Devices */ |
@@ -148,9 +148,12 @@ enum | |||
148 | KERN_SPIN_RETRY=70, /* int: number of spinlock retries */ | 148 | KERN_SPIN_RETRY=70, /* int: number of spinlock retries */ |
149 | KERN_ACPI_VIDEO_FLAGS=71, /* int: flags for setting up video after ACPI sleep */ | 149 | KERN_ACPI_VIDEO_FLAGS=71, /* int: flags for setting up video after ACPI sleep */ |
150 | KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */ | 150 | KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */ |
151 | KERN_COMPAT_LOG=73, /* int: print compat layer messages */ | ||
152 | KERN_MAX_LOCK_DEPTH=74, | ||
151 | }; | 153 | }; |
152 | 154 | ||
153 | 155 | ||
156 | |||
154 | /* CTL_VM names: */ | 157 | /* CTL_VM names: */ |
155 | enum | 158 | enum |
156 | { | 159 | { |
@@ -186,6 +189,8 @@ enum | |||
186 | VM_PERCPU_PAGELIST_FRACTION=30,/* int: fraction of pages in each percpu_pagelist */ | 189 | VM_PERCPU_PAGELIST_FRACTION=30,/* int: fraction of pages in each percpu_pagelist */ |
187 | VM_ZONE_RECLAIM_MODE=31, /* reclaim local zone memory before going off node */ | 190 | VM_ZONE_RECLAIM_MODE=31, /* reclaim local zone memory before going off node */ |
188 | VM_ZONE_RECLAIM_INTERVAL=32, /* time period to wait after reclaim failure */ | 191 | VM_ZONE_RECLAIM_INTERVAL=32, /* time period to wait after reclaim failure */ |
192 | VM_PANIC_ON_OOM=33, /* panic at out-of-memory */ | ||
193 | VM_VDSO_ENABLED=34, /* map VDSO into new processes? */ | ||
189 | }; | 194 | }; |
190 | 195 | ||
191 | 196 | ||
@@ -766,8 +771,6 @@ enum { | |||
766 | NET_BRIDGE_NF_FILTER_VLAN_TAGGED = 4, | 771 | NET_BRIDGE_NF_FILTER_VLAN_TAGGED = 4, |
767 | }; | 772 | }; |
768 | 773 | ||
769 | /* CTL_PROC names: */ | ||
770 | |||
771 | /* CTL_FS names: */ | 774 | /* CTL_FS names: */ |
772 | enum | 775 | enum |
773 | { | 776 | { |
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h index 2a4b432e1176..166a2e58c287 100644 --- a/include/linux/sysdev.h +++ b/include/linux/sysdev.h | |||
@@ -37,11 +37,27 @@ struct sysdev_class { | |||
37 | struct kset kset; | 37 | struct kset kset; |
38 | }; | 38 | }; |
39 | 39 | ||
40 | struct sysdev_class_attribute { | ||
41 | struct attribute attr; | ||
42 | ssize_t (*show)(struct sysdev_class *, char *); | ||
43 | ssize_t (*store)(struct sysdev_class *, const char *, size_t); | ||
44 | }; | ||
45 | |||
46 | #define SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) \ | ||
47 | struct sysdev_class_attribute attr_##_name = { \ | ||
48 | .attr = {.name = __stringify(_name), .mode = _mode }, \ | ||
49 | .show = _show, \ | ||
50 | .store = _store, \ | ||
51 | }; | ||
52 | |||
40 | 53 | ||
41 | extern int sysdev_class_register(struct sysdev_class *); | 54 | extern int sysdev_class_register(struct sysdev_class *); |
42 | extern void sysdev_class_unregister(struct sysdev_class *); | 55 | extern void sysdev_class_unregister(struct sysdev_class *); |
43 | 56 | ||
44 | 57 | extern int sysdev_class_create_file(struct sysdev_class *, | |
58 | struct sysdev_class_attribute *); | ||
59 | extern void sysdev_class_remove_file(struct sysdev_class *, | ||
60 | struct sysdev_class_attribute *); | ||
45 | /** | 61 | /** |
46 | * Auxillary system device drivers. | 62 | * Auxillary system device drivers. |
47 | */ | 63 | */ |
diff --git a/include/linux/sysrq.h b/include/linux/sysrq.h index ea819b89c235..4812ff60561c 100644 --- a/include/linux/sysrq.h +++ b/include/linux/sysrq.h | |||
@@ -11,7 +11,6 @@ | |||
11 | * based upon discusions in irc://irc.openprojects.net/#kernelnewbies | 11 | * based upon discusions in irc://irc.openprojects.net/#kernelnewbies |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <linux/config.h> | ||
15 | 14 | ||
16 | struct pt_regs; | 15 | struct pt_regs; |
17 | struct tty_struct; | 16 | struct tty_struct; |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index c90daa5da6c3..8ebf497907f8 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -18,7 +18,6 @@ | |||
18 | #define _LINUX_TCP_H | 18 | #define _LINUX_TCP_H |
19 | 19 | ||
20 | #include <linux/types.h> | 20 | #include <linux/types.h> |
21 | #include <linux/dmaengine.h> | ||
22 | #include <asm/byteorder.h> | 21 | #include <asm/byteorder.h> |
23 | 22 | ||
24 | struct tcphdr { | 23 | struct tcphdr { |
@@ -160,8 +159,8 @@ struct tcp_info | |||
160 | 159 | ||
161 | #ifdef __KERNEL__ | 160 | #ifdef __KERNEL__ |
162 | 161 | ||
163 | #include <linux/config.h> | ||
164 | #include <linux/skbuff.h> | 162 | #include <linux/skbuff.h> |
163 | #include <linux/dmaengine.h> | ||
165 | #include <net/sock.h> | 164 | #include <net/sock.h> |
166 | #include <net/inet_connection_sock.h> | 165 | #include <net/inet_connection_sock.h> |
167 | #include <net/inet_timewait_sock.h> | 166 | #include <net/inet_timewait_sock.h> |
diff --git a/include/linux/threads.h b/include/linux/threads.h index e646bcdf2614..38d1a5d6568e 100644 --- a/include/linux/threads.h +++ b/include/linux/threads.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _LINUX_THREADS_H | 1 | #ifndef _LINUX_THREADS_H |
2 | #define _LINUX_THREADS_H | 2 | #define _LINUX_THREADS_H |
3 | 3 | ||
4 | #include <linux/config.h> | ||
5 | 4 | ||
6 | /* | 5 | /* |
7 | * The default limit for the nr of threads is now in | 6 | * The default limit for the nr of threads is now in |
diff --git a/include/linux/time.h b/include/linux/time.h index 0cd696cee998..c05f8bb9a323 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -28,10 +28,13 @@ struct timezone { | |||
28 | #ifdef __KERNEL__ | 28 | #ifdef __KERNEL__ |
29 | 29 | ||
30 | /* Parameters used to convert the timespec values: */ | 30 | /* Parameters used to convert the timespec values: */ |
31 | #define MSEC_PER_SEC 1000L | 31 | #define MSEC_PER_SEC 1000L |
32 | #define USEC_PER_SEC 1000000L | 32 | #define USEC_PER_MSEC 1000L |
33 | #define NSEC_PER_SEC 1000000000L | 33 | #define NSEC_PER_USEC 1000L |
34 | #define NSEC_PER_USEC 1000L | 34 | #define NSEC_PER_MSEC 1000000L |
35 | #define USEC_PER_SEC 1000000L | ||
36 | #define NSEC_PER_SEC 1000000000L | ||
37 | #define FSEC_PER_SEC 1000000000000000L | ||
35 | 38 | ||
36 | static inline int timespec_equal(struct timespec *a, struct timespec *b) | 39 | static inline int timespec_equal(struct timespec *a, struct timespec *b) |
37 | { | 40 | { |
@@ -77,6 +80,8 @@ extern struct timespec xtime; | |||
77 | extern struct timespec wall_to_monotonic; | 80 | extern struct timespec wall_to_monotonic; |
78 | extern seqlock_t xtime_lock; | 81 | extern seqlock_t xtime_lock; |
79 | 82 | ||
83 | void timekeeping_init(void); | ||
84 | |||
80 | static inline unsigned long get_seconds(void) | 85 | static inline unsigned long get_seconds(void) |
81 | { | 86 | { |
82 | return xtime.tv_sec; | 87 | return xtime.tv_sec; |
@@ -100,6 +105,7 @@ extern int do_getitimer(int which, struct itimerval *value); | |||
100 | extern void getnstimeofday(struct timespec *tv); | 105 | extern void getnstimeofday(struct timespec *tv); |
101 | 106 | ||
102 | extern struct timespec timespec_trunc(struct timespec t, unsigned gran); | 107 | extern struct timespec timespec_trunc(struct timespec t, unsigned gran); |
108 | extern int timekeeping_is_continuous(void); | ||
103 | 109 | ||
104 | /** | 110 | /** |
105 | * timespec_to_ns - Convert timespec to nanoseconds | 111 | * timespec_to_ns - Convert timespec to nanoseconds |
@@ -142,6 +148,20 @@ extern struct timespec ns_to_timespec(const s64 nsec); | |||
142 | */ | 148 | */ |
143 | extern struct timeval ns_to_timeval(const s64 nsec); | 149 | extern struct timeval ns_to_timeval(const s64 nsec); |
144 | 150 | ||
151 | /** | ||
152 | * timespec_add_ns - Adds nanoseconds to a timespec | ||
153 | * @a: pointer to timespec to be incremented | ||
154 | * @ns: unsigned nanoseconds value to be added | ||
155 | */ | ||
156 | static inline void timespec_add_ns(struct timespec *a, u64 ns) | ||
157 | { | ||
158 | ns += a->tv_nsec; | ||
159 | while(unlikely(ns >= NSEC_PER_SEC)) { | ||
160 | ns -= NSEC_PER_SEC; | ||
161 | a->tv_sec++; | ||
162 | } | ||
163 | a->tv_nsec = ns; | ||
164 | } | ||
145 | #endif /* __KERNEL__ */ | 165 | #endif /* __KERNEL__ */ |
146 | 166 | ||
147 | #define NFDBITS __NFDBITS | 167 | #define NFDBITS __NFDBITS |
diff --git a/include/linux/timer.h b/include/linux/timer.h index 0a485beba9f5..c982304dbafd 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _LINUX_TIMER_H | 1 | #ifndef _LINUX_TIMER_H |
2 | #define _LINUX_TIMER_H | 2 | #define _LINUX_TIMER_H |
3 | 3 | ||
4 | #include <linux/config.h> | ||
5 | #include <linux/list.h> | 4 | #include <linux/list.h> |
6 | #include <linux/spinlock.h> | 5 | #include <linux/spinlock.h> |
7 | #include <linux/stddef.h> | 6 | #include <linux/stddef.h> |
diff --git a/include/linux/timex.h b/include/linux/timex.h index 03914b7e41b1..19bb6538b49e 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h | |||
@@ -53,7 +53,6 @@ | |||
53 | #ifndef _LINUX_TIMEX_H | 53 | #ifndef _LINUX_TIMEX_H |
54 | #define _LINUX_TIMEX_H | 54 | #define _LINUX_TIMEX_H |
55 | 55 | ||
56 | #include <linux/config.h> | ||
57 | #include <linux/compiler.h> | 56 | #include <linux/compiler.h> |
58 | #include <linux/time.h> | 57 | #include <linux/time.h> |
59 | 58 | ||
@@ -304,6 +303,8 @@ time_interpolator_reset(void) | |||
304 | 303 | ||
305 | #endif /* !CONFIG_TIME_INTERPOLATION */ | 304 | #endif /* !CONFIG_TIME_INTERPOLATION */ |
306 | 305 | ||
306 | #define TICK_LENGTH_SHIFT 32 | ||
307 | |||
307 | /* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */ | 308 | /* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */ |
308 | extern u64 current_tick_length(void); | 309 | extern u64 current_tick_length(void); |
309 | 310 | ||
diff --git a/include/linux/topology.h b/include/linux/topology.h index a305ae2e44b6..ec1eca85290a 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
@@ -134,7 +134,8 @@ | |||
134 | .flags = SD_LOAD_BALANCE \ | 134 | .flags = SD_LOAD_BALANCE \ |
135 | | SD_BALANCE_NEWIDLE \ | 135 | | SD_BALANCE_NEWIDLE \ |
136 | | SD_BALANCE_EXEC \ | 136 | | SD_BALANCE_EXEC \ |
137 | | SD_WAKE_AFFINE, \ | 137 | | SD_WAKE_AFFINE \ |
138 | | BALANCE_FOR_POWER, \ | ||
138 | .last_balance = jiffies, \ | 139 | .last_balance = jiffies, \ |
139 | .balance_interval = 1, \ | 140 | .balance_interval = 1, \ |
140 | .nr_balance_failed = 0, \ | 141 | .nr_balance_failed = 0, \ |
diff --git a/include/linux/tty.h b/include/linux/tty.h index f13f49afe198..b3b807e4b050 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -16,7 +16,6 @@ | |||
16 | consoles 16 and higher (since it returns a short) */ | 16 | consoles 16 and higher (since it returns a short) */ |
17 | 17 | ||
18 | #ifdef __KERNEL__ | 18 | #ifdef __KERNEL__ |
19 | #include <linux/config.h> | ||
20 | #include <linux/fs.h> | 19 | #include <linux/fs.h> |
21 | #include <linux/major.h> | 20 | #include <linux/major.h> |
22 | #include <linux/termios.h> | 21 | #include <linux/termios.h> |
@@ -58,7 +57,6 @@ struct tty_buffer { | |||
58 | unsigned char *flag_buf_ptr; | 57 | unsigned char *flag_buf_ptr; |
59 | int used; | 58 | int used; |
60 | int size; | 59 | int size; |
61 | int active; | ||
62 | int commit; | 60 | int commit; |
63 | int read; | 61 | int read; |
64 | /* Data points here */ | 62 | /* Data points here */ |
@@ -260,7 +258,6 @@ struct tty_struct { | |||
260 | #define TTY_DO_WRITE_WAKEUP 5 /* Call write_wakeup after queuing new */ | 258 | #define TTY_DO_WRITE_WAKEUP 5 /* Call write_wakeup after queuing new */ |
261 | #define TTY_PUSH 6 /* n_tty private */ | 259 | #define TTY_PUSH 6 /* n_tty private */ |
262 | #define TTY_CLOSING 7 /* ->close() in progress */ | 260 | #define TTY_CLOSING 7 /* ->close() in progress */ |
263 | #define TTY_DONT_FLIP 8 /* Defer buffer flip */ | ||
264 | #define TTY_LDISC 9 /* Line discipline attached */ | 261 | #define TTY_LDISC 9 /* Line discipline attached */ |
265 | #define TTY_HW_COOK_OUT 14 /* Hardware can do output cooking */ | 262 | #define TTY_HW_COOK_OUT 14 /* Hardware can do output cooking */ |
266 | #define TTY_HW_COOK_IN 15 /* Hardware can do input cooking */ | 263 | #define TTY_HW_COOK_IN 15 /* Hardware can do input cooking */ |
@@ -291,7 +288,9 @@ extern int tty_register_ldisc(int disc, struct tty_ldisc *new_ldisc); | |||
291 | extern int tty_unregister_ldisc(int disc); | 288 | extern int tty_unregister_ldisc(int disc); |
292 | extern int tty_register_driver(struct tty_driver *driver); | 289 | extern int tty_register_driver(struct tty_driver *driver); |
293 | extern int tty_unregister_driver(struct tty_driver *driver); | 290 | extern int tty_unregister_driver(struct tty_driver *driver); |
294 | extern void tty_register_device(struct tty_driver *driver, unsigned index, struct device *dev); | 291 | extern struct class_device *tty_register_device(struct tty_driver *driver, |
292 | unsigned index, | ||
293 | struct device *dev); | ||
295 | extern void tty_unregister_device(struct tty_driver *driver, unsigned index); | 294 | extern void tty_unregister_device(struct tty_driver *driver, unsigned index); |
296 | extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp, | 295 | extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp, |
297 | int buflen); | 296 | int buflen); |
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index b368b296d035..58c961c9e170 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h | |||
@@ -157,7 +157,6 @@ struct tty_driver { | |||
157 | struct cdev cdev; | 157 | struct cdev cdev; |
158 | struct module *owner; | 158 | struct module *owner; |
159 | const char *driver_name; | 159 | const char *driver_name; |
160 | const char *devfs_name; | ||
161 | const char *name; | 160 | const char *name; |
162 | int name_base; /* offset of printed name */ | 161 | int name_base; /* offset of printed name */ |
163 | int major; /* major device number */ | 162 | int major; /* major device number */ |
@@ -242,8 +241,15 @@ void tty_set_operations(struct tty_driver *driver, struct tty_operations *op); | |||
242 | * is also a promise, if the above case is true, not to signal | 241 | * is also a promise, if the above case is true, not to signal |
243 | * overruns, either.) | 242 | * overruns, either.) |
244 | * | 243 | * |
245 | * TTY_DRIVER_NO_DEVFS --- if set, do not create devfs entries. This | 244 | * TTY_DRIVER_DYNAMIC_DEV --- if set, the individual tty devices need |
246 | * is only used by tty_register_driver(). | 245 | * to be registered with a call to tty_register_driver() when the |
246 | * device is found in the system and unregistered with a call to | ||
247 | * tty_unregister_device() so the devices will be show up | ||
248 | * properly in sysfs. If not set, driver->num entries will be | ||
249 | * created by the tty core in sysfs when tty_register_driver() is | ||
250 | * called. This is to be used by drivers that have tty devices | ||
251 | * that can appear and disappear while the main tty driver is | ||
252 | * registered with the tty core. | ||
247 | * | 253 | * |
248 | * TTY_DRIVER_DEVPTS_MEM -- don't use the standard arrays, instead | 254 | * TTY_DRIVER_DEVPTS_MEM -- don't use the standard arrays, instead |
249 | * use dynamic memory keyed through the devpts filesystem. This | 255 | * use dynamic memory keyed through the devpts filesystem. This |
@@ -252,7 +258,7 @@ void tty_set_operations(struct tty_driver *driver, struct tty_operations *op); | |||
252 | #define TTY_DRIVER_INSTALLED 0x0001 | 258 | #define TTY_DRIVER_INSTALLED 0x0001 |
253 | #define TTY_DRIVER_RESET_TERMIOS 0x0002 | 259 | #define TTY_DRIVER_RESET_TERMIOS 0x0002 |
254 | #define TTY_DRIVER_REAL_RAW 0x0004 | 260 | #define TTY_DRIVER_REAL_RAW 0x0004 |
255 | #define TTY_DRIVER_NO_DEVFS 0x0008 | 261 | #define TTY_DRIVER_DYNAMIC_DEV 0x0008 |
256 | #define TTY_DRIVER_DEVPTS_MEM 0x0010 | 262 | #define TTY_DRIVER_DEVPTS_MEM 0x0010 |
257 | 263 | ||
258 | /* tty driver types */ | 264 | /* tty driver types */ |
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h index 31548303ee37..eb677cf56106 100644 --- a/include/linux/tty_flip.h +++ b/include/linux/tty_flip.h | |||
@@ -12,7 +12,7 @@ static inline int tty_insert_flip_char(struct tty_struct *tty, | |||
12 | unsigned char ch, char flag) | 12 | unsigned char ch, char flag) |
13 | { | 13 | { |
14 | struct tty_buffer *tb = tty->buf.tail; | 14 | struct tty_buffer *tb = tty->buf.tail; |
15 | if (tb && tb->active && tb->used < tb->size) { | 15 | if (tb && tb->used < tb->size) { |
16 | tb->flag_buf_ptr[tb->used] = flag; | 16 | tb->flag_buf_ptr[tb->used] = flag; |
17 | tb->char_buf_ptr[tb->used++] = ch; | 17 | tb->char_buf_ptr[tb->used++] = ch; |
18 | return 1; | 18 | return 1; |
diff --git a/include/linux/types.h b/include/linux/types.h index 1046c7ad86d9..3f235660a3cd 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
@@ -2,7 +2,6 @@ | |||
2 | #define _LINUX_TYPES_H | 2 | #define _LINUX_TYPES_H |
3 | 3 | ||
4 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
5 | #include <linux/config.h> | ||
6 | 5 | ||
7 | #define BITS_TO_LONGS(bits) \ | 6 | #define BITS_TO_LONGS(bits) \ |
8 | (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG) | 7 | (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG) |
@@ -178,8 +177,15 @@ typedef __u64 __bitwise __be64; | |||
178 | 177 | ||
179 | #ifdef __KERNEL__ | 178 | #ifdef __KERNEL__ |
180 | typedef unsigned __bitwise__ gfp_t; | 179 | typedef unsigned __bitwise__ gfp_t; |
180 | |||
181 | #ifdef CONFIG_RESOURCES_64BIT | ||
182 | typedef u64 resource_size_t; | ||
183 | #else | ||
184 | typedef u32 resource_size_t; | ||
181 | #endif | 185 | #endif |
182 | 186 | ||
187 | #endif /* __KERNEL__ */ | ||
188 | |||
183 | struct ustat { | 189 | struct ustat { |
184 | __kernel_daddr_t f_tfree; | 190 | __kernel_daddr_t f_tfree; |
185 | __kernel_ino_t f_tinode; | 191 | __kernel_ino_t f_tinode; |
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h new file mode 100644 index 000000000000..391e7ed1eb3f --- /dev/null +++ b/include/linux/uaccess.h | |||
@@ -0,0 +1,22 @@ | |||
1 | #ifndef __LINUX_UACCESS_H__ | ||
2 | #define __LINUX_UACCESS_H__ | ||
3 | |||
4 | #include <asm/uaccess.h> | ||
5 | |||
6 | #ifndef ARCH_HAS_NOCACHE_UACCESS | ||
7 | |||
8 | static inline unsigned long __copy_from_user_inatomic_nocache(void *to, | ||
9 | const void __user *from, unsigned long n) | ||
10 | { | ||
11 | return __copy_from_user_inatomic(to, from, n); | ||
12 | } | ||
13 | |||
14 | static inline unsigned long __copy_from_user_nocache(void *to, | ||
15 | const void __user *from, unsigned long n) | ||
16 | { | ||
17 | return __copy_from_user(to, from, n); | ||
18 | } | ||
19 | |||
20 | #endif /* ARCH_HAS_NOCACHE_UACCESS */ | ||
21 | |||
22 | #endif /* __LINUX_UACCESS_H__ */ | ||
diff --git a/include/linux/udp.h b/include/linux/udp.h index 85a55658831c..90223f057d50 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h | |||
@@ -35,7 +35,6 @@ struct udphdr { | |||
35 | #define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */ | 35 | #define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */ |
36 | 36 | ||
37 | #ifdef __KERNEL__ | 37 | #ifdef __KERNEL__ |
38 | #include <linux/config.h> | ||
39 | #include <linux/types.h> | 38 | #include <linux/types.h> |
40 | 39 | ||
41 | #include <net/inet_sock.h> | 40 | #include <net/inet_sock.h> |
@@ -47,7 +46,7 @@ struct udp_sock { | |||
47 | unsigned int corkflag; /* Cork is required */ | 46 | unsigned int corkflag; /* Cork is required */ |
48 | __u16 encap_type; /* Is this an Encapsulation socket? */ | 47 | __u16 encap_type; /* Is this an Encapsulation socket? */ |
49 | /* | 48 | /* |
50 | * Following member retains the infomation to create a UDP header | 49 | * Following member retains the information to create a UDP header |
51 | * when the socket is uncorked. | 50 | * when the socket is uncorked. |
52 | */ | 51 | */ |
53 | __u16 len; /* total length of pending frames */ | 52 | __u16 len; /* total length of pending frames */ |
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h index 843aeaaa79d4..fc62887c5206 100644 --- a/include/linux/ufs_fs.h +++ b/include/linux/ufs_fs.h | |||
@@ -32,7 +32,6 @@ | |||
32 | 32 | ||
33 | #include <linux/types.h> | 33 | #include <linux/types.h> |
34 | #include <linux/kernel.h> | 34 | #include <linux/kernel.h> |
35 | #include <linux/time.h> | ||
36 | #include <linux/stat.h> | 35 | #include <linux/stat.h> |
37 | #include <linux/fs.h> | 36 | #include <linux/fs.h> |
38 | 37 | ||
@@ -221,6 +220,19 @@ typedef __u16 __bitwise __fs16; | |||
221 | */ | 220 | */ |
222 | #define UFS_MINFREE 5 | 221 | #define UFS_MINFREE 5 |
223 | #define UFS_DEFAULTOPT UFS_OPTTIME | 222 | #define UFS_DEFAULTOPT UFS_OPTTIME |
223 | |||
224 | /* | ||
225 | * Debug code | ||
226 | */ | ||
227 | #ifdef CONFIG_UFS_DEBUG | ||
228 | # define UFSD(f, a...) { \ | ||
229 | printk ("UFSD (%s, %d): %s:", \ | ||
230 | __FILE__, __LINE__, __FUNCTION__); \ | ||
231 | printk (f, ## a); \ | ||
232 | } | ||
233 | #else | ||
234 | # define UFSD(f, a...) /**/ | ||
235 | #endif | ||
224 | 236 | ||
225 | /* | 237 | /* |
226 | * Turn file system block numbers into disk block addresses. | 238 | * Turn file system block numbers into disk block addresses. |
@@ -340,7 +352,22 @@ struct ufs2_csum_total { | |||
340 | }; | 352 | }; |
341 | 353 | ||
342 | /* | 354 | /* |
355 | * File system flags | ||
356 | */ | ||
357 | #define UFS_UNCLEAN 0x01 /* file system not clean at mount (unused) */ | ||
358 | #define UFS_DOSOFTDEP 0x02 /* file system using soft dependencies */ | ||
359 | #define UFS_NEEDSFSCK 0x04 /* needs sync fsck (FreeBSD compat, unused) */ | ||
360 | #define UFS_INDEXDIRS 0x08 /* kernel supports indexed directories */ | ||
361 | #define UFS_ACLS 0x10 /* file system has ACLs enabled */ | ||
362 | #define UFS_MULTILABEL 0x20 /* file system is MAC multi-label */ | ||
363 | #define UFS_FLAGS_UPDATED 0x80 /* flags have been moved to new location */ | ||
364 | |||
365 | #if 0 | ||
366 | /* | ||
343 | * This is the actual superblock, as it is laid out on the disk. | 367 | * This is the actual superblock, as it is laid out on the disk. |
368 | * Do NOT use this structure, because of sizeof(ufs_super_block) > 512 and | ||
369 | * it may occupy several blocks, use | ||
370 | * struct ufs_super_block_(first,second,third) instead. | ||
344 | */ | 371 | */ |
345 | struct ufs_super_block { | 372 | struct ufs_super_block { |
346 | __fs32 fs_link; /* UNUSED */ | 373 | __fs32 fs_link; /* UNUSED */ |
@@ -417,7 +444,7 @@ struct ufs_super_block { | |||
417 | __s8 fs_fmod; /* super block modified flag */ | 444 | __s8 fs_fmod; /* super block modified flag */ |
418 | __s8 fs_clean; /* file system is clean flag */ | 445 | __s8 fs_clean; /* file system is clean flag */ |
419 | __s8 fs_ronly; /* mounted read-only flag */ | 446 | __s8 fs_ronly; /* mounted read-only flag */ |
420 | __s8 fs_flags; /* currently unused flag */ | 447 | __s8 fs_flags; |
421 | union { | 448 | union { |
422 | struct { | 449 | struct { |
423 | __s8 fs_fsmnt[UFS_MAXMNTLEN];/* name mounted on */ | 450 | __s8 fs_fsmnt[UFS_MAXMNTLEN];/* name mounted on */ |
@@ -486,6 +513,7 @@ struct ufs_super_block { | |||
486 | __fs32 fs_magic; /* magic number */ | 513 | __fs32 fs_magic; /* magic number */ |
487 | __u8 fs_space[1]; /* list of blocks for each rotation */ | 514 | __u8 fs_space[1]; /* list of blocks for each rotation */ |
488 | }; | 515 | }; |
516 | #endif/*struct ufs_super_block*/ | ||
489 | 517 | ||
490 | /* | 518 | /* |
491 | * Preference for optimization. | 519 | * Preference for optimization. |
@@ -667,7 +695,7 @@ struct ufs_buffer_head { | |||
667 | }; | 695 | }; |
668 | 696 | ||
669 | struct ufs_cg_private_info { | 697 | struct ufs_cg_private_info { |
670 | struct ufs_cylinder_group ucg; | 698 | struct ufs_buffer_head c_ubh; |
671 | __u32 c_cgx; /* number of cylidner group */ | 699 | __u32 c_cgx; /* number of cylidner group */ |
672 | __u16 c_ncyl; /* number of cyl's this cg */ | 700 | __u16 c_ncyl; /* number of cyl's this cg */ |
673 | __u16 c_niblk; /* number of inode blocks this cg */ | 701 | __u16 c_niblk; /* number of inode blocks this cg */ |
@@ -687,6 +715,7 @@ struct ufs_cg_private_info { | |||
687 | 715 | ||
688 | struct ufs_sb_private_info { | 716 | struct ufs_sb_private_info { |
689 | struct ufs_buffer_head s_ubh; /* buffer containing super block */ | 717 | struct ufs_buffer_head s_ubh; /* buffer containing super block */ |
718 | struct ufs2_csum_total cs_total; | ||
690 | __u32 s_sblkno; /* offset of super-blocks in filesys */ | 719 | __u32 s_sblkno; /* offset of super-blocks in filesys */ |
691 | __u32 s_cblkno; /* offset of cg-block in filesys */ | 720 | __u32 s_cblkno; /* offset of cg-block in filesys */ |
692 | __u32 s_iblkno; /* offset of inode-blocks in filesys */ | 721 | __u32 s_iblkno; /* offset of inode-blocks in filesys */ |
@@ -825,16 +854,54 @@ struct ufs_super_block_first { | |||
825 | }; | 854 | }; |
826 | 855 | ||
827 | struct ufs_super_block_second { | 856 | struct ufs_super_block_second { |
828 | __s8 fs_fsmnt[212]; | 857 | union { |
829 | __fs32 fs_cgrotor; | 858 | struct { |
830 | __fs32 fs_csp[UFS_MAXCSBUFS]; | 859 | __s8 fs_fsmnt[212]; |
831 | __fs32 fs_maxcluster; | 860 | __fs32 fs_cgrotor; |
832 | __fs32 fs_cpc; | 861 | __fs32 fs_csp[UFS_MAXCSBUFS]; |
833 | __fs16 fs_opostbl[82]; | 862 | __fs32 fs_maxcluster; |
834 | }; | 863 | __fs32 fs_cpc; |
864 | __fs16 fs_opostbl[82]; | ||
865 | } fs_u1; | ||
866 | struct { | ||
867 | __s8 fs_fsmnt[UFS2_MAXMNTLEN - UFS_MAXMNTLEN + 212]; | ||
868 | __u8 fs_volname[UFS2_MAXVOLLEN]; | ||
869 | __fs64 fs_swuid; | ||
870 | __fs32 fs_pad; | ||
871 | __fs32 fs_cgrotor; | ||
872 | __fs32 fs_ocsp[UFS2_NOCSPTRS]; | ||
873 | __fs32 fs_contigdirs; | ||
874 | __fs32 fs_csp; | ||
875 | __fs32 fs_maxcluster; | ||
876 | __fs32 fs_active; | ||
877 | __fs32 fs_old_cpc; | ||
878 | __fs32 fs_maxbsize; | ||
879 | __fs64 fs_sparecon64[17]; | ||
880 | __fs64 fs_sblockloc; | ||
881 | __fs64 cs_ndir; | ||
882 | __fs64 cs_nbfree; | ||
883 | } fs_u2; | ||
884 | } fs_un; | ||
885 | }; | ||
835 | 886 | ||
836 | struct ufs_super_block_third { | 887 | struct ufs_super_block_third { |
837 | __fs16 fs_opostbl[46]; | 888 | union { |
889 | struct { | ||
890 | __fs16 fs_opostbl[46]; | ||
891 | } fs_u1; | ||
892 | struct { | ||
893 | __fs64 cs_nifree; /* number of free inodes */ | ||
894 | __fs64 cs_nffree; /* number of free frags */ | ||
895 | __fs64 cs_numclusters; /* number of free clusters */ | ||
896 | __fs64 cs_spare[3]; /* future expansion */ | ||
897 | struct ufs_timeval fs_time; /* last time written */ | ||
898 | __fs64 fs_size; /* number of blocks in fs */ | ||
899 | __fs64 fs_dsize; /* number of data blocks in fs */ | ||
900 | __fs64 fs_csaddr; /* blk addr of cyl grp summary area */ | ||
901 | __fs64 fs_pendingblocks;/* blocks in process of being freed */ | ||
902 | __fs32 fs_pendinginodes;/*inodes in process of being freed */ | ||
903 | } fs_u2; | ||
904 | } fs_un1; | ||
838 | union { | 905 | union { |
839 | struct { | 906 | struct { |
840 | __fs32 fs_sparecon[53];/* reserved for future constants */ | 907 | __fs32 fs_sparecon[53];/* reserved for future constants */ |
@@ -862,7 +929,7 @@ struct ufs_super_block_third { | |||
862 | __fs32 fs_qfmask[2]; /* ~usb_fmask */ | 929 | __fs32 fs_qfmask[2]; /* ~usb_fmask */ |
863 | __fs32 fs_state; /* file system state time stamp */ | 930 | __fs32 fs_state; /* file system state time stamp */ |
864 | } fs_44; | 931 | } fs_44; |
865 | } fs_u2; | 932 | } fs_un2; |
866 | __fs32 fs_postblformat; | 933 | __fs32 fs_postblformat; |
867 | __fs32 fs_nrpos; | 934 | __fs32 fs_nrpos; |
868 | __fs32 fs_postbloff; | 935 | __fs32 fs_postbloff; |
@@ -876,7 +943,8 @@ struct ufs_super_block_third { | |||
876 | /* balloc.c */ | 943 | /* balloc.c */ |
877 | extern void ufs_free_fragments (struct inode *, unsigned, unsigned); | 944 | extern void ufs_free_fragments (struct inode *, unsigned, unsigned); |
878 | extern void ufs_free_blocks (struct inode *, unsigned, unsigned); | 945 | extern void ufs_free_blocks (struct inode *, unsigned, unsigned); |
879 | extern unsigned ufs_new_fragments (struct inode *, __fs32 *, unsigned, unsigned, unsigned, int *); | 946 | extern unsigned ufs_new_fragments(struct inode *, __fs32 *, unsigned, unsigned, |
947 | unsigned, int *, struct page *); | ||
880 | 948 | ||
881 | /* cylinder.c */ | 949 | /* cylinder.c */ |
882 | extern struct ufs_cg_private_info * ufs_load_cylinder (struct super_block *, unsigned); | 950 | extern struct ufs_cg_private_info * ufs_load_cylinder (struct super_block *, unsigned); |
@@ -887,30 +955,29 @@ extern struct inode_operations ufs_dir_inode_operations; | |||
887 | extern int ufs_add_link (struct dentry *, struct inode *); | 955 | extern int ufs_add_link (struct dentry *, struct inode *); |
888 | extern ino_t ufs_inode_by_name(struct inode *, struct dentry *); | 956 | extern ino_t ufs_inode_by_name(struct inode *, struct dentry *); |
889 | extern int ufs_make_empty(struct inode *, struct inode *); | 957 | extern int ufs_make_empty(struct inode *, struct inode *); |
890 | extern struct ufs_dir_entry * ufs_find_entry (struct dentry *, struct buffer_head **); | 958 | extern struct ufs_dir_entry *ufs_find_entry(struct inode *, struct dentry *, struct page **); |
891 | extern int ufs_delete_entry (struct inode *, struct ufs_dir_entry *, struct buffer_head *); | 959 | extern int ufs_delete_entry(struct inode *, struct ufs_dir_entry *, struct page *); |
892 | extern int ufs_empty_dir (struct inode *); | 960 | extern int ufs_empty_dir (struct inode *); |
893 | extern struct ufs_dir_entry * ufs_dotdot (struct inode *, struct buffer_head **); | 961 | extern struct ufs_dir_entry *ufs_dotdot(struct inode *, struct page **); |
894 | extern void ufs_set_link(struct inode *, struct ufs_dir_entry *, struct buffer_head *, struct inode *); | 962 | extern void ufs_set_link(struct inode *dir, struct ufs_dir_entry *de, |
963 | struct page *page, struct inode *inode); | ||
895 | 964 | ||
896 | /* file.c */ | 965 | /* file.c */ |
897 | extern struct inode_operations ufs_file_inode_operations; | 966 | extern struct inode_operations ufs_file_inode_operations; |
898 | extern const struct file_operations ufs_file_operations; | 967 | extern const struct file_operations ufs_file_operations; |
899 | 968 | ||
900 | extern struct address_space_operations ufs_aops; | 969 | extern const struct address_space_operations ufs_aops; |
901 | 970 | ||
902 | /* ialloc.c */ | 971 | /* ialloc.c */ |
903 | extern void ufs_free_inode (struct inode *inode); | 972 | extern void ufs_free_inode (struct inode *inode); |
904 | extern struct inode * ufs_new_inode (struct inode *, int); | 973 | extern struct inode * ufs_new_inode (struct inode *, int); |
905 | 974 | ||
906 | /* inode.c */ | 975 | /* inode.c */ |
907 | extern u64 ufs_frag_map (struct inode *, sector_t); | ||
908 | extern void ufs_read_inode (struct inode *); | 976 | extern void ufs_read_inode (struct inode *); |
909 | extern void ufs_put_inode (struct inode *); | 977 | extern void ufs_put_inode (struct inode *); |
910 | extern int ufs_write_inode (struct inode *, int); | 978 | extern int ufs_write_inode (struct inode *, int); |
911 | extern int ufs_sync_inode (struct inode *); | 979 | extern int ufs_sync_inode (struct inode *); |
912 | extern void ufs_delete_inode (struct inode *); | 980 | extern void ufs_delete_inode (struct inode *); |
913 | extern struct buffer_head * ufs_getfrag (struct inode *, unsigned, int, int *); | ||
914 | extern struct buffer_head * ufs_bread (struct inode *, unsigned, int, int *); | 981 | extern struct buffer_head * ufs_bread (struct inode *, unsigned, int, int *); |
915 | extern int ufs_getfrag_block (struct inode *inode, sector_t fragment, struct buffer_head *bh_result, int create); | 982 | extern int ufs_getfrag_block (struct inode *inode, sector_t fragment, struct buffer_head *bh_result, int create); |
916 | 983 | ||
@@ -926,7 +993,7 @@ extern void ufs_panic (struct super_block *, const char *, const char *, ...) __ | |||
926 | extern struct inode_operations ufs_fast_symlink_inode_operations; | 993 | extern struct inode_operations ufs_fast_symlink_inode_operations; |
927 | 994 | ||
928 | /* truncate.c */ | 995 | /* truncate.c */ |
929 | extern void ufs_truncate (struct inode *); | 996 | extern int ufs_truncate (struct inode *, loff_t); |
930 | 997 | ||
931 | static inline struct ufs_sb_info *UFS_SB(struct super_block *sb) | 998 | static inline struct ufs_sb_info *UFS_SB(struct super_block *sb) |
932 | { | 999 | { |
diff --git a/include/linux/ufs_fs_i.h b/include/linux/ufs_fs_i.h index 21665a953978..f50ce3b0cd52 100644 --- a/include/linux/ufs_fs_i.h +++ b/include/linux/ufs_fs_i.h | |||
@@ -27,6 +27,7 @@ struct ufs_inode_info { | |||
27 | __u32 i_oeftflag; | 27 | __u32 i_oeftflag; |
28 | __u16 i_osync; | 28 | __u16 i_osync; |
29 | __u32 i_lastfrag; | 29 | __u32 i_lastfrag; |
30 | __u32 i_dir_start_lookup; | ||
30 | struct inode vfs_inode; | 31 | struct inode vfs_inode; |
31 | }; | 32 | }; |
32 | 33 | ||
diff --git a/include/linux/unistd.h b/include/linux/unistd.h index 10ed9834b822..c18c60f3254e 100644 --- a/include/linux/unistd.h +++ b/include/linux/unistd.h | |||
@@ -1,7 +1,9 @@ | |||
1 | #ifndef _LINUX_UNISTD_H_ | 1 | #ifndef _LINUX_UNISTD_H_ |
2 | #define _LINUX_UNISTD_H_ | 2 | #define _LINUX_UNISTD_H_ |
3 | 3 | ||
4 | #ifdef __KERNEL__ | ||
4 | extern int errno; | 5 | extern int errno; |
6 | #endif | ||
5 | 7 | ||
6 | /* | 8 | /* |
7 | * Include machine specific syscallX macros | 9 | * Include machine specific syscallX macros |
diff --git a/include/linux/unwind.h b/include/linux/unwind.h new file mode 100644 index 000000000000..ce48e2cd37a2 --- /dev/null +++ b/include/linux/unwind.h | |||
@@ -0,0 +1,127 @@ | |||
1 | #ifndef _LINUX_UNWIND_H | ||
2 | #define _LINUX_UNWIND_H | ||
3 | |||
4 | /* | ||
5 | * Copyright (C) 2002-2006 Novell, Inc. | ||
6 | * Jan Beulich <jbeulich@novell.com> | ||
7 | * This code is released under version 2 of the GNU GPL. | ||
8 | * | ||
9 | * A simple API for unwinding kernel stacks. This is used for | ||
10 | * debugging and error reporting purposes. The kernel doesn't need | ||
11 | * full-blown stack unwinding with all the bells and whistles, so there | ||
12 | * is not much point in implementing the full Dwarf2 unwind API. | ||
13 | */ | ||
14 | |||
15 | #include <linux/config.h> | ||
16 | |||
17 | struct module; | ||
18 | |||
19 | #ifdef CONFIG_STACK_UNWIND | ||
20 | |||
21 | #include <asm/unwind.h> | ||
22 | |||
23 | #ifndef ARCH_UNWIND_SECTION_NAME | ||
24 | #define ARCH_UNWIND_SECTION_NAME ".eh_frame" | ||
25 | #endif | ||
26 | |||
27 | /* | ||
28 | * Initialize unwind support. | ||
29 | */ | ||
30 | extern void unwind_init(void); | ||
31 | |||
32 | #ifdef CONFIG_MODULES | ||
33 | |||
34 | extern void *unwind_add_table(struct module *, | ||
35 | const void *table_start, | ||
36 | unsigned long table_size); | ||
37 | |||
38 | extern void unwind_remove_table(void *handle, int init_only); | ||
39 | |||
40 | #endif | ||
41 | |||
42 | extern int unwind_init_frame_info(struct unwind_frame_info *, | ||
43 | struct task_struct *, | ||
44 | /*const*/ struct pt_regs *); | ||
45 | |||
46 | /* | ||
47 | * Prepare to unwind a blocked task. | ||
48 | */ | ||
49 | extern int unwind_init_blocked(struct unwind_frame_info *, | ||
50 | struct task_struct *); | ||
51 | |||
52 | /* | ||
53 | * Prepare to unwind the currently running thread. | ||
54 | */ | ||
55 | extern int unwind_init_running(struct unwind_frame_info *, | ||
56 | asmlinkage int (*callback)(struct unwind_frame_info *, | ||
57 | void *arg), | ||
58 | void *arg); | ||
59 | |||
60 | /* | ||
61 | * Unwind to previous to frame. Returns 0 if successful, negative | ||
62 | * number in case of an error. | ||
63 | */ | ||
64 | extern int unwind(struct unwind_frame_info *); | ||
65 | |||
66 | /* | ||
67 | * Unwind until the return pointer is in user-land (or until an error | ||
68 | * occurs). Returns 0 if successful, negative number in case of | ||
69 | * error. | ||
70 | */ | ||
71 | extern int unwind_to_user(struct unwind_frame_info *); | ||
72 | |||
73 | #else | ||
74 | |||
75 | struct unwind_frame_info {}; | ||
76 | |||
77 | static inline void unwind_init(void) {} | ||
78 | |||
79 | #ifdef CONFIG_MODULES | ||
80 | |||
81 | static inline void *unwind_add_table(struct module *mod, | ||
82 | const void *table_start, | ||
83 | unsigned long table_size) | ||
84 | { | ||
85 | return NULL; | ||
86 | } | ||
87 | |||
88 | #endif | ||
89 | |||
90 | static inline void unwind_remove_table(void *handle, int init_only) | ||
91 | { | ||
92 | } | ||
93 | |||
94 | static inline int unwind_init_frame_info(struct unwind_frame_info *info, | ||
95 | struct task_struct *tsk, | ||
96 | const struct pt_regs *regs) | ||
97 | { | ||
98 | return -ENOSYS; | ||
99 | } | ||
100 | |||
101 | static inline int unwind_init_blocked(struct unwind_frame_info *info, | ||
102 | struct task_struct *tsk) | ||
103 | { | ||
104 | return -ENOSYS; | ||
105 | } | ||
106 | |||
107 | static inline int unwind_init_running(struct unwind_frame_info *info, | ||
108 | asmlinkage int (*cb)(struct unwind_frame_info *, | ||
109 | void *arg), | ||
110 | void *arg) | ||
111 | { | ||
112 | return -ENOSYS; | ||
113 | } | ||
114 | |||
115 | static inline int unwind(struct unwind_frame_info *info) | ||
116 | { | ||
117 | return -ENOSYS; | ||
118 | } | ||
119 | |||
120 | static inline int unwind_to_user(struct unwind_frame_info *info) | ||
121 | { | ||
122 | return -ENOSYS; | ||
123 | } | ||
124 | |||
125 | #endif | ||
126 | |||
127 | #endif /* _LINUX_UNWIND_H */ | ||
diff --git a/include/linux/usb.h b/include/linux/usb.h index e34e5e3dce52..8dead32e7ebf 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -10,7 +10,6 @@ | |||
10 | 10 | ||
11 | #ifdef __KERNEL__ | 11 | #ifdef __KERNEL__ |
12 | 12 | ||
13 | #include <linux/config.h> | ||
14 | #include <linux/errno.h> /* for -ENODEV */ | 13 | #include <linux/errno.h> /* for -ENODEV */ |
15 | #include <linux/delay.h> /* for mdelay() */ | 14 | #include <linux/delay.h> /* for mdelay() */ |
16 | #include <linux/interrupt.h> /* for in_interrupt() */ | 15 | #include <linux/interrupt.h> /* for in_interrupt() */ |
@@ -41,6 +40,8 @@ struct usb_driver; | |||
41 | * Devices may also have class-specific or vendor-specific descriptors. | 40 | * Devices may also have class-specific or vendor-specific descriptors. |
42 | */ | 41 | */ |
43 | 42 | ||
43 | struct ep_device; | ||
44 | |||
44 | /** | 45 | /** |
45 | * struct usb_host_endpoint - host-side endpoint descriptor and queue | 46 | * struct usb_host_endpoint - host-side endpoint descriptor and queue |
46 | * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder | 47 | * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder |
@@ -58,7 +59,7 @@ struct usb_host_endpoint { | |||
58 | struct usb_endpoint_descriptor desc; | 59 | struct usb_endpoint_descriptor desc; |
59 | struct list_head urb_list; | 60 | struct list_head urb_list; |
60 | void *hcpriv; | 61 | void *hcpriv; |
61 | struct kobject *kobj; /* For sysfs info */ | 62 | struct ep_device *ep_dev; /* For sysfs info */ |
62 | 63 | ||
63 | unsigned char *extra; /* Extra descriptors */ | 64 | unsigned char *extra; /* Extra descriptors */ |
64 | int extralen; | 65 | int extralen; |
@@ -102,7 +103,8 @@ enum usb_interface_condition { | |||
102 | * @condition: binding state of the interface: not bound, binding | 103 | * @condition: binding state of the interface: not bound, binding |
103 | * (in probe()), bound to a driver, or unbinding (in disconnect()) | 104 | * (in probe()), bound to a driver, or unbinding (in disconnect()) |
104 | * @dev: driver model's view of this device | 105 | * @dev: driver model's view of this device |
105 | * @class_dev: driver model's class view of this device. | 106 | * @usb_dev: if an interface is bound to the USB major, this will point |
107 | * to the sysfs representation for that device. | ||
106 | * | 108 | * |
107 | * USB device drivers attach to interfaces on a physical device. Each | 109 | * USB device drivers attach to interfaces on a physical device. Each |
108 | * interface encapsulates a single high level function, such as feeding | 110 | * interface encapsulates a single high level function, such as feeding |
@@ -142,7 +144,7 @@ struct usb_interface { | |||
142 | * bound to */ | 144 | * bound to */ |
143 | enum usb_interface_condition condition; /* state of binding */ | 145 | enum usb_interface_condition condition; /* state of binding */ |
144 | struct device dev; /* interface specific device info */ | 146 | struct device dev; /* interface specific device info */ |
145 | struct class_device *class_dev; | 147 | struct device *usb_dev; /* pointer to the usb class's device, if any */ |
146 | }; | 148 | }; |
147 | #define to_usb_interface(d) container_of(d, struct usb_interface, dev) | 149 | #define to_usb_interface(d) container_of(d, struct usb_interface, dev) |
148 | #define interface_to_usbdev(intf) \ | 150 | #define interface_to_usbdev(intf) \ |
@@ -359,7 +361,7 @@ struct usb_device { | |||
359 | char *serial; /* iSerialNumber string, if present */ | 361 | char *serial; /* iSerialNumber string, if present */ |
360 | 362 | ||
361 | struct list_head filelist; | 363 | struct list_head filelist; |
362 | struct class_device *class_dev; | 364 | struct device *usbfs_dev; |
363 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ | 365 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ |
364 | 366 | ||
365 | /* | 367 | /* |
@@ -387,6 +389,8 @@ extern int usb_lock_device_for_reset(struct usb_device *udev, | |||
387 | 389 | ||
388 | /* USB port reset for device reinitialization */ | 390 | /* USB port reset for device reinitialization */ |
389 | extern int usb_reset_device(struct usb_device *dev); | 391 | extern int usb_reset_device(struct usb_device *dev); |
392 | extern int usb_reset_composite_device(struct usb_device *dev, | ||
393 | struct usb_interface *iface); | ||
390 | 394 | ||
391 | extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); | 395 | extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); |
392 | 396 | ||
@@ -555,6 +559,10 @@ struct usb_dynids { | |||
555 | * do (or don't) show up otherwise in the filesystem. | 559 | * do (or don't) show up otherwise in the filesystem. |
556 | * @suspend: Called when the device is going to be suspended by the system. | 560 | * @suspend: Called when the device is going to be suspended by the system. |
557 | * @resume: Called when the device is being resumed by the system. | 561 | * @resume: Called when the device is being resumed by the system. |
562 | * @pre_reset: Called by usb_reset_composite_device() when the device | ||
563 | * is about to be reset. | ||
564 | * @post_reset: Called by usb_reset_composite_device() after the device | ||
565 | * has been reset. | ||
558 | * @id_table: USB drivers use ID table to support hotplugging. | 566 | * @id_table: USB drivers use ID table to support hotplugging. |
559 | * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set | 567 | * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set |
560 | * or your driver's probe function will never get called. | 568 | * or your driver's probe function will never get called. |
@@ -593,6 +601,9 @@ struct usb_driver { | |||
593 | int (*suspend) (struct usb_interface *intf, pm_message_t message); | 601 | int (*suspend) (struct usb_interface *intf, pm_message_t message); |
594 | int (*resume) (struct usb_interface *intf); | 602 | int (*resume) (struct usb_interface *intf); |
595 | 603 | ||
604 | void (*pre_reset) (struct usb_interface *intf); | ||
605 | void (*post_reset) (struct usb_interface *intf); | ||
606 | |||
596 | const struct usb_device_id *id_table; | 607 | const struct usb_device_id *id_table; |
597 | 608 | ||
598 | struct usb_dynids dynids; | 609 | struct usb_dynids dynids; |
@@ -1009,6 +1020,8 @@ void usb_buffer_unmap_sg (struct usb_device *dev, unsigned pipe, | |||
1009 | extern int usb_control_msg(struct usb_device *dev, unsigned int pipe, | 1020 | extern int usb_control_msg(struct usb_device *dev, unsigned int pipe, |
1010 | __u8 request, __u8 requesttype, __u16 value, __u16 index, | 1021 | __u8 request, __u8 requesttype, __u16 value, __u16 index, |
1011 | void *data, __u16 size, int timeout); | 1022 | void *data, __u16 size, int timeout); |
1023 | extern int usb_interrupt_msg(struct usb_device *usb_dev, unsigned int pipe, | ||
1024 | void *data, int len, int *actual_length, int timeout); | ||
1012 | extern int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe, | 1025 | extern int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe, |
1013 | void *data, int len, int *actual_length, | 1026 | void *data, int len, int *actual_length, |
1014 | int timeout); | 1027 | int timeout); |
diff --git a/include/linux/usb_cdc.h b/include/linux/usb/cdc.h index ba617c372455..ba617c372455 100644 --- a/include/linux/usb_cdc.h +++ b/include/linux/usb/cdc.h | |||
diff --git a/include/linux/usb_input.h b/include/linux/usb/input.h index 716e0cc16043..716e0cc16043 100644 --- a/include/linux/usb_input.h +++ b/include/linux/usb/input.h | |||
diff --git a/include/linux/usb_isp116x.h b/include/linux/usb/isp116x.h index 436dd8a2b64a..436dd8a2b64a 100644 --- a/include/linux/usb_isp116x.h +++ b/include/linux/usb/isp116x.h | |||
diff --git a/include/linux/usb_sl811.h b/include/linux/usb/sl811.h index 4f2d012d7309..397ee3b3d7f3 100644 --- a/include/linux/usb_sl811.h +++ b/include/linux/usb/sl811.h | |||
@@ -14,13 +14,13 @@ struct sl811_platform_data { | |||
14 | u8 power; | 14 | u8 power; |
15 | 15 | ||
16 | /* sl811 relies on an external source of VBUS current */ | 16 | /* sl811 relies on an external source of VBUS current */ |
17 | void (*port_power)(struct device *dev, int is_on); | 17 | void (*port_power)(struct device *dev, int is_on); |
18 | 18 | ||
19 | /* pulse sl811 nRST (probably with a GPIO) */ | 19 | /* pulse sl811 nRST (probably with a GPIO) */ |
20 | void (*reset)(struct device *dev); | 20 | void (*reset)(struct device *dev); |
21 | 21 | ||
22 | // some boards need something like these: | 22 | // some boards need something like these: |
23 | // int (*check_overcurrent)(struct device *dev); | 23 | // int (*check_overcurrent)(struct device *dev); |
24 | // void (*clock_enable)(struct device *dev, int is_on); | 24 | // void (*clock_enable)(struct device *dev, int is_on); |
25 | }; | 25 | }; |
26 | 26 | ||
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h index b2d08984a9f7..608487a62c98 100644 --- a/include/linux/usb_usual.h +++ b/include/linux/usb_usual.h | |||
@@ -9,7 +9,6 @@ | |||
9 | #ifndef __LINUX_USB_USUAL_H | 9 | #ifndef __LINUX_USB_USUAL_H |
10 | #define __LINUX_USB_USUAL_H | 10 | #define __LINUX_USB_USUAL_H |
11 | 11 | ||
12 | #include <linux/config.h> | ||
13 | 12 | ||
14 | /* We should do this for cleanliness... But other usb_foo.h do not do this. */ | 13 | /* We should do this for cleanliness... But other usb_foo.h do not do this. */ |
15 | /* #include <linux/usb.h> */ | 14 | /* #include <linux/usb.h> */ |
diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h index 8859f0b41543..7b7aadb69092 100644 --- a/include/linux/usbdevice_fs.h +++ b/include/linux/usbdevice_fs.h | |||
@@ -123,6 +123,7 @@ struct usbdevfs_hub_portinfo { | |||
123 | char port [127]; /* e.g. port 3 connects to device 27 */ | 123 | char port [127]; /* e.g. port 3 connects to device 27 */ |
124 | }; | 124 | }; |
125 | 125 | ||
126 | #ifdef __KERNEL__ | ||
126 | #ifdef CONFIG_COMPAT | 127 | #ifdef CONFIG_COMPAT |
127 | #include <linux/compat.h> | 128 | #include <linux/compat.h> |
128 | struct usbdevfs_urb32 { | 129 | struct usbdevfs_urb32 { |
@@ -147,6 +148,7 @@ struct usbdevfs_ioctl32 { | |||
147 | compat_caddr_t data; | 148 | compat_caddr_t data; |
148 | }; | 149 | }; |
149 | #endif | 150 | #endif |
151 | #endif /* __KERNEL__ */ | ||
150 | 152 | ||
151 | #define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer) | 153 | #define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer) |
152 | #define USBDEVFS_BULK _IOWR('U', 2, struct usbdevfs_bulktransfer) | 154 | #define USBDEVFS_BULK _IOWR('U', 2, struct usbdevfs_bulktransfer) |
diff --git a/include/linux/videodev.h b/include/linux/videodev.h index 91140091ced2..41bc7e9603cd 100644 --- a/include/linux/videodev.h +++ b/include/linux/videodev.h | |||
@@ -1,49 +1,21 @@ | |||
1 | /* | ||
2 | * Video for Linux version 1 - OBSOLETE | ||
3 | * | ||
4 | * Header file for v4l1 drivers and applications, for | ||
5 | * Linux kernels 2.2.x or 2.4.x. | ||
6 | * | ||
7 | * Provides header for legacy drivers and applications | ||
8 | * | ||
9 | * See http://linuxtv.org for more info | ||
10 | * | ||
11 | */ | ||
1 | #ifndef __LINUX_VIDEODEV_H | 12 | #ifndef __LINUX_VIDEODEV_H |
2 | #define __LINUX_VIDEODEV_H | 13 | #define __LINUX_VIDEODEV_H |
3 | 14 | ||
4 | #include <linux/types.h> | ||
5 | |||
6 | #define HAVE_V4L1 1 | 15 | #define HAVE_V4L1 1 |
7 | 16 | ||
8 | #include <linux/videodev2.h> | 17 | #include <linux/videodev2.h> |
9 | 18 | ||
10 | #ifdef __KERNEL__ | ||
11 | |||
12 | #include <linux/mm.h> | ||
13 | |||
14 | extern struct video_device* video_devdata(struct file*); | ||
15 | |||
16 | #define to_video_device(cd) container_of(cd, struct video_device, class_dev) | ||
17 | static inline void | ||
18 | video_device_create_file(struct video_device *vfd, | ||
19 | struct class_device_attribute *attr) | ||
20 | { | ||
21 | class_device_create_file(&vfd->class_dev, attr); | ||
22 | } | ||
23 | static inline void | ||
24 | video_device_remove_file(struct video_device *vfd, | ||
25 | struct class_device_attribute *attr) | ||
26 | { | ||
27 | class_device_remove_file(&vfd->class_dev, attr); | ||
28 | } | ||
29 | |||
30 | #if OBSOLETE_OWNER /* to be removed in 2.6.15 */ | ||
31 | /* helper functions to access driver private data. */ | ||
32 | static inline void *video_get_drvdata(struct video_device *dev) | ||
33 | { | ||
34 | return dev->priv; | ||
35 | } | ||
36 | |||
37 | static inline void video_set_drvdata(struct video_device *dev, void *data) | ||
38 | { | ||
39 | dev->priv = data; | ||
40 | } | ||
41 | #endif | ||
42 | |||
43 | extern int video_exclusive_open(struct inode *inode, struct file *file); | ||
44 | extern int video_exclusive_release(struct inode *inode, struct file *file); | ||
45 | #endif /* __KERNEL__ */ | ||
46 | |||
47 | struct video_capability | 19 | struct video_capability |
48 | { | 20 | { |
49 | char name[32]; | 21 | char name[32]; |
@@ -363,6 +335,7 @@ struct video_code | |||
363 | #define VID_HARDWARE_SAA7114H 37 | 335 | #define VID_HARDWARE_SAA7114H 37 |
364 | #define VID_HARDWARE_SN9C102 38 | 336 | #define VID_HARDWARE_SN9C102 38 |
365 | #define VID_HARDWARE_ARV 39 | 337 | #define VID_HARDWARE_ARV 39 |
338 | |||
366 | #endif /* __LINUX_VIDEODEV_H */ | 339 | #endif /* __LINUX_VIDEODEV_H */ |
367 | 340 | ||
368 | /* | 341 | /* |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index ad7fa9c86c10..a62673dad76e 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -1,35 +1,33 @@ | |||
1 | #ifndef __LINUX_VIDEODEV2_H | ||
2 | #define __LINUX_VIDEODEV2_H | ||
3 | /* | 1 | /* |
4 | * Video for Linux Two | 2 | * Video for Linux Two |
5 | * | 3 | * |
6 | * Header file for v4l or V4L2 drivers and applications, for | 4 | * Header file for v4l or V4L2 drivers and applications |
7 | * Linux kernels 2.2.x or 2.4.x. | 5 | * with public API. |
6 | * All kernel-specific stuff were moved to media/v4l2-dev.h, so | ||
7 | * no #if __KERNEL tests are allowed here | ||
8 | * | 8 | * |
9 | * See http://bytesex.org/v4l/ for API specs and other | 9 | * See http://linuxtv.org for more info |
10 | * v4l2 documentation. | ||
11 | * | 10 | * |
12 | * Author: Bill Dirks <bdirks@pacbell.net> | 11 | * Author: Bill Dirks <bdirks@pacbell.net> |
13 | * Justin Schoeman | 12 | * Justin Schoeman |
14 | * et al. | 13 | * et al. |
15 | */ | 14 | */ |
15 | #ifndef __LINUX_VIDEODEV2_H | ||
16 | #define __LINUX_VIDEODEV2_H | ||
16 | #ifdef __KERNEL__ | 17 | #ifdef __KERNEL__ |
17 | #include <linux/time.h> /* need struct timeval */ | 18 | #include <linux/time.h> /* need struct timeval */ |
18 | #include <linux/poll.h> | ||
19 | #include <linux/device.h> | ||
20 | #include <linux/mutex.h> | ||
21 | #endif | ||
22 | #include <linux/compiler.h> /* need __user */ | 19 | #include <linux/compiler.h> /* need __user */ |
20 | #else | ||
21 | #define __user | ||
22 | #endif | ||
23 | #include <linux/types.h> | ||
23 | 24 | ||
24 | |||
25 | #define OBSOLETE_OWNER 1 /* It will be removed for 2.6.17 */ | ||
26 | #define HAVE_V4L2 1 | 25 | #define HAVE_V4L2 1 |
27 | 26 | ||
28 | /* | 27 | /* |
29 | * Common stuff for both V4L1 and V4L2 | 28 | * Common stuff for both V4L1 and V4L2 |
30 | * Moved from videodev.h | 29 | * Moved from videodev.h |
31 | */ | 30 | */ |
32 | |||
33 | #define VIDEO_MAX_FRAME 32 | 31 | #define VIDEO_MAX_FRAME 32 |
34 | 32 | ||
35 | #define VID_TYPE_CAPTURE 1 /* Can capture */ | 33 | #define VID_TYPE_CAPTURE 1 /* Can capture */ |
@@ -47,71 +45,6 @@ | |||
47 | #define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */ | 45 | #define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */ |
48 | #define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */ | 46 | #define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */ |
49 | 47 | ||
50 | #ifdef __KERNEL__ | ||
51 | |||
52 | /* Minor device allocation */ | ||
53 | #define MINOR_VFL_TYPE_GRABBER_MIN 0 | ||
54 | #define MINOR_VFL_TYPE_GRABBER_MAX 63 | ||
55 | #define MINOR_VFL_TYPE_RADIO_MIN 64 | ||
56 | #define MINOR_VFL_TYPE_RADIO_MAX 127 | ||
57 | #define MINOR_VFL_TYPE_VTX_MIN 192 | ||
58 | #define MINOR_VFL_TYPE_VTX_MAX 223 | ||
59 | #define MINOR_VFL_TYPE_VBI_MIN 224 | ||
60 | #define MINOR_VFL_TYPE_VBI_MAX 255 | ||
61 | |||
62 | #define VFL_TYPE_GRABBER 0 | ||
63 | #define VFL_TYPE_VBI 1 | ||
64 | #define VFL_TYPE_RADIO 2 | ||
65 | #define VFL_TYPE_VTX 3 | ||
66 | |||
67 | struct video_device | ||
68 | { | ||
69 | /* device info */ | ||
70 | struct device *dev; | ||
71 | char name[32]; | ||
72 | int type; /* v4l1 */ | ||
73 | int type2; /* v4l2 */ | ||
74 | int hardware; | ||
75 | int minor; | ||
76 | |||
77 | /* device ops + callbacks */ | ||
78 | const struct file_operations *fops; | ||
79 | void (*release)(struct video_device *vfd); | ||
80 | |||
81 | |||
82 | #if OBSOLETE_OWNER /* to be removed in 2.6.15 */ | ||
83 | /* obsolete -- fops->owner is used instead */ | ||
84 | struct module *owner; | ||
85 | /* dev->driver_data will be used instead some day. | ||
86 | * Use the video_{get|set}_drvdata() helper functions, | ||
87 | * so the switch over will be transparent for you. | ||
88 | * Or use {pci|usb}_{get|set}_drvdata() directly. */ | ||
89 | void *priv; | ||
90 | #endif | ||
91 | |||
92 | /* for videodev.c intenal usage -- please don't touch */ | ||
93 | int users; /* video_exclusive_{open|close} ... */ | ||
94 | struct mutex lock; /* ... helper function uses these */ | ||
95 | char devfs_name[64]; /* devfs */ | ||
96 | struct class_device class_dev; /* sysfs */ | ||
97 | }; | ||
98 | |||
99 | #define VIDEO_MAJOR 81 | ||
100 | |||
101 | extern int video_register_device(struct video_device *, int type, int nr); | ||
102 | extern void video_unregister_device(struct video_device *); | ||
103 | extern int video_usercopy(struct inode *inode, struct file *file, | ||
104 | unsigned int cmd, unsigned long arg, | ||
105 | int (*func)(struct inode *inode, struct file *file, | ||
106 | unsigned int cmd, void *arg)); | ||
107 | |||
108 | /* helper functions to alloc / release struct video_device, the | ||
109 | later can be used for video_device->release() */ | ||
110 | struct video_device *video_device_alloc(void); | ||
111 | void video_device_release(struct video_device *vfd); | ||
112 | |||
113 | #endif | ||
114 | |||
115 | /* | 48 | /* |
116 | * M I S C E L L A N E O U S | 49 | * M I S C E L L A N E O U S |
117 | */ | 50 | */ |
@@ -172,6 +105,8 @@ enum v4l2_ctrl_type { | |||
172 | V4L2_CTRL_TYPE_BOOLEAN = 2, | 105 | V4L2_CTRL_TYPE_BOOLEAN = 2, |
173 | V4L2_CTRL_TYPE_MENU = 3, | 106 | V4L2_CTRL_TYPE_MENU = 3, |
174 | V4L2_CTRL_TYPE_BUTTON = 4, | 107 | V4L2_CTRL_TYPE_BUTTON = 4, |
108 | V4L2_CTRL_TYPE_INTEGER64 = 5, | ||
109 | V4L2_CTRL_TYPE_CTRL_CLASS = 6, | ||
175 | }; | 110 | }; |
176 | 111 | ||
177 | enum v4l2_tuner_type { | 112 | enum v4l2_tuner_type { |
@@ -270,7 +205,6 @@ struct v4l2_capability | |||
270 | /* | 205 | /* |
271 | * V I D E O I M A G E F O R M A T | 206 | * V I D E O I M A G E F O R M A T |
272 | */ | 207 | */ |
273 | |||
274 | struct v4l2_pix_format | 208 | struct v4l2_pix_format |
275 | { | 209 | { |
276 | __u32 width; | 210 | __u32 width; |
@@ -283,7 +217,7 @@ struct v4l2_pix_format | |||
283 | __u32 priv; /* private data, depends on pixelformat */ | 217 | __u32 priv; /* private data, depends on pixelformat */ |
284 | }; | 218 | }; |
285 | 219 | ||
286 | /* Pixel format FOURCC depth Description */ | 220 | /* Pixel format FOURCC depth Description */ |
287 | #define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R','G','B','1') /* 8 RGB-3-3-2 */ | 221 | #define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R','G','B','1') /* 8 RGB-3-3-2 */ |
288 | #define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R','G','B','O') /* 16 RGB-5-5-5 */ | 222 | #define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R','G','B','O') /* 16 RGB-5-5-5 */ |
289 | #define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R','G','B','P') /* 16 RGB-5-6-5 */ | 223 | #define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R','G','B','P') /* 16 RGB-5-6-5 */ |
@@ -311,6 +245,7 @@ struct v4l2_pix_format | |||
311 | #define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y','U','1','2') /* 12 YUV 4:2:0 */ | 245 | #define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y','U','1','2') /* 12 YUV 4:2:0 */ |
312 | #define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y','Y','U','V') /* 16 YUV 4:2:2 */ | 246 | #define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y','Y','U','V') /* 16 YUV 4:2:2 */ |
313 | #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H','I','2','4') /* 8 8-bit color */ | 247 | #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H','I','2','4') /* 8 8-bit color */ |
248 | #define V4L2_PIX_FMT_HM12 v4l2_fourcc('H','M','1','2') /* 8 YUV 4:1:1 16x16 macroblocks */ | ||
314 | 249 | ||
315 | /* see http://www.siliconimaging.com/RGB%20Bayer.htm */ | 250 | /* see http://www.siliconimaging.com/RGB%20Bayer.htm */ |
316 | #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1') /* 8 BGBG.. GRGR.. */ | 251 | #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1') /* 8 BGBG.. GRGR.. */ |
@@ -319,7 +254,7 @@ struct v4l2_pix_format | |||
319 | #define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M','J','P','G') /* Motion-JPEG */ | 254 | #define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M','J','P','G') /* Motion-JPEG */ |
320 | #define V4L2_PIX_FMT_JPEG v4l2_fourcc('J','P','E','G') /* JFIF JPEG */ | 255 | #define V4L2_PIX_FMT_JPEG v4l2_fourcc('J','P','E','G') /* JFIF JPEG */ |
321 | #define V4L2_PIX_FMT_DV v4l2_fourcc('d','v','s','d') /* 1394 */ | 256 | #define V4L2_PIX_FMT_DV v4l2_fourcc('d','v','s','d') /* 1394 */ |
322 | #define V4L2_PIX_FMT_MPEG v4l2_fourcc('M','P','E','G') /* MPEG */ | 257 | #define V4L2_PIX_FMT_MPEG v4l2_fourcc('M','P','E','G') /* MPEG-1/2/4 */ |
323 | 258 | ||
324 | /* Vendor-specific formats */ | 259 | /* Vendor-specific formats */ |
325 | #define V4L2_PIX_FMT_WNVA v4l2_fourcc('W','N','V','A') /* Winnov hw compress */ | 260 | #define V4L2_PIX_FMT_WNVA v4l2_fourcc('W','N','V','A') /* Winnov hw compress */ |
@@ -343,7 +278,6 @@ struct v4l2_fmtdesc | |||
343 | 278 | ||
344 | #define V4L2_FMT_FLAG_COMPRESSED 0x0001 | 279 | #define V4L2_FMT_FLAG_COMPRESSED 0x0001 |
345 | 280 | ||
346 | |||
347 | /* | 281 | /* |
348 | * T I M E C O D E | 282 | * T I M E C O D E |
349 | */ | 283 | */ |
@@ -373,16 +307,15 @@ struct v4l2_timecode | |||
373 | #define V4L2_TC_USERBITS_8BITCHARS 0x0008 | 307 | #define V4L2_TC_USERBITS_8BITCHARS 0x0008 |
374 | /* The above is based on SMPTE timecodes */ | 308 | /* The above is based on SMPTE timecodes */ |
375 | 309 | ||
376 | 310 | #ifdef __KERNEL__ | |
377 | /* | 311 | /* |
378 | * M P E G C O M P R E S S I O N P A R A M E T E R S | 312 | * M P E G C O M P R E S S I O N P A R A M E T E R S |
379 | * | 313 | * |
380 | * ### WARNING: this is still work-in-progress right now, most likely | 314 | * ### WARNING: This experimental MPEG compression API is obsolete. |
381 | * ### there will be some incompatible changes. | 315 | * ### It is replaced by the MPEG controls API. |
316 | * ### This old API will disappear in the near future! | ||
382 | * | 317 | * |
383 | */ | 318 | */ |
384 | |||
385 | |||
386 | enum v4l2_bitrate_mode { | 319 | enum v4l2_bitrate_mode { |
387 | V4L2_BITRATE_NONE = 0, /* not specified */ | 320 | V4L2_BITRATE_NONE = 0, /* not specified */ |
388 | V4L2_BITRATE_CBR, /* constant bitrate */ | 321 | V4L2_BITRATE_CBR, /* constant bitrate */ |
@@ -460,6 +393,7 @@ struct v4l2_mpeg_compression { | |||
460 | /* I don't expect the above being perfect yet ;) */ | 393 | /* I don't expect the above being perfect yet ;) */ |
461 | __u32 reserved_5[8]; | 394 | __u32 reserved_5[8]; |
462 | }; | 395 | }; |
396 | #endif | ||
463 | 397 | ||
464 | struct v4l2_jpegcompression | 398 | struct v4l2_jpegcompression |
465 | { | 399 | { |
@@ -491,7 +425,6 @@ struct v4l2_jpegcompression | |||
491 | * allways use APP0 */ | 425 | * allways use APP0 */ |
492 | }; | 426 | }; |
493 | 427 | ||
494 | |||
495 | /* | 428 | /* |
496 | * M E M O R Y - M A P P I N G B U F F E R S | 429 | * M E M O R Y - M A P P I N G B U F F E R S |
497 | */ | 430 | */ |
@@ -573,7 +506,6 @@ struct v4l2_window | |||
573 | void __user *bitmap; | 506 | void __user *bitmap; |
574 | }; | 507 | }; |
575 | 508 | ||
576 | |||
577 | /* | 509 | /* |
578 | * C A P T U R E P A R A M E T E R S | 510 | * C A P T U R E P A R A M E T E R S |
579 | */ | 511 | */ |
@@ -586,6 +518,7 @@ struct v4l2_captureparm | |||
586 | __u32 readbuffers; /* # of buffers for read */ | 518 | __u32 readbuffers; /* # of buffers for read */ |
587 | __u32 reserved[4]; | 519 | __u32 reserved[4]; |
588 | }; | 520 | }; |
521 | |||
589 | /* Flags for 'capability' and 'capturemode' fields */ | 522 | /* Flags for 'capability' and 'capturemode' fields */ |
590 | #define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */ | 523 | #define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */ |
591 | #define V4L2_CAP_TIMEPERFRAME 0x1000 /* timeperframe field is supported */ | 524 | #define V4L2_CAP_TIMEPERFRAME 0x1000 /* timeperframe field is supported */ |
@@ -603,7 +536,6 @@ struct v4l2_outputparm | |||
603 | /* | 536 | /* |
604 | * I N P U T I M A G E C R O P P I N G | 537 | * I N P U T I M A G E C R O P P I N G |
605 | */ | 538 | */ |
606 | |||
607 | struct v4l2_cropcap { | 539 | struct v4l2_cropcap { |
608 | enum v4l2_buf_type type; | 540 | enum v4l2_buf_type type; |
609 | struct v4l2_rect bounds; | 541 | struct v4l2_rect bounds; |
@@ -710,7 +642,6 @@ struct v4l2_standard | |||
710 | __u32 reserved[4]; | 642 | __u32 reserved[4]; |
711 | }; | 643 | }; |
712 | 644 | ||
713 | |||
714 | /* | 645 | /* |
715 | * V I D E O I N P U T S | 646 | * V I D E O I N P U T S |
716 | */ | 647 | */ |
@@ -725,6 +656,7 @@ struct v4l2_input | |||
725 | __u32 status; | 656 | __u32 status; |
726 | __u32 reserved[4]; | 657 | __u32 reserved[4]; |
727 | }; | 658 | }; |
659 | |||
728 | /* Values for the 'type' field */ | 660 | /* Values for the 'type' field */ |
729 | #define V4L2_INPUT_TYPE_TUNER 1 | 661 | #define V4L2_INPUT_TYPE_TUNER 1 |
730 | #define V4L2_INPUT_TYPE_CAMERA 2 | 662 | #define V4L2_INPUT_TYPE_CAMERA 2 |
@@ -775,6 +707,34 @@ struct v4l2_control | |||
775 | __s32 value; | 707 | __s32 value; |
776 | }; | 708 | }; |
777 | 709 | ||
710 | struct v4l2_ext_control | ||
711 | { | ||
712 | __u32 id; | ||
713 | __u32 reserved2[2]; | ||
714 | union { | ||
715 | __s32 value; | ||
716 | __s64 value64; | ||
717 | void *reserved; | ||
718 | }; | ||
719 | }; | ||
720 | |||
721 | struct v4l2_ext_controls | ||
722 | { | ||
723 | __u32 ctrl_class; | ||
724 | __u32 count; | ||
725 | __u32 error_idx; | ||
726 | __u32 reserved[2]; | ||
727 | struct v4l2_ext_control *controls; | ||
728 | }; | ||
729 | |||
730 | /* Values for ctrl_class field */ | ||
731 | #define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */ | ||
732 | #define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */ | ||
733 | |||
734 | #define V4L2_CTRL_ID_MASK (0x0fffffff) | ||
735 | #define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) | ||
736 | #define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000) | ||
737 | |||
778 | /* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ | 738 | /* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ |
779 | struct v4l2_queryctrl | 739 | struct v4l2_queryctrl |
780 | { | 740 | { |
@@ -801,12 +761,21 @@ struct v4l2_querymenu | |||
801 | /* Control flags */ | 761 | /* Control flags */ |
802 | #define V4L2_CTRL_FLAG_DISABLED 0x0001 | 762 | #define V4L2_CTRL_FLAG_DISABLED 0x0001 |
803 | #define V4L2_CTRL_FLAG_GRABBED 0x0002 | 763 | #define V4L2_CTRL_FLAG_GRABBED 0x0002 |
764 | #define V4L2_CTRL_FLAG_READ_ONLY 0x0004 | ||
765 | #define V4L2_CTRL_FLAG_UPDATE 0x0008 | ||
766 | #define V4L2_CTRL_FLAG_INACTIVE 0x0010 | ||
767 | #define V4L2_CTRL_FLAG_SLIDER 0x0020 | ||
768 | |||
769 | /* Query flag, to be ORed with the control ID */ | ||
770 | #define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000 | ||
804 | 771 | ||
805 | /* Control IDs defined by V4L2 */ | 772 | /* User-class control IDs defined by V4L2 */ |
806 | #define V4L2_CID_BASE 0x00980900 | 773 | #define V4L2_CID_BASE (V4L2_CTRL_CLASS_USER | 0x900) |
774 | #define V4L2_CID_USER_BASE V4L2_CID_BASE | ||
807 | /* IDs reserved for driver specific controls */ | 775 | /* IDs reserved for driver specific controls */ |
808 | #define V4L2_CID_PRIVATE_BASE 0x08000000 | 776 | #define V4L2_CID_PRIVATE_BASE 0x08000000 |
809 | 777 | ||
778 | #define V4L2_CID_USER_CLASS (V4L2_CTRL_CLASS_USER | 1) | ||
810 | #define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0) | 779 | #define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0) |
811 | #define V4L2_CID_CONTRAST (V4L2_CID_BASE+1) | 780 | #define V4L2_CID_CONTRAST (V4L2_CID_BASE+1) |
812 | #define V4L2_CID_SATURATION (V4L2_CID_BASE+2) | 781 | #define V4L2_CID_SATURATION (V4L2_CID_BASE+2) |
@@ -833,6 +802,188 @@ struct v4l2_querymenu | |||
833 | #define V4L2_CID_VCENTER (V4L2_CID_BASE+23) | 802 | #define V4L2_CID_VCENTER (V4L2_CID_BASE+23) |
834 | #define V4L2_CID_LASTP1 (V4L2_CID_BASE+24) /* last CID + 1 */ | 803 | #define V4L2_CID_LASTP1 (V4L2_CID_BASE+24) /* last CID + 1 */ |
835 | 804 | ||
805 | /* MPEG-class control IDs defined by V4L2 */ | ||
806 | #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) | ||
807 | #define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1) | ||
808 | |||
809 | /* MPEG streams */ | ||
810 | #define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0) | ||
811 | enum v4l2_mpeg_stream_type { | ||
812 | V4L2_MPEG_STREAM_TYPE_MPEG2_PS = 0, /* MPEG-2 program stream */ | ||
813 | V4L2_MPEG_STREAM_TYPE_MPEG2_TS = 1, /* MPEG-2 transport stream */ | ||
814 | V4L2_MPEG_STREAM_TYPE_MPEG1_SS = 2, /* MPEG-1 system stream */ | ||
815 | V4L2_MPEG_STREAM_TYPE_MPEG2_DVD = 3, /* MPEG-2 DVD-compatible stream */ | ||
816 | V4L2_MPEG_STREAM_TYPE_MPEG1_VCD = 4, /* MPEG-1 VCD-compatible stream */ | ||
817 | V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD = 5, /* MPEG-2 SVCD-compatible stream */ | ||
818 | }; | ||
819 | #define V4L2_CID_MPEG_STREAM_PID_PMT (V4L2_CID_MPEG_BASE+1) | ||
820 | #define V4L2_CID_MPEG_STREAM_PID_AUDIO (V4L2_CID_MPEG_BASE+2) | ||
821 | #define V4L2_CID_MPEG_STREAM_PID_VIDEO (V4L2_CID_MPEG_BASE+3) | ||
822 | #define V4L2_CID_MPEG_STREAM_PID_PCR (V4L2_CID_MPEG_BASE+4) | ||
823 | #define V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (V4L2_CID_MPEG_BASE+5) | ||
824 | #define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (V4L2_CID_MPEG_BASE+6) | ||
825 | #define V4L2_CID_MPEG_STREAM_VBI_FMT (V4L2_CID_MPEG_BASE+7) | ||
826 | enum v4l2_mpeg_stream_vbi_fmt { | ||
827 | V4L2_MPEG_STREAM_VBI_FMT_NONE = 0, /* No VBI in the MPEG stream */ | ||
828 | V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1, /* VBI in private packets, IVTV format */ | ||
829 | }; | ||
830 | |||
831 | /* MPEG audio */ | ||
832 | #define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100) | ||
833 | enum v4l2_mpeg_audio_sampling_freq { | ||
834 | V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0, | ||
835 | V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000 = 1, | ||
836 | V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000 = 2, | ||
837 | }; | ||
838 | #define V4L2_CID_MPEG_AUDIO_ENCODING (V4L2_CID_MPEG_BASE+101) | ||
839 | enum v4l2_mpeg_audio_encoding { | ||
840 | V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0, | ||
841 | V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1, | ||
842 | V4L2_MPEG_AUDIO_ENCODING_LAYER_3 = 2, | ||
843 | }; | ||
844 | #define V4L2_CID_MPEG_AUDIO_L1_BITRATE (V4L2_CID_MPEG_BASE+102) | ||
845 | enum v4l2_mpeg_audio_l1_bitrate { | ||
846 | V4L2_MPEG_AUDIO_L1_BITRATE_32K = 0, | ||
847 | V4L2_MPEG_AUDIO_L1_BITRATE_64K = 1, | ||
848 | V4L2_MPEG_AUDIO_L1_BITRATE_96K = 2, | ||
849 | V4L2_MPEG_AUDIO_L1_BITRATE_128K = 3, | ||
850 | V4L2_MPEG_AUDIO_L1_BITRATE_160K = 4, | ||
851 | V4L2_MPEG_AUDIO_L1_BITRATE_192K = 5, | ||
852 | V4L2_MPEG_AUDIO_L1_BITRATE_224K = 6, | ||
853 | V4L2_MPEG_AUDIO_L1_BITRATE_256K = 7, | ||
854 | V4L2_MPEG_AUDIO_L1_BITRATE_288K = 8, | ||
855 | V4L2_MPEG_AUDIO_L1_BITRATE_320K = 9, | ||
856 | V4L2_MPEG_AUDIO_L1_BITRATE_352K = 10, | ||
857 | V4L2_MPEG_AUDIO_L1_BITRATE_384K = 11, | ||
858 | V4L2_MPEG_AUDIO_L1_BITRATE_416K = 12, | ||
859 | V4L2_MPEG_AUDIO_L1_BITRATE_448K = 13, | ||
860 | }; | ||
861 | #define V4L2_CID_MPEG_AUDIO_L2_BITRATE (V4L2_CID_MPEG_BASE+103) | ||
862 | enum v4l2_mpeg_audio_l2_bitrate { | ||
863 | V4L2_MPEG_AUDIO_L2_BITRATE_32K = 0, | ||
864 | V4L2_MPEG_AUDIO_L2_BITRATE_48K = 1, | ||
865 | V4L2_MPEG_AUDIO_L2_BITRATE_56K = 2, | ||
866 | V4L2_MPEG_AUDIO_L2_BITRATE_64K = 3, | ||
867 | V4L2_MPEG_AUDIO_L2_BITRATE_80K = 4, | ||
868 | V4L2_MPEG_AUDIO_L2_BITRATE_96K = 5, | ||
869 | V4L2_MPEG_AUDIO_L2_BITRATE_112K = 6, | ||
870 | V4L2_MPEG_AUDIO_L2_BITRATE_128K = 7, | ||
871 | V4L2_MPEG_AUDIO_L2_BITRATE_160K = 8, | ||
872 | V4L2_MPEG_AUDIO_L2_BITRATE_192K = 9, | ||
873 | V4L2_MPEG_AUDIO_L2_BITRATE_224K = 10, | ||
874 | V4L2_MPEG_AUDIO_L2_BITRATE_256K = 11, | ||
875 | V4L2_MPEG_AUDIO_L2_BITRATE_320K = 12, | ||
876 | V4L2_MPEG_AUDIO_L2_BITRATE_384K = 13, | ||
877 | }; | ||
878 | #define V4L2_CID_MPEG_AUDIO_L3_BITRATE (V4L2_CID_MPEG_BASE+104) | ||
879 | enum v4l2_mpeg_audio_l3_bitrate { | ||
880 | V4L2_MPEG_AUDIO_L3_BITRATE_32K = 0, | ||
881 | V4L2_MPEG_AUDIO_L3_BITRATE_40K = 1, | ||
882 | V4L2_MPEG_AUDIO_L3_BITRATE_48K = 2, | ||
883 | V4L2_MPEG_AUDIO_L3_BITRATE_56K = 3, | ||
884 | V4L2_MPEG_AUDIO_L3_BITRATE_64K = 4, | ||
885 | V4L2_MPEG_AUDIO_L3_BITRATE_80K = 5, | ||
886 | V4L2_MPEG_AUDIO_L3_BITRATE_96K = 6, | ||
887 | V4L2_MPEG_AUDIO_L3_BITRATE_112K = 7, | ||
888 | V4L2_MPEG_AUDIO_L3_BITRATE_128K = 8, | ||
889 | V4L2_MPEG_AUDIO_L3_BITRATE_160K = 9, | ||
890 | V4L2_MPEG_AUDIO_L3_BITRATE_192K = 10, | ||
891 | V4L2_MPEG_AUDIO_L3_BITRATE_224K = 11, | ||
892 | V4L2_MPEG_AUDIO_L3_BITRATE_256K = 12, | ||
893 | V4L2_MPEG_AUDIO_L3_BITRATE_320K = 13, | ||
894 | }; | ||
895 | #define V4L2_CID_MPEG_AUDIO_MODE (V4L2_CID_MPEG_BASE+105) | ||
896 | enum v4l2_mpeg_audio_mode { | ||
897 | V4L2_MPEG_AUDIO_MODE_STEREO = 0, | ||
898 | V4L2_MPEG_AUDIO_MODE_JOINT_STEREO = 1, | ||
899 | V4L2_MPEG_AUDIO_MODE_DUAL = 2, | ||
900 | V4L2_MPEG_AUDIO_MODE_MONO = 3, | ||
901 | }; | ||
902 | #define V4L2_CID_MPEG_AUDIO_MODE_EXTENSION (V4L2_CID_MPEG_BASE+106) | ||
903 | enum v4l2_mpeg_audio_mode_extension { | ||
904 | V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4 = 0, | ||
905 | V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8 = 1, | ||
906 | V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12 = 2, | ||
907 | V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16 = 3, | ||
908 | }; | ||
909 | #define V4L2_CID_MPEG_AUDIO_EMPHASIS (V4L2_CID_MPEG_BASE+107) | ||
910 | enum v4l2_mpeg_audio_emphasis { | ||
911 | V4L2_MPEG_AUDIO_EMPHASIS_NONE = 0, | ||
912 | V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS = 1, | ||
913 | V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17 = 2, | ||
914 | }; | ||
915 | #define V4L2_CID_MPEG_AUDIO_CRC (V4L2_CID_MPEG_BASE+108) | ||
916 | enum v4l2_mpeg_audio_crc { | ||
917 | V4L2_MPEG_AUDIO_CRC_NONE = 0, | ||
918 | V4L2_MPEG_AUDIO_CRC_CRC16 = 1, | ||
919 | }; | ||
920 | |||
921 | /* MPEG video */ | ||
922 | #define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200) | ||
923 | enum v4l2_mpeg_video_encoding { | ||
924 | V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0, | ||
925 | V4L2_MPEG_VIDEO_ENCODING_MPEG_2 = 1, | ||
926 | }; | ||
927 | #define V4L2_CID_MPEG_VIDEO_ASPECT (V4L2_CID_MPEG_BASE+201) | ||
928 | enum v4l2_mpeg_video_aspect { | ||
929 | V4L2_MPEG_VIDEO_ASPECT_1x1 = 0, | ||
930 | V4L2_MPEG_VIDEO_ASPECT_4x3 = 1, | ||
931 | V4L2_MPEG_VIDEO_ASPECT_16x9 = 2, | ||
932 | V4L2_MPEG_VIDEO_ASPECT_221x100 = 3, | ||
933 | }; | ||
934 | #define V4L2_CID_MPEG_VIDEO_B_FRAMES (V4L2_CID_MPEG_BASE+202) | ||
935 | #define V4L2_CID_MPEG_VIDEO_GOP_SIZE (V4L2_CID_MPEG_BASE+203) | ||
936 | #define V4L2_CID_MPEG_VIDEO_GOP_CLOSURE (V4L2_CID_MPEG_BASE+204) | ||
937 | #define V4L2_CID_MPEG_VIDEO_PULLDOWN (V4L2_CID_MPEG_BASE+205) | ||
938 | #define V4L2_CID_MPEG_VIDEO_BITRATE_MODE (V4L2_CID_MPEG_BASE+206) | ||
939 | enum v4l2_mpeg_video_bitrate_mode { | ||
940 | V4L2_MPEG_VIDEO_BITRATE_MODE_VBR = 0, | ||
941 | V4L2_MPEG_VIDEO_BITRATE_MODE_CBR = 1, | ||
942 | }; | ||
943 | #define V4L2_CID_MPEG_VIDEO_BITRATE (V4L2_CID_MPEG_BASE+207) | ||
944 | #define V4L2_CID_MPEG_VIDEO_BITRATE_PEAK (V4L2_CID_MPEG_BASE+208) | ||
945 | #define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209) | ||
946 | |||
947 | /* MPEG-class control IDs specific to the CX2584x driver as defined by V4L2 */ | ||
948 | #define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000) | ||
949 | #define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0) | ||
950 | enum v4l2_mpeg_cx2341x_video_spatial_filter_mode { | ||
951 | V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL = 0, | ||
952 | V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO = 1, | ||
953 | }; | ||
954 | #define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+1) | ||
955 | #define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+2) | ||
956 | enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type { | ||
957 | V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF = 0, | ||
958 | V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR = 1, | ||
959 | V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_VERT = 2, | ||
960 | V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE = 3, | ||
961 | V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE = 4, | ||
962 | }; | ||
963 | #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+3) | ||
964 | enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type { | ||
965 | V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF = 0, | ||
966 | V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR = 1, | ||
967 | }; | ||
968 | #define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+4) | ||
969 | enum v4l2_mpeg_cx2341x_video_temporal_filter_mode { | ||
970 | V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL = 0, | ||
971 | V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO = 1, | ||
972 | }; | ||
973 | #define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+5) | ||
974 | #define V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+6) | ||
975 | enum v4l2_mpeg_cx2341x_video_median_filter_type { | ||
976 | V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF = 0, | ||
977 | V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR = 1, | ||
978 | V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_VERT = 2, | ||
979 | V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT = 3, | ||
980 | V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG = 4, | ||
981 | }; | ||
982 | #define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+7) | ||
983 | #define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+8) | ||
984 | #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+9) | ||
985 | #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10) | ||
986 | |||
836 | /* | 987 | /* |
837 | * T U N I N G | 988 | * T U N I N G |
838 | */ | 989 | */ |
@@ -904,6 +1055,7 @@ struct v4l2_audio | |||
904 | __u32 mode; | 1055 | __u32 mode; |
905 | __u32 reserved[2]; | 1056 | __u32 reserved[2]; |
906 | }; | 1057 | }; |
1058 | |||
907 | /* Flags for the 'capability' field */ | 1059 | /* Flags for the 'capability' field */ |
908 | #define V4L2_AUDCAP_STEREO 0x00001 | 1060 | #define V4L2_AUDCAP_STEREO 0x00001 |
909 | #define V4L2_AUDCAP_AVL 0x00002 | 1061 | #define V4L2_AUDCAP_AVL 0x00002 |
@@ -927,7 +1079,6 @@ struct v4l2_audioout | |||
927 | */ | 1079 | */ |
928 | 1080 | ||
929 | /* Raw VBI */ | 1081 | /* Raw VBI */ |
930 | |||
931 | struct v4l2_vbi_format | 1082 | struct v4l2_vbi_format |
932 | { | 1083 | { |
933 | __u32 sampling_rate; /* in 1 Hz */ | 1084 | __u32 sampling_rate; /* in 1 Hz */ |
@@ -1034,8 +1185,6 @@ struct v4l2_streamparm | |||
1034 | } parm; | 1185 | } parm; |
1035 | }; | 1186 | }; |
1036 | 1187 | ||
1037 | |||
1038 | |||
1039 | /* | 1188 | /* |
1040 | * I O C T L C O D E S F O R V I D E O D E V I C E S | 1189 | * I O C T L C O D E S F O R V I D E O D E V I C E S |
1041 | * | 1190 | * |
@@ -1045,8 +1194,10 @@ struct v4l2_streamparm | |||
1045 | #define VIDIOC_ENUM_FMT _IOWR ('V', 2, struct v4l2_fmtdesc) | 1194 | #define VIDIOC_ENUM_FMT _IOWR ('V', 2, struct v4l2_fmtdesc) |
1046 | #define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format) | 1195 | #define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format) |
1047 | #define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format) | 1196 | #define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format) |
1197 | #ifdef __KERNEL__ | ||
1048 | #define VIDIOC_G_MPEGCOMP _IOR ('V', 6, struct v4l2_mpeg_compression) | 1198 | #define VIDIOC_G_MPEGCOMP _IOR ('V', 6, struct v4l2_mpeg_compression) |
1049 | #define VIDIOC_S_MPEGCOMP _IOW ('V', 7, struct v4l2_mpeg_compression) | 1199 | #define VIDIOC_S_MPEGCOMP _IOW ('V', 7, struct v4l2_mpeg_compression) |
1200 | #endif | ||
1050 | #define VIDIOC_REQBUFS _IOWR ('V', 8, struct v4l2_requestbuffers) | 1201 | #define VIDIOC_REQBUFS _IOWR ('V', 8, struct v4l2_requestbuffers) |
1051 | #define VIDIOC_QUERYBUF _IOWR ('V', 9, struct v4l2_buffer) | 1202 | #define VIDIOC_QUERYBUF _IOWR ('V', 9, struct v4l2_buffer) |
1052 | #define VIDIOC_G_FBUF _IOR ('V', 10, struct v4l2_framebuffer) | 1203 | #define VIDIOC_G_FBUF _IOR ('V', 10, struct v4l2_framebuffer) |
@@ -1096,7 +1247,11 @@ struct v4l2_streamparm | |||
1096 | #define VIDIOC_G_SLICED_VBI_CAP _IOR ('V', 69, struct v4l2_sliced_vbi_cap) | 1247 | #define VIDIOC_G_SLICED_VBI_CAP _IOR ('V', 69, struct v4l2_sliced_vbi_cap) |
1097 | #endif | 1248 | #endif |
1098 | #define VIDIOC_LOG_STATUS _IO ('V', 70) | 1249 | #define VIDIOC_LOG_STATUS _IO ('V', 70) |
1250 | #define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls) | ||
1251 | #define VIDIOC_S_EXT_CTRLS _IOWR ('V', 72, struct v4l2_ext_controls) | ||
1252 | #define VIDIOC_TRY_EXT_CTRLS _IOWR ('V', 73, struct v4l2_ext_controls) | ||
1099 | 1253 | ||
1254 | #ifdef __OLD_VIDIOC_ | ||
1100 | /* for compatibility, will go away some day */ | 1255 | /* for compatibility, will go away some day */ |
1101 | #define VIDIOC_OVERLAY_OLD _IOWR ('V', 14, int) | 1256 | #define VIDIOC_OVERLAY_OLD _IOWR ('V', 14, int) |
1102 | #define VIDIOC_S_PARM_OLD _IOW ('V', 22, struct v4l2_streamparm) | 1257 | #define VIDIOC_S_PARM_OLD _IOW ('V', 22, struct v4l2_streamparm) |
@@ -1104,57 +1259,10 @@ struct v4l2_streamparm | |||
1104 | #define VIDIOC_G_AUDIO_OLD _IOWR ('V', 33, struct v4l2_audio) | 1259 | #define VIDIOC_G_AUDIO_OLD _IOWR ('V', 33, struct v4l2_audio) |
1105 | #define VIDIOC_G_AUDOUT_OLD _IOWR ('V', 49, struct v4l2_audioout) | 1260 | #define VIDIOC_G_AUDOUT_OLD _IOWR ('V', 49, struct v4l2_audioout) |
1106 | #define VIDIOC_CROPCAP_OLD _IOR ('V', 58, struct v4l2_cropcap) | 1261 | #define VIDIOC_CROPCAP_OLD _IOR ('V', 58, struct v4l2_cropcap) |
1107 | |||
1108 | #define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */ | ||
1109 | |||
1110 | |||
1111 | #ifdef __KERNEL__ | ||
1112 | /* | ||
1113 | * | ||
1114 | * V 4 L 2 D R I V E R H E L P E R A P I | ||
1115 | * | ||
1116 | * Some commonly needed functions for drivers (v4l2-common.o module) | ||
1117 | */ | ||
1118 | #include <linux/fs.h> | ||
1119 | |||
1120 | /* Video standard functions */ | ||
1121 | extern unsigned int v4l2_video_std_fps(struct v4l2_standard *vs); | ||
1122 | extern int v4l2_video_std_construct(struct v4l2_standard *vs, | ||
1123 | int id, char *name); | ||
1124 | |||
1125 | /* prority handling */ | ||
1126 | struct v4l2_prio_state { | ||
1127 | atomic_t prios[4]; | ||
1128 | }; | ||
1129 | int v4l2_prio_init(struct v4l2_prio_state *global); | ||
1130 | int v4l2_prio_change(struct v4l2_prio_state *global, enum v4l2_priority *local, | ||
1131 | enum v4l2_priority new); | ||
1132 | int v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local); | ||
1133 | int v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority *local); | ||
1134 | enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global); | ||
1135 | int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority *local); | ||
1136 | |||
1137 | /* names for fancy debug output */ | ||
1138 | extern char *v4l2_field_names[]; | ||
1139 | extern char *v4l2_type_names[]; | ||
1140 | |||
1141 | /* Compatibility layer interface -- v4l1-compat module */ | ||
1142 | typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file, | ||
1143 | unsigned int cmd, void *arg); | ||
1144 | |||
1145 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
1146 | int v4l_compat_translate_ioctl(struct inode *inode, struct file *file, | ||
1147 | int cmd, void *arg, v4l2_kioctl driver_ioctl); | ||
1148 | #else | ||
1149 | #define v4l_compat_translate_ioctl(inode,file,cmd,arg,ioctl) -EINVAL | ||
1150 | #endif | 1262 | #endif |
1151 | 1263 | ||
1152 | /* 32 Bits compatibility layer for 64 bits processors */ | 1264 | #define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */ |
1153 | extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd, | ||
1154 | unsigned long arg); | ||
1155 | |||
1156 | 1265 | ||
1157 | #endif /* __KERNEL__ */ | ||
1158 | #endif /* __LINUX_VIDEODEV2_H */ | 1266 | #endif /* __LINUX_VIDEODEV2_H */ |
1159 | 1267 | ||
1160 | /* | 1268 | /* |
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 1d5577b2b752..f6024ab4eff0 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
@@ -4,10 +4,13 @@ | |||
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; | ||
8 | |||
7 | /* bits in vm_struct->flags */ | 9 | /* bits in vm_struct->flags */ |
8 | #define VM_IOREMAP 0x00000001 /* ioremap() and friends */ | 10 | #define VM_IOREMAP 0x00000001 /* ioremap() and friends */ |
9 | #define VM_ALLOC 0x00000002 /* vmalloc() */ | 11 | #define VM_ALLOC 0x00000002 /* vmalloc() */ |
10 | #define VM_MAP 0x00000004 /* vmap()ed pages */ | 12 | #define VM_MAP 0x00000004 /* vmap()ed pages */ |
13 | #define VM_USERMAP 0x00000008 /* suitable for remap_vmalloc_range */ | ||
11 | /* bits [20..32] reserved for arch specific ioremap internals */ | 14 | /* bits [20..32] reserved for arch specific ioremap internals */ |
12 | 15 | ||
13 | /* | 16 | /* |
@@ -32,9 +35,11 @@ struct vm_struct { | |||
32 | * Highlevel APIs for driver use | 35 | * Highlevel APIs for driver use |
33 | */ | 36 | */ |
34 | extern void *vmalloc(unsigned long size); | 37 | extern void *vmalloc(unsigned long size); |
38 | extern void *vmalloc_user(unsigned long size); | ||
35 | extern void *vmalloc_node(unsigned long size, int node); | 39 | extern void *vmalloc_node(unsigned long size, int node); |
36 | extern void *vmalloc_exec(unsigned long size); | 40 | extern void *vmalloc_exec(unsigned long size); |
37 | extern void *vmalloc_32(unsigned long size); | 41 | extern void *vmalloc_32(unsigned long size); |
42 | extern void *vmalloc_32_user(unsigned long size); | ||
38 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); | 43 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); |
39 | extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask, | 44 | extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask, |
40 | pgprot_t prot); | 45 | pgprot_t prot); |
@@ -45,6 +50,9 @@ extern void vfree(void *addr); | |||
45 | extern void *vmap(struct page **pages, unsigned int count, | 50 | extern void *vmap(struct page **pages, unsigned int count, |
46 | unsigned long flags, pgprot_t prot); | 51 | unsigned long flags, pgprot_t prot); |
47 | extern void vunmap(void *addr); | 52 | extern void vunmap(void *addr); |
53 | |||
54 | extern int remap_vmalloc_range(struct vm_area_struct *vma, void *addr, | ||
55 | unsigned long pgoff); | ||
48 | 56 | ||
49 | /* | 57 | /* |
50 | * Lowlevel-APIs (not for driver use!) | 58 | * Lowlevel-APIs (not for driver use!) |
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h new file mode 100644 index 000000000000..3e0daf54133e --- /dev/null +++ b/include/linux/vmstat.h | |||
@@ -0,0 +1,215 @@ | |||
1 | #ifndef _LINUX_VMSTAT_H | ||
2 | #define _LINUX_VMSTAT_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <linux/percpu.h> | ||
6 | #include <linux/config.h> | ||
7 | #include <linux/mmzone.h> | ||
8 | #include <asm/atomic.h> | ||
9 | |||
10 | #ifdef CONFIG_VM_EVENT_COUNTERS | ||
11 | /* | ||
12 | * Light weight per cpu counter implementation. | ||
13 | * | ||
14 | * Counters should only be incremented and no critical kernel component | ||
15 | * should rely on the counter values. | ||
16 | * | ||
17 | * Counters are handled completely inline. On many platforms the code | ||
18 | * generated will simply be the increment of a global address. | ||
19 | */ | ||
20 | |||
21 | #define FOR_ALL_ZONES(x) x##_DMA, x##_DMA32, x##_NORMAL, x##_HIGH | ||
22 | |||
23 | enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, | ||
24 | FOR_ALL_ZONES(PGALLOC), | ||
25 | PGFREE, PGACTIVATE, PGDEACTIVATE, | ||
26 | PGFAULT, PGMAJFAULT, | ||
27 | FOR_ALL_ZONES(PGREFILL), | ||
28 | FOR_ALL_ZONES(PGSTEAL), | ||
29 | FOR_ALL_ZONES(PGSCAN_KSWAPD), | ||
30 | FOR_ALL_ZONES(PGSCAN_DIRECT), | ||
31 | PGINODESTEAL, SLABS_SCANNED, KSWAPD_STEAL, KSWAPD_INODESTEAL, | ||
32 | PAGEOUTRUN, ALLOCSTALL, PGROTATED, | ||
33 | NR_VM_EVENT_ITEMS | ||
34 | }; | ||
35 | |||
36 | struct vm_event_state { | ||
37 | unsigned long event[NR_VM_EVENT_ITEMS]; | ||
38 | }; | ||
39 | |||
40 | DECLARE_PER_CPU(struct vm_event_state, vm_event_states); | ||
41 | |||
42 | static inline void __count_vm_event(enum vm_event_item item) | ||
43 | { | ||
44 | __get_cpu_var(vm_event_states.event[item])++; | ||
45 | } | ||
46 | |||
47 | static inline void count_vm_event(enum vm_event_item item) | ||
48 | { | ||
49 | get_cpu_var(vm_event_states.event[item])++; | ||
50 | put_cpu(); | ||
51 | } | ||
52 | |||
53 | static inline void __count_vm_events(enum vm_event_item item, long delta) | ||
54 | { | ||
55 | __get_cpu_var(vm_event_states.event[item]) += delta; | ||
56 | } | ||
57 | |||
58 | static inline void count_vm_events(enum vm_event_item item, long delta) | ||
59 | { | ||
60 | get_cpu_var(vm_event_states.event[item])++; | ||
61 | put_cpu(); | ||
62 | } | ||
63 | |||
64 | extern void all_vm_events(unsigned long *); | ||
65 | extern void vm_events_fold_cpu(int cpu); | ||
66 | |||
67 | #else | ||
68 | |||
69 | /* Disable counters */ | ||
70 | #define get_cpu_vm_events(e) 0L | ||
71 | #define count_vm_event(e) do { } while (0) | ||
72 | #define count_vm_events(e,d) do { } while (0) | ||
73 | #define __count_vm_event(e) do { } while (0) | ||
74 | #define __count_vm_events(e,d) do { } while (0) | ||
75 | #define vm_events_fold_cpu(x) do { } while (0) | ||
76 | |||
77 | #endif /* CONFIG_VM_EVENT_COUNTERS */ | ||
78 | |||
79 | #define __count_zone_vm_events(item, zone, delta) \ | ||
80 | __count_vm_events(item##_DMA + zone_idx(zone), delta) | ||
81 | |||
82 | /* | ||
83 | * Zone based page accounting with per cpu differentials. | ||
84 | */ | ||
85 | extern atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS]; | ||
86 | |||
87 | static inline void zone_page_state_add(long x, struct zone *zone, | ||
88 | enum zone_stat_item item) | ||
89 | { | ||
90 | atomic_long_add(x, &zone->vm_stat[item]); | ||
91 | atomic_long_add(x, &vm_stat[item]); | ||
92 | } | ||
93 | |||
94 | static inline unsigned long global_page_state(enum zone_stat_item item) | ||
95 | { | ||
96 | long x = atomic_long_read(&vm_stat[item]); | ||
97 | #ifdef CONFIG_SMP | ||
98 | if (x < 0) | ||
99 | x = 0; | ||
100 | #endif | ||
101 | return x; | ||
102 | } | ||
103 | |||
104 | static inline unsigned long zone_page_state(struct zone *zone, | ||
105 | enum zone_stat_item item) | ||
106 | { | ||
107 | long x = atomic_long_read(&zone->vm_stat[item]); | ||
108 | #ifdef CONFIG_SMP | ||
109 | if (x < 0) | ||
110 | x = 0; | ||
111 | #endif | ||
112 | return x; | ||
113 | } | ||
114 | |||
115 | #ifdef CONFIG_NUMA | ||
116 | /* | ||
117 | * Determine the per node value of a stat item. This function | ||
118 | * is called frequently in a NUMA machine, so try to be as | ||
119 | * frugal as possible. | ||
120 | */ | ||
121 | static inline unsigned long node_page_state(int node, | ||
122 | enum zone_stat_item item) | ||
123 | { | ||
124 | struct zone *zones = NODE_DATA(node)->node_zones; | ||
125 | |||
126 | return | ||
127 | #ifndef CONFIG_DMA_IS_NORMAL | ||
128 | #if !defined(CONFIG_DMA_IS_DMA32) && BITS_PER_LONG >= 64 | ||
129 | zone_page_state(&zones[ZONE_DMA32], item) + | ||
130 | #endif | ||
131 | zone_page_state(&zones[ZONE_NORMAL], item) + | ||
132 | #endif | ||
133 | #ifdef CONFIG_HIGHMEM | ||
134 | zone_page_state(&zones[ZONE_HIGHMEM], item) + | ||
135 | #endif | ||
136 | zone_page_state(&zones[ZONE_DMA], item); | ||
137 | } | ||
138 | |||
139 | extern void zone_statistics(struct zonelist *, struct zone *); | ||
140 | |||
141 | #else | ||
142 | |||
143 | #define node_page_state(node, item) global_page_state(item) | ||
144 | #define zone_statistics(_zl,_z) do { } while (0) | ||
145 | |||
146 | #endif /* CONFIG_NUMA */ | ||
147 | |||
148 | #define __add_zone_page_state(__z, __i, __d) \ | ||
149 | __mod_zone_page_state(__z, __i, __d) | ||
150 | #define __sub_zone_page_state(__z, __i, __d) \ | ||
151 | __mod_zone_page_state(__z, __i,-(__d)) | ||
152 | |||
153 | #define add_zone_page_state(__z, __i, __d) mod_zone_page_state(__z, __i, __d) | ||
154 | #define sub_zone_page_state(__z, __i, __d) mod_zone_page_state(__z, __i, -(__d)) | ||
155 | |||
156 | static inline void zap_zone_vm_stats(struct zone *zone) | ||
157 | { | ||
158 | memset(zone->vm_stat, 0, sizeof(zone->vm_stat)); | ||
159 | } | ||
160 | |||
161 | extern void inc_zone_state(struct zone *, enum zone_stat_item); | ||
162 | |||
163 | #ifdef CONFIG_SMP | ||
164 | void __mod_zone_page_state(struct zone *, enum zone_stat_item item, int); | ||
165 | void __inc_zone_page_state(struct page *, enum zone_stat_item); | ||
166 | void __dec_zone_page_state(struct page *, enum zone_stat_item); | ||
167 | |||
168 | void mod_zone_page_state(struct zone *, enum zone_stat_item, int); | ||
169 | void inc_zone_page_state(struct page *, enum zone_stat_item); | ||
170 | void dec_zone_page_state(struct page *, enum zone_stat_item); | ||
171 | |||
172 | extern void inc_zone_state(struct zone *, enum zone_stat_item); | ||
173 | |||
174 | void refresh_cpu_vm_stats(int); | ||
175 | void refresh_vm_stats(void); | ||
176 | |||
177 | #else /* CONFIG_SMP */ | ||
178 | |||
179 | /* | ||
180 | * We do not maintain differentials in a single processor configuration. | ||
181 | * The functions directly modify the zone and global counters. | ||
182 | */ | ||
183 | static inline void __mod_zone_page_state(struct zone *zone, | ||
184 | enum zone_stat_item item, int delta) | ||
185 | { | ||
186 | zone_page_state_add(delta, zone, item); | ||
187 | } | ||
188 | |||
189 | static inline void __inc_zone_page_state(struct page *page, | ||
190 | enum zone_stat_item item) | ||
191 | { | ||
192 | atomic_long_inc(&page_zone(page)->vm_stat[item]); | ||
193 | atomic_long_inc(&vm_stat[item]); | ||
194 | } | ||
195 | |||
196 | static inline void __dec_zone_page_state(struct page *page, | ||
197 | enum zone_stat_item item) | ||
198 | { | ||
199 | atomic_long_dec(&page_zone(page)->vm_stat[item]); | ||
200 | atomic_long_dec(&vm_stat[item]); | ||
201 | } | ||
202 | |||
203 | /* | ||
204 | * We only use atomic operations to update counters. So there is no need to | ||
205 | * disable interrupts. | ||
206 | */ | ||
207 | #define inc_zone_page_state __inc_zone_page_state | ||
208 | #define dec_zone_page_state __dec_zone_page_state | ||
209 | #define mod_zone_page_state __mod_zone_page_state | ||
210 | |||
211 | static inline void refresh_cpu_vm_stats(int cpu) { } | ||
212 | static inline void refresh_vm_stats(void) { } | ||
213 | #endif | ||
214 | |||
215 | #endif /* _LINUX_VMSTAT_H */ | ||
diff --git a/include/linux/vt_buffer.h b/include/linux/vt_buffer.h index 1f7ba3629053..057db7d2f448 100644 --- a/include/linux/vt_buffer.h +++ b/include/linux/vt_buffer.h | |||
@@ -13,7 +13,6 @@ | |||
13 | #ifndef _LINUX_VT_BUFFER_H_ | 13 | #ifndef _LINUX_VT_BUFFER_H_ |
14 | #define _LINUX_VT_BUFFER_H_ | 14 | #define _LINUX_VT_BUFFER_H_ |
15 | 15 | ||
16 | #include <linux/config.h> | ||
17 | 16 | ||
18 | #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_MDA_CONSOLE) | 17 | #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_MDA_CONSOLE) |
19 | #include <asm/vga.h> | 18 | #include <asm/vga.h> |
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index fab5aed8ca31..940d0261a545 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h | |||
@@ -6,7 +6,6 @@ | |||
6 | * with information needed by the vt package | 6 | * with information needed by the vt package |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <linux/config.h> | ||
10 | #include <linux/vt.h> | 9 | #include <linux/vt.h> |
11 | #include <linux/kd.h> | 10 | #include <linux/kd.h> |
12 | #include <linux/tty.h> | 11 | #include <linux/tty.h> |
diff --git a/include/linux/wait.h b/include/linux/wait.h index d28518236b62..544e855c7c02 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
@@ -19,7 +19,6 @@ | |||
19 | 19 | ||
20 | #ifdef __KERNEL__ | 20 | #ifdef __KERNEL__ |
21 | 21 | ||
22 | #include <linux/config.h> | ||
23 | #include <linux/list.h> | 22 | #include <linux/list.h> |
24 | #include <linux/stddef.h> | 23 | #include <linux/stddef.h> |
25 | #include <linux/spinlock.h> | 24 | #include <linux/spinlock.h> |
diff --git a/include/linux/wanrouter.h b/include/linux/wanrouter.h index 1b6b76a4eb54..2cd05013edfc 100644 --- a/include/linux/wanrouter.h +++ b/include/linux/wanrouter.h | |||
@@ -44,8 +44,6 @@ | |||
44 | * Jan 02, 1997 Gene Kozin Initial version (based on wanpipe.h). | 44 | * Jan 02, 1997 Gene Kozin Initial version (based on wanpipe.h). |
45 | *****************************************************************************/ | 45 | *****************************************************************************/ |
46 | 46 | ||
47 | #include <linux/spinlock.h> /* Support for SMP Locking */ | ||
48 | |||
49 | #ifndef _ROUTER_H | 47 | #ifndef _ROUTER_H |
50 | #define _ROUTER_H | 48 | #define _ROUTER_H |
51 | 49 | ||
@@ -457,6 +455,8 @@ typedef struct wanif_conf | |||
457 | #include <linux/fs.h> /* support for device drivers */ | 455 | #include <linux/fs.h> /* support for device drivers */ |
458 | #include <linux/proc_fs.h> /* proc filesystem pragmatics */ | 456 | #include <linux/proc_fs.h> /* proc filesystem pragmatics */ |
459 | #include <linux/netdevice.h> /* support for network drivers */ | 457 | #include <linux/netdevice.h> /* support for network drivers */ |
458 | #include <linux/spinlock.h> /* Support for SMP Locking */ | ||
459 | |||
460 | /*---------------------------------------------------------------------------- | 460 | /*---------------------------------------------------------------------------- |
461 | * WAN device data space. | 461 | * WAN device data space. |
462 | */ | 462 | */ |
diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h index 1192ed8f4fe8..011bcfeb9f09 100644 --- a/include/linux/watchdog.h +++ b/include/linux/watchdog.h | |||
@@ -28,6 +28,9 @@ struct watchdog_info { | |||
28 | #define WDIOC_KEEPALIVE _IOR(WATCHDOG_IOCTL_BASE, 5, int) | 28 | #define WDIOC_KEEPALIVE _IOR(WATCHDOG_IOCTL_BASE, 5, int) |
29 | #define WDIOC_SETTIMEOUT _IOWR(WATCHDOG_IOCTL_BASE, 6, int) | 29 | #define WDIOC_SETTIMEOUT _IOWR(WATCHDOG_IOCTL_BASE, 6, int) |
30 | #define WDIOC_GETTIMEOUT _IOR(WATCHDOG_IOCTL_BASE, 7, int) | 30 | #define WDIOC_GETTIMEOUT _IOR(WATCHDOG_IOCTL_BASE, 7, int) |
31 | #define WDIOC_SETPRETIMEOUT _IOWR(WATCHDOG_IOCTL_BASE, 8, int) | ||
32 | #define WDIOC_GETPRETIMEOUT _IOR(WATCHDOG_IOCTL_BASE, 9, int) | ||
33 | #define WDIOC_GETTIMELEFT _IOR(WATCHDOG_IOCTL_BASE, 10, int) | ||
31 | 34 | ||
32 | #define WDIOF_UNKNOWN -1 /* Unknown flag error */ | 35 | #define WDIOF_UNKNOWN -1 /* Unknown flag error */ |
33 | #define WDIOS_UNKNOWN -1 /* Unknown status error */ | 36 | #define WDIOS_UNKNOWN -1 /* Unknown status error */ |
@@ -38,9 +41,10 @@ struct watchdog_info { | |||
38 | #define WDIOF_EXTERN2 0x0008 /* External relay 2 */ | 41 | #define WDIOF_EXTERN2 0x0008 /* External relay 2 */ |
39 | #define WDIOF_POWERUNDER 0x0010 /* Power bad/power fault */ | 42 | #define WDIOF_POWERUNDER 0x0010 /* Power bad/power fault */ |
40 | #define WDIOF_CARDRESET 0x0020 /* Card previously reset the CPU */ | 43 | #define WDIOF_CARDRESET 0x0020 /* Card previously reset the CPU */ |
41 | #define WDIOF_POWEROVER 0x0040 /* Power over voltage */ | 44 | #define WDIOF_POWEROVER 0x0040 /* Power over voltage */ |
42 | #define WDIOF_SETTIMEOUT 0x0080 /* Set timeout (in seconds) */ | 45 | #define WDIOF_SETTIMEOUT 0x0080 /* Set timeout (in seconds) */ |
43 | #define WDIOF_MAGICCLOSE 0x0100 /* Supports magic close char */ | 46 | #define WDIOF_MAGICCLOSE 0x0100 /* Supports magic close char */ |
47 | #define WDIOF_PRETIMEOUT 0x0200 /* Pretimeout (in seconds), get/set */ | ||
44 | #define WDIOF_KEEPALIVEPING 0x8000 /* Keep alive ping reply */ | 48 | #define WDIOF_KEEPALIVEPING 0x8000 /* Keep alive ping reply */ |
45 | 49 | ||
46 | #define WDIOS_DISABLECARD 0x0001 /* Turn off the watchdog timer */ | 50 | #define WDIOS_DISABLECARD 0x0001 /* Turn off the watchdog timer */ |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 56f92fcbe94a..9e38b566d0e7 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -50,14 +50,15 @@ struct writeback_control { | |||
50 | * a hint that the filesystem need only write out the pages inside that | 50 | * a hint that the filesystem need only write out the pages inside that |
51 | * byterange. The byte at `end' is included in the writeout request. | 51 | * byterange. The byte at `end' is included in the writeout request. |
52 | */ | 52 | */ |
53 | loff_t start; | 53 | loff_t range_start; |
54 | loff_t end; | 54 | loff_t range_end; |
55 | 55 | ||
56 | unsigned nonblocking:1; /* Don't get stuck on request queues */ | 56 | unsigned nonblocking:1; /* Don't get stuck on request queues */ |
57 | unsigned encountered_congestion:1; /* An output: a queue is full */ | 57 | unsigned encountered_congestion:1; /* An output: a queue is full */ |
58 | unsigned for_kupdate:1; /* A kupdate writeback */ | 58 | unsigned for_kupdate:1; /* A kupdate writeback */ |
59 | unsigned for_reclaim:1; /* Invoked from the page allocator */ | 59 | unsigned for_reclaim:1; /* Invoked from the page allocator */ |
60 | unsigned for_writepages:1; /* This is a writepages() call */ | 60 | unsigned for_writepages:1; /* This is a writepages() call */ |
61 | unsigned range_cyclic:1; /* range_start is cyclic */ | ||
61 | }; | 62 | }; |
62 | 63 | ||
63 | /* | 64 | /* |
diff --git a/include/linux/zconf.h b/include/linux/zconf.h index f1cfd66b9554..0beb75e38caa 100644 --- a/include/linux/zconf.h +++ b/include/linux/zconf.h | |||
@@ -35,6 +35,18 @@ | |||
35 | # define MAX_WBITS 15 /* 32K LZ77 window */ | 35 | # define MAX_WBITS 15 /* 32K LZ77 window */ |
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | /* default windowBits for decompression. MAX_WBITS is for compression only */ | ||
39 | #ifndef DEF_WBITS | ||
40 | # define DEF_WBITS MAX_WBITS | ||
41 | #endif | ||
42 | |||
43 | /* default memLevel */ | ||
44 | #if MAX_MEM_LEVEL >= 8 | ||
45 | # define DEF_MEM_LEVEL 8 | ||
46 | #else | ||
47 | # define DEF_MEM_LEVEL MAX_MEM_LEVEL | ||
48 | #endif | ||
49 | |||
38 | /* Type declarations */ | 50 | /* Type declarations */ |
39 | 51 | ||
40 | typedef unsigned char Byte; /* 8 bits */ | 52 | typedef unsigned char Byte; /* 8 bits */ |
diff --git a/include/linux/zlib.h b/include/linux/zlib.h index 4fa32f0d4df8..9e3192a7dc6f 100644 --- a/include/linux/zlib.h +++ b/include/linux/zlib.h | |||
@@ -1,7 +1,6 @@ | |||
1 | /* zlib.h -- interface of the 'zlib' general purpose compression library | 1 | /* zlib.h -- interface of the 'zlib' general purpose compression library |
2 | version 1.1.3, July 9th, 1998 | ||
3 | 2 | ||
4 | Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler | 3 | Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler |
5 | 4 | ||
6 | This software is provided 'as-is', without any express or implied | 5 | This software is provided 'as-is', without any express or implied |
7 | warranty. In no event will the authors be held liable for any damages | 6 | warranty. In no event will the authors be held liable for any damages |
@@ -24,7 +23,7 @@ | |||
24 | 23 | ||
25 | 24 | ||
26 | The data format used by the zlib library is described by RFCs (Request for | 25 | The data format used by the zlib library is described by RFCs (Request for |
27 | Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt | 26 | Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt |
28 | (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). | 27 | (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). |
29 | */ | 28 | */ |
30 | 29 | ||
@@ -33,7 +32,22 @@ | |||
33 | 32 | ||
34 | #include <linux/zconf.h> | 33 | #include <linux/zconf.h> |
35 | 34 | ||
36 | #define ZLIB_VERSION "1.1.3" | 35 | /* zlib deflate based on ZLIB_VERSION "1.1.3" */ |
36 | /* zlib inflate based on ZLIB_VERSION "1.2.3" */ | ||
37 | |||
38 | /* | ||
39 | This is a modified version of zlib for use inside the Linux kernel. | ||
40 | The main changes are to perform all memory allocation in advance. | ||
41 | |||
42 | Inflation Changes: | ||
43 | * Z_PACKET_FLUSH is added and used by ppp_deflate. Before returning | ||
44 | this checks there is no more input data available and the next data | ||
45 | is a STORED block. It also resets the mode to be read for the next | ||
46 | data, all as per PPP requirements. | ||
47 | * Addition of zlib_inflateIncomp which copies incompressible data into | ||
48 | the history window and adjusts the accoutning without calling | ||
49 | zlib_inflate itself to inflate the data. | ||
50 | */ | ||
37 | 51 | ||
38 | /* | 52 | /* |
39 | The 'zlib' compression library provides in-memory compression and | 53 | The 'zlib' compression library provides in-memory compression and |
@@ -48,9 +62,18 @@ | |||
48 | application must provide more input and/or consume the output | 62 | application must provide more input and/or consume the output |
49 | (providing more output space) before each call. | 63 | (providing more output space) before each call. |
50 | 64 | ||
65 | The compressed data format used by default by the in-memory functions is | ||
66 | the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped | ||
67 | around a deflate stream, which is itself documented in RFC 1951. | ||
68 | |||
51 | The library also supports reading and writing files in gzip (.gz) format | 69 | The library also supports reading and writing files in gzip (.gz) format |
52 | with an interface similar to that of stdio. | 70 | with an interface similar to that of stdio. |
53 | 71 | ||
72 | The zlib format was designed to be compact and fast for use in memory | ||
73 | and on communications channels. The gzip format was designed for single- | ||
74 | file compression on file systems, has a larger header than zlib to maintain | ||
75 | directory information, and uses a different, slower check method than zlib. | ||
76 | |||
54 | The library does not install any signal handler. The decoder checks | 77 | The library does not install any signal handler. The decoder checks |
55 | the consistency of the compressed data, so the library should never | 78 | the consistency of the compressed data, so the library should never |
56 | crash even in case of corrupted input. | 79 | crash even in case of corrupted input. |
@@ -119,7 +142,8 @@ typedef z_stream *z_streamp; | |||
119 | #define Z_SYNC_FLUSH 3 | 142 | #define Z_SYNC_FLUSH 3 |
120 | #define Z_FULL_FLUSH 4 | 143 | #define Z_FULL_FLUSH 4 |
121 | #define Z_FINISH 5 | 144 | #define Z_FINISH 5 |
122 | /* Allowed flush values; see deflate() below for details */ | 145 | #define Z_BLOCK 6 /* Only for inflate at present */ |
146 | /* Allowed flush values; see deflate() and inflate() below for details */ | ||
123 | 147 | ||
124 | #define Z_OK 0 | 148 | #define Z_OK 0 |
125 | #define Z_STREAM_END 1 | 149 | #define Z_STREAM_END 1 |
@@ -155,13 +179,6 @@ typedef z_stream *z_streamp; | |||
155 | 179 | ||
156 | /* basic functions */ | 180 | /* basic functions */ |
157 | 181 | ||
158 | extern const char * zlib_zlibVersion (void); | ||
159 | /* The application can compare zlibVersion and ZLIB_VERSION for consistency. | ||
160 | If the first character differs, the library code actually used is | ||
161 | not compatible with the zlib.h header file used by the application. | ||
162 | This check is automatically made by deflateInit and inflateInit. | ||
163 | */ | ||
164 | |||
165 | extern int zlib_deflate_workspacesize (void); | 182 | extern int zlib_deflate_workspacesize (void); |
166 | /* | 183 | /* |
167 | Returns the number of bytes that needs to be allocated for a per- | 184 | Returns the number of bytes that needs to be allocated for a per- |
@@ -315,9 +332,9 @@ extern int zlib_inflateInit (z_streamp strm); | |||
315 | extern int zlib_inflate (z_streamp strm, int flush); | 332 | extern int zlib_inflate (z_streamp strm, int flush); |
316 | /* | 333 | /* |
317 | inflate decompresses as much data as possible, and stops when the input | 334 | inflate decompresses as much data as possible, and stops when the input |
318 | buffer becomes empty or the output buffer becomes full. It may some | 335 | buffer becomes empty or the output buffer becomes full. It may introduce |
319 | introduce some output latency (reading input without producing any output) | 336 | some output latency (reading input without producing any output) except when |
320 | except when forced to flush. | 337 | forced to flush. |
321 | 338 | ||
322 | The detailed semantics are as follows. inflate performs one or both of the | 339 | The detailed semantics are as follows. inflate performs one or both of the |
323 | following actions: | 340 | following actions: |
@@ -341,11 +358,26 @@ extern int zlib_inflate (z_streamp strm, int flush); | |||
341 | must be called again after making room in the output buffer because there | 358 | must be called again after making room in the output buffer because there |
342 | might be more output pending. | 359 | might be more output pending. |
343 | 360 | ||
344 | If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much | 361 | The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, |
345 | output as possible to the output buffer. The flushing behavior of inflate is | 362 | Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much |
346 | not specified for values of the flush parameter other than Z_SYNC_FLUSH | 363 | output as possible to the output buffer. Z_BLOCK requests that inflate() stop |
347 | and Z_FINISH, but the current implementation actually flushes as much output | 364 | if and when it gets to the next deflate block boundary. When decoding the |
348 | as possible anyway. | 365 | zlib or gzip format, this will cause inflate() to return immediately after |
366 | the header and before the first block. When doing a raw inflate, inflate() | ||
367 | will go ahead and process the first block, and will return when it gets to | ||
368 | the end of that block, or when it runs out of data. | ||
369 | |||
370 | The Z_BLOCK option assists in appending to or combining deflate streams. | ||
371 | Also to assist in this, on return inflate() will set strm->data_type to the | ||
372 | number of unused bits in the last byte taken from strm->next_in, plus 64 | ||
373 | if inflate() is currently decoding the last block in the deflate stream, | ||
374 | plus 128 if inflate() returned immediately after decoding an end-of-block | ||
375 | code or decoding the complete header up to just before the first byte of the | ||
376 | deflate stream. The end-of-block will not be indicated until all of the | ||
377 | uncompressed data from that block has been written to strm->next_out. The | ||
378 | number of unused bits may in general be greater than seven, except when | ||
379 | bit 7 of data_type is set, in which case the number of unused bits will be | ||
380 | less than eight. | ||
349 | 381 | ||
350 | inflate() should normally be called until it returns Z_STREAM_END or an | 382 | inflate() should normally be called until it returns Z_STREAM_END or an |
351 | error. However if all decompression is to be performed in a single step | 383 | error. However if all decompression is to be performed in a single step |
@@ -355,29 +387,44 @@ extern int zlib_inflate (z_streamp strm, int flush); | |||
355 | uncompressed data. (The size of the uncompressed data may have been saved | 387 | uncompressed data. (The size of the uncompressed data may have been saved |
356 | by the compressor for this purpose.) The next operation on this stream must | 388 | by the compressor for this purpose.) The next operation on this stream must |
357 | be inflateEnd to deallocate the decompression state. The use of Z_FINISH | 389 | be inflateEnd to deallocate the decompression state. The use of Z_FINISH |
358 | is never required, but can be used to inform inflate that a faster routine | 390 | is never required, but can be used to inform inflate that a faster approach |
359 | may be used for the single inflate() call. | 391 | may be used for the single inflate() call. |
360 | 392 | ||
361 | If a preset dictionary is needed at this point (see inflateSetDictionary | 393 | In this implementation, inflate() always flushes as much output as |
362 | below), inflate sets strm-adler to the adler32 checksum of the | 394 | possible to the output buffer, and always uses the faster approach on the |
363 | dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise | 395 | first call. So the only effect of the flush parameter in this implementation |
364 | it sets strm->adler to the adler32 checksum of all output produced | 396 | is on the return value of inflate(), as noted below, or when it returns early |
365 | so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or | 397 | because Z_BLOCK is used. |
366 | an error code as described below. At the end of the stream, inflate() | 398 | |
367 | checks that its computed adler32 checksum is equal to that saved by the | 399 | If a preset dictionary is needed after this call (see inflateSetDictionary |
368 | compressor and returns Z_STREAM_END only if the checksum is correct. | 400 | below), inflate sets strm->adler to the adler32 checksum of the dictionary |
401 | chosen by the compressor and returns Z_NEED_DICT; otherwise it sets | ||
402 | strm->adler to the adler32 checksum of all output produced so far (that is, | ||
403 | total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described | ||
404 | below. At the end of the stream, inflate() checks that its computed adler32 | ||
405 | checksum is equal to that saved by the compressor and returns Z_STREAM_END | ||
406 | only if the checksum is correct. | ||
407 | |||
408 | inflate() will decompress and check either zlib-wrapped or gzip-wrapped | ||
409 | deflate data. The header type is detected automatically. Any information | ||
410 | contained in the gzip header is not retained, so applications that need that | ||
411 | information should instead use raw inflate, see inflateInit2() below, or | ||
412 | inflateBack() and perform their own processing of the gzip header and | ||
413 | trailer. | ||
369 | 414 | ||
370 | inflate() returns Z_OK if some progress has been made (more input processed | 415 | inflate() returns Z_OK if some progress has been made (more input processed |
371 | or more output produced), Z_STREAM_END if the end of the compressed data has | 416 | or more output produced), Z_STREAM_END if the end of the compressed data has |
372 | been reached and all uncompressed output has been produced, Z_NEED_DICT if a | 417 | been reached and all uncompressed output has been produced, Z_NEED_DICT if a |
373 | preset dictionary is needed at this point, Z_DATA_ERROR if the input data was | 418 | preset dictionary is needed at this point, Z_DATA_ERROR if the input data was |
374 | corrupted (input stream not conforming to the zlib format or incorrect | 419 | corrupted (input stream not conforming to the zlib format or incorrect check |
375 | adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent | 420 | value), Z_STREAM_ERROR if the stream structure was inconsistent (for example |
376 | (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not | 421 | if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory, |
377 | enough memory, Z_BUF_ERROR if no progress is possible or if there was not | 422 | Z_BUF_ERROR if no progress is possible or if there was not enough room in the |
378 | enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR | 423 | output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and |
379 | case, the application may then call inflateSync to look for a good | 424 | inflate() can be called again with more input and more output space to |
380 | compression block. | 425 | continue decompressing. If Z_DATA_ERROR is returned, the application may then |
426 | call inflateSync() to look for a good compression block if a partial recovery | ||
427 | of the data is desired. | ||
381 | */ | 428 | */ |
382 | 429 | ||
383 | 430 | ||
@@ -547,16 +594,36 @@ extern int inflateInit2 (z_streamp strm, int windowBits); | |||
547 | The windowBits parameter is the base two logarithm of the maximum window | 594 | The windowBits parameter is the base two logarithm of the maximum window |
548 | size (the size of the history buffer). It should be in the range 8..15 for | 595 | size (the size of the history buffer). It should be in the range 8..15 for |
549 | this version of the library. The default value is 15 if inflateInit is used | 596 | this version of the library. The default value is 15 if inflateInit is used |
550 | instead. If a compressed stream with a larger window size is given as | 597 | instead. windowBits must be greater than or equal to the windowBits value |
551 | input, inflate() will return with the error code Z_DATA_ERROR instead of | 598 | provided to deflateInit2() while compressing, or it must be equal to 15 if |
552 | trying to allocate a larger window. | 599 | deflateInit2() was not used. If a compressed stream with a larger window |
553 | 600 | size is given as input, inflate() will return with the error code | |
554 | inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough | 601 | Z_DATA_ERROR instead of trying to allocate a larger window. |
555 | memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative | 602 | |
556 | memLevel). msg is set to null if there is no error message. inflateInit2 | 603 | windowBits can also be -8..-15 for raw inflate. In this case, -windowBits |
557 | does not perform any decompression apart from reading the zlib header if | 604 | determines the window size. inflate() will then process raw deflate data, |
558 | present: this will be done by inflate(). (So next_in and avail_in may be | 605 | not looking for a zlib or gzip header, not generating a check value, and not |
559 | modified, but next_out and avail_out are unchanged.) | 606 | looking for any check values for comparison at the end of the stream. This |
607 | is for use with other formats that use the deflate compressed data format | ||
608 | such as zip. Those formats provide their own check values. If a custom | ||
609 | format is developed using the raw deflate format for compressed data, it is | ||
610 | recommended that a check value such as an adler32 or a crc32 be applied to | ||
611 | the uncompressed data as is done in the zlib, gzip, and zip formats. For | ||
612 | most applications, the zlib format should be used as is. Note that comments | ||
613 | above on the use in deflateInit2() applies to the magnitude of windowBits. | ||
614 | |||
615 | windowBits can also be greater than 15 for optional gzip decoding. Add | ||
616 | 32 to windowBits to enable zlib and gzip decoding with automatic header | ||
617 | detection, or add 16 to decode only the gzip format (the zlib format will | ||
618 | return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is | ||
619 | a crc32 instead of an adler32. | ||
620 | |||
621 | inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough | ||
622 | memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg | ||
623 | is set to null if there is no error message. inflateInit2 does not perform | ||
624 | any decompression apart from reading the zlib header if present: this will | ||
625 | be done by inflate(). (So next_in and avail_in may be modified, but next_out | ||
626 | and avail_out are unchanged.) | ||
560 | */ | 627 | */ |
561 | 628 | ||
562 | extern int zlib_inflateSetDictionary (z_streamp strm, | 629 | extern int zlib_inflateSetDictionary (z_streamp strm, |
@@ -564,16 +631,19 @@ extern int zlib_inflateSetDictionary (z_streamp strm, | |||
564 | uInt dictLength); | 631 | uInt dictLength); |
565 | /* | 632 | /* |
566 | Initializes the decompression dictionary from the given uncompressed byte | 633 | Initializes the decompression dictionary from the given uncompressed byte |
567 | sequence. This function must be called immediately after a call of inflate | 634 | sequence. This function must be called immediately after a call of inflate, |
568 | if this call returned Z_NEED_DICT. The dictionary chosen by the compressor | 635 | if that call returned Z_NEED_DICT. The dictionary chosen by the compressor |
569 | can be determined from the Adler32 value returned by this call of | 636 | can be determined from the adler32 value returned by that call of inflate. |
570 | inflate. The compressor and decompressor must use exactly the same | 637 | The compressor and decompressor must use exactly the same dictionary (see |
571 | dictionary (see deflateSetDictionary). | 638 | deflateSetDictionary). For raw inflate, this function can be called |
639 | immediately after inflateInit2() or inflateReset() and before any call of | ||
640 | inflate() to set the dictionary. The application must insure that the | ||
641 | dictionary that was used for compression is provided. | ||
572 | 642 | ||
573 | inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a | 643 | inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a |
574 | parameter is invalid (such as NULL dictionary) or the stream state is | 644 | parameter is invalid (such as NULL dictionary) or the stream state is |
575 | inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the | 645 | inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the |
576 | expected one (incorrect Adler32 value). inflateSetDictionary does not | 646 | expected one (incorrect adler32 value). inflateSetDictionary does not |
577 | perform any decompression: this will be done by subsequent calls of | 647 | perform any decompression: this will be done by subsequent calls of |
578 | inflate(). | 648 | inflate(). |
579 | */ | 649 | */ |
@@ -614,40 +684,19 @@ extern int zlib_inflateIncomp (z_stream *strm); | |||
614 | containing the data at next_in (except that the data is not output). | 684 | containing the data at next_in (except that the data is not output). |
615 | */ | 685 | */ |
616 | 686 | ||
617 | /* various hacks, don't look :) */ | ||
618 | |||
619 | /* deflateInit and inflateInit are macros to allow checking the zlib version | ||
620 | * and the compiler's view of z_stream: | ||
621 | */ | ||
622 | extern int zlib_deflateInit_ (z_streamp strm, int level, | ||
623 | const char *version, int stream_size); | ||
624 | extern int zlib_inflateInit_ (z_streamp strm, | ||
625 | const char *version, int stream_size); | ||
626 | extern int zlib_deflateInit2_ (z_streamp strm, int level, int method, | ||
627 | int windowBits, int memLevel, | ||
628 | int strategy, const char *version, | ||
629 | int stream_size); | ||
630 | extern int zlib_inflateInit2_ (z_streamp strm, int windowBits, | ||
631 | const char *version, int stream_size); | ||
632 | #define zlib_deflateInit(strm, level) \ | 687 | #define zlib_deflateInit(strm, level) \ |
633 | zlib_deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) | 688 | zlib_deflateInit2((strm), (level), Z_DEFLATED, MAX_WBITS, \ |
689 | DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY) | ||
634 | #define zlib_inflateInit(strm) \ | 690 | #define zlib_inflateInit(strm) \ |
635 | zlib_inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) | 691 | zlib_inflateInit2((strm), DEF_WBITS) |
636 | #define zlib_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ | ||
637 | zlib_deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ | ||
638 | (strategy), ZLIB_VERSION, sizeof(z_stream)) | ||
639 | #define zlib_inflateInit2(strm, windowBits) \ | ||
640 | zlib_inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) | ||
641 | 692 | ||
693 | extern int zlib_deflateInit2(z_streamp strm, int level, int method, | ||
694 | int windowBits, int memLevel, | ||
695 | int strategy); | ||
696 | extern int zlib_inflateInit2(z_streamp strm, int windowBits); | ||
642 | 697 | ||
643 | #if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL) | 698 | #if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL) |
644 | struct internal_state {int dummy;}; /* hack for buggy compilers */ | 699 | struct internal_state {int dummy;}; /* hack for buggy compilers */ |
645 | #endif | 700 | #endif |
646 | 701 | ||
647 | extern const char * zlib_zError (int err); | ||
648 | #if 0 | ||
649 | extern int zlib_inflateSyncPoint (z_streamp z); | ||
650 | #endif | ||
651 | extern const uLong * zlib_get_crc_table (void); | ||
652 | |||
653 | #endif /* _ZLIB_H */ | 702 | #endif /* _ZLIB_H */ |
diff --git a/include/linux/zorro.h b/include/linux/zorro.h index 2f135cf6eef1..913bfc226dda 100644 --- a/include/linux/zorro.h +++ b/include/linux/zorro.h | |||
@@ -11,8 +11,6 @@ | |||
11 | #ifndef _LINUX_ZORRO_H | 11 | #ifndef _LINUX_ZORRO_H |
12 | #define _LINUX_ZORRO_H | 12 | #define _LINUX_ZORRO_H |
13 | 13 | ||
14 | #ifndef __ASSEMBLY__ | ||
15 | |||
16 | #include <linux/device.h> | 14 | #include <linux/device.h> |
17 | 15 | ||
18 | 16 | ||
@@ -112,45 +110,6 @@ struct ConfigDev { | |||
112 | __u32 cd_Unused[4]; /* for whatever the driver wants */ | 110 | __u32 cd_Unused[4]; /* for whatever the driver wants */ |
113 | } __attribute__ ((packed)); | 111 | } __attribute__ ((packed)); |
114 | 112 | ||
115 | #else /* __ASSEMBLY__ */ | ||
116 | |||
117 | LN_Succ = 0 | ||
118 | LN_Pred = LN_Succ+4 | ||
119 | LN_Type = LN_Pred+4 | ||
120 | LN_Pri = LN_Type+1 | ||
121 | LN_Name = LN_Pri+1 | ||
122 | LN_sizeof = LN_Name+4 | ||
123 | |||
124 | ER_Type = 0 | ||
125 | ER_Product = ER_Type+1 | ||
126 | ER_Flags = ER_Product+1 | ||
127 | ER_Reserved03 = ER_Flags+1 | ||
128 | ER_Manufacturer = ER_Reserved03+1 | ||
129 | ER_SerialNumber = ER_Manufacturer+2 | ||
130 | ER_InitDiagVec = ER_SerialNumber+4 | ||
131 | ER_Reserved0c = ER_InitDiagVec+2 | ||
132 | ER_Reserved0d = ER_Reserved0c+1 | ||
133 | ER_Reserved0e = ER_Reserved0d+1 | ||
134 | ER_Reserved0f = ER_Reserved0e+1 | ||
135 | ER_sizeof = ER_Reserved0f+1 | ||
136 | |||
137 | CD_Node = 0 | ||
138 | CD_Flags = CD_Node+LN_sizeof | ||
139 | CD_Pad = CD_Flags+1 | ||
140 | CD_Rom = CD_Pad+1 | ||
141 | CD_BoardAddr = CD_Rom+ER_sizeof | ||
142 | CD_BoardSize = CD_BoardAddr+4 | ||
143 | CD_SlotAddr = CD_BoardSize+4 | ||
144 | CD_SlotSize = CD_SlotAddr+2 | ||
145 | CD_Driver = CD_SlotSize+2 | ||
146 | CD_NextCD = CD_Driver+4 | ||
147 | CD_Unused = CD_NextCD+4 | ||
148 | CD_sizeof = CD_Unused+(4*4) | ||
149 | |||
150 | #endif /* __ASSEMBLY__ */ | ||
151 | |||
152 | #ifndef __ASSEMBLY__ | ||
153 | |||
154 | #define ZORRO_NUM_AUTO 16 | 113 | #define ZORRO_NUM_AUTO 16 |
155 | 114 | ||
156 | #ifdef __KERNEL__ | 115 | #ifdef __KERNEL__ |
@@ -290,7 +249,6 @@ extern DECLARE_BITMAP(zorro_unused_z2ram, 128); | |||
290 | #define Z2RAM_CHUNKSHIFT (16) | 249 | #define Z2RAM_CHUNKSHIFT (16) |
291 | 250 | ||
292 | 251 | ||
293 | #endif /* !__ASSEMBLY__ */ | ||
294 | #endif /* __KERNEL__ */ | 252 | #endif /* __KERNEL__ */ |
295 | 253 | ||
296 | #endif /* _LINUX_ZORRO_H */ | 254 | #endif /* _LINUX_ZORRO_H */ |
diff --git a/include/linux/zutil.h b/include/linux/zutil.h index ee0c59cf2136..6adfa9a6ffe9 100644 --- a/include/linux/zutil.h +++ b/include/linux/zutil.h | |||
@@ -23,18 +23,6 @@ typedef unsigned long ulg; | |||
23 | 23 | ||
24 | /* common constants */ | 24 | /* common constants */ |
25 | 25 | ||
26 | #ifndef DEF_WBITS | ||
27 | # define DEF_WBITS MAX_WBITS | ||
28 | #endif | ||
29 | /* default windowBits for decompression. MAX_WBITS is for compression only */ | ||
30 | |||
31 | #if MAX_MEM_LEVEL >= 8 | ||
32 | # define DEF_MEM_LEVEL 8 | ||
33 | #else | ||
34 | # define DEF_MEM_LEVEL MAX_MEM_LEVEL | ||
35 | #endif | ||
36 | /* default memLevel */ | ||
37 | |||
38 | #define STORED_BLOCK 0 | 26 | #define STORED_BLOCK 0 |
39 | #define STATIC_TREES 1 | 27 | #define STATIC_TREES 1 |
40 | #define DYN_TREES 2 | 28 | #define DYN_TREES 2 |