diff options
Diffstat (limited to 'include/linux')
127 files changed, 3202 insertions, 631 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 282a504bd1db..e531783e5d78 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -107,6 +107,7 @@ header-y += keyctl.h | |||
107 | header-y += limits.h | 107 | header-y += limits.h |
108 | header-y += magic.h | 108 | header-y += magic.h |
109 | header-y += major.h | 109 | header-y += major.h |
110 | header-y += map_to_7segment.h | ||
110 | header-y += matroxfb.h | 111 | header-y += matroxfb.h |
111 | header-y += meye.h | 112 | header-y += meye.h |
112 | header-y += minix_fs.h | 113 | header-y += minix_fs.h |
@@ -182,6 +183,7 @@ unifdef-y += auto_fs.h | |||
182 | unifdef-y += auxvec.h | 183 | unifdef-y += auxvec.h |
183 | unifdef-y += binfmts.h | 184 | unifdef-y += binfmts.h |
184 | unifdef-y += blktrace_api.h | 185 | unifdef-y += blktrace_api.h |
186 | unifdef-y += byteorder.h | ||
185 | unifdef-y += capability.h | 187 | unifdef-y += capability.h |
186 | unifdef-y += capi.h | 188 | unifdef-y += capi.h |
187 | unifdef-y += cciss_ioctl.h | 189 | unifdef-y += cciss_ioctl.h |
@@ -339,6 +341,7 @@ unifdef-y += soundcard.h | |||
339 | unifdef-y += stat.h | 341 | unifdef-y += stat.h |
340 | unifdef-y += stddef.h | 342 | unifdef-y += stddef.h |
341 | unifdef-y += string.h | 343 | unifdef-y += string.h |
344 | unifdef-y += swab.h | ||
342 | unifdef-y += synclink.h | 345 | unifdef-y += synclink.h |
343 | unifdef-y += sysctl.h | 346 | unifdef-y += sysctl.h |
344 | unifdef-y += tcp.h | 347 | unifdef-y += tcp.h |
diff --git a/include/linux/aio.h b/include/linux/aio.h index 09b276c35227..f6b8cf99b596 100644 --- a/include/linux/aio.h +++ b/include/linux/aio.h | |||
@@ -204,12 +204,21 @@ struct kioctx { | |||
204 | /* prototypes */ | 204 | /* prototypes */ |
205 | extern unsigned aio_max_size; | 205 | extern unsigned aio_max_size; |
206 | 206 | ||
207 | #ifdef CONFIG_AIO | ||
207 | extern ssize_t wait_on_sync_kiocb(struct kiocb *iocb); | 208 | extern ssize_t wait_on_sync_kiocb(struct kiocb *iocb); |
208 | extern int aio_put_req(struct kiocb *iocb); | 209 | extern int aio_put_req(struct kiocb *iocb); |
209 | extern void kick_iocb(struct kiocb *iocb); | 210 | extern void kick_iocb(struct kiocb *iocb); |
210 | extern int aio_complete(struct kiocb *iocb, long res, long res2); | 211 | extern int aio_complete(struct kiocb *iocb, long res, long res2); |
211 | struct mm_struct; | 212 | struct mm_struct; |
212 | extern void exit_aio(struct mm_struct *mm); | 213 | extern void exit_aio(struct mm_struct *mm); |
214 | #else | ||
215 | static inline ssize_t wait_on_sync_kiocb(struct kiocb *iocb) { return 0; } | ||
216 | static inline int aio_put_req(struct kiocb *iocb) { return 0; } | ||
217 | static inline void kick_iocb(struct kiocb *iocb) { } | ||
218 | static inline int aio_complete(struct kiocb *iocb, long res, long res2) { return 0; } | ||
219 | struct mm_struct; | ||
220 | static inline void exit_aio(struct mm_struct *mm) { } | ||
221 | #endif /* CONFIG_AIO */ | ||
213 | 222 | ||
214 | #define io_wait_to_kiocb(wait) container_of(wait, struct kiocb, ki_wait) | 223 | #define io_wait_to_kiocb(wait) container_of(wait, struct kiocb, ki_wait) |
215 | 224 | ||
diff --git a/include/linux/auto_dev-ioctl.h b/include/linux/auto_dev-ioctl.h new file mode 100644 index 000000000000..f4d05ccd731f --- /dev/null +++ b/include/linux/auto_dev-ioctl.h | |||
@@ -0,0 +1,157 @@ | |||
1 | /* | ||
2 | * Copyright 2008 Red Hat, Inc. All rights reserved. | ||
3 | * Copyright 2008 Ian Kent <raven@themaw.net> | ||
4 | * | ||
5 | * This file is part of the Linux kernel and is made available under | ||
6 | * the terms of the GNU General Public License, version 2, or at your | ||
7 | * option, any later version, incorporated herein by reference. | ||
8 | */ | ||
9 | |||
10 | #ifndef _LINUX_AUTO_DEV_IOCTL_H | ||
11 | #define _LINUX_AUTO_DEV_IOCTL_H | ||
12 | |||
13 | #include <linux/types.h> | ||
14 | |||
15 | #define AUTOFS_DEVICE_NAME "autofs" | ||
16 | |||
17 | #define AUTOFS_DEV_IOCTL_VERSION_MAJOR 1 | ||
18 | #define AUTOFS_DEV_IOCTL_VERSION_MINOR 0 | ||
19 | |||
20 | #define AUTOFS_DEVID_LEN 16 | ||
21 | |||
22 | #define AUTOFS_DEV_IOCTL_SIZE sizeof(struct autofs_dev_ioctl) | ||
23 | |||
24 | /* | ||
25 | * An ioctl interface for autofs mount point control. | ||
26 | */ | ||
27 | |||
28 | /* | ||
29 | * All the ioctls use this structure. | ||
30 | * When sending a path size must account for the total length | ||
31 | * of the chunk of memory otherwise is is the size of the | ||
32 | * structure. | ||
33 | */ | ||
34 | |||
35 | struct autofs_dev_ioctl { | ||
36 | __u32 ver_major; | ||
37 | __u32 ver_minor; | ||
38 | __u32 size; /* total size of data passed in | ||
39 | * including this struct */ | ||
40 | __s32 ioctlfd; /* automount command fd */ | ||
41 | |||
42 | __u32 arg1; /* Command parameters */ | ||
43 | __u32 arg2; | ||
44 | |||
45 | char path[0]; | ||
46 | }; | ||
47 | |||
48 | static inline void init_autofs_dev_ioctl(struct autofs_dev_ioctl *in) | ||
49 | { | ||
50 | in->ver_major = AUTOFS_DEV_IOCTL_VERSION_MAJOR; | ||
51 | in->ver_minor = AUTOFS_DEV_IOCTL_VERSION_MINOR; | ||
52 | in->size = sizeof(struct autofs_dev_ioctl); | ||
53 | in->ioctlfd = -1; | ||
54 | in->arg1 = 0; | ||
55 | in->arg2 = 0; | ||
56 | return; | ||
57 | } | ||
58 | |||
59 | /* | ||
60 | * If you change this make sure you make the corresponding change | ||
61 | * to autofs-dev-ioctl.c:lookup_ioctl() | ||
62 | */ | ||
63 | enum { | ||
64 | /* Get various version info */ | ||
65 | AUTOFS_DEV_IOCTL_VERSION_CMD = 0x71, | ||
66 | AUTOFS_DEV_IOCTL_PROTOVER_CMD, | ||
67 | AUTOFS_DEV_IOCTL_PROTOSUBVER_CMD, | ||
68 | |||
69 | /* Open mount ioctl fd */ | ||
70 | AUTOFS_DEV_IOCTL_OPENMOUNT_CMD, | ||
71 | |||
72 | /* Close mount ioctl fd */ | ||
73 | AUTOFS_DEV_IOCTL_CLOSEMOUNT_CMD, | ||
74 | |||
75 | /* Mount/expire status returns */ | ||
76 | AUTOFS_DEV_IOCTL_READY_CMD, | ||
77 | AUTOFS_DEV_IOCTL_FAIL_CMD, | ||
78 | |||
79 | /* Activate/deactivate autofs mount */ | ||
80 | AUTOFS_DEV_IOCTL_SETPIPEFD_CMD, | ||
81 | AUTOFS_DEV_IOCTL_CATATONIC_CMD, | ||
82 | |||
83 | /* Expiry timeout */ | ||
84 | AUTOFS_DEV_IOCTL_TIMEOUT_CMD, | ||
85 | |||
86 | /* Get mount last requesting uid and gid */ | ||
87 | AUTOFS_DEV_IOCTL_REQUESTER_CMD, | ||
88 | |||
89 | /* Check for eligible expire candidates */ | ||
90 | AUTOFS_DEV_IOCTL_EXPIRE_CMD, | ||
91 | |||
92 | /* Request busy status */ | ||
93 | AUTOFS_DEV_IOCTL_ASKUMOUNT_CMD, | ||
94 | |||
95 | /* Check if path is a mountpoint */ | ||
96 | AUTOFS_DEV_IOCTL_ISMOUNTPOINT_CMD, | ||
97 | }; | ||
98 | |||
99 | #define AUTOFS_IOCTL 0x93 | ||
100 | |||
101 | #define AUTOFS_DEV_IOCTL_VERSION \ | ||
102 | _IOWR(AUTOFS_IOCTL, \ | ||
103 | AUTOFS_DEV_IOCTL_VERSION_CMD, struct autofs_dev_ioctl) | ||
104 | |||
105 | #define AUTOFS_DEV_IOCTL_PROTOVER \ | ||
106 | _IOWR(AUTOFS_IOCTL, \ | ||
107 | AUTOFS_DEV_IOCTL_PROTOVER_CMD, struct autofs_dev_ioctl) | ||
108 | |||
109 | #define AUTOFS_DEV_IOCTL_PROTOSUBVER \ | ||
110 | _IOWR(AUTOFS_IOCTL, \ | ||
111 | AUTOFS_DEV_IOCTL_PROTOSUBVER_CMD, struct autofs_dev_ioctl) | ||
112 | |||
113 | #define AUTOFS_DEV_IOCTL_OPENMOUNT \ | ||
114 | _IOWR(AUTOFS_IOCTL, \ | ||
115 | AUTOFS_DEV_IOCTL_OPENMOUNT_CMD, struct autofs_dev_ioctl) | ||
116 | |||
117 | #define AUTOFS_DEV_IOCTL_CLOSEMOUNT \ | ||
118 | _IOWR(AUTOFS_IOCTL, \ | ||
119 | AUTOFS_DEV_IOCTL_CLOSEMOUNT_CMD, struct autofs_dev_ioctl) | ||
120 | |||
121 | #define AUTOFS_DEV_IOCTL_READY \ | ||
122 | _IOWR(AUTOFS_IOCTL, \ | ||
123 | AUTOFS_DEV_IOCTL_READY_CMD, struct autofs_dev_ioctl) | ||
124 | |||
125 | #define AUTOFS_DEV_IOCTL_FAIL \ | ||
126 | _IOWR(AUTOFS_IOCTL, \ | ||
127 | AUTOFS_DEV_IOCTL_FAIL_CMD, struct autofs_dev_ioctl) | ||
128 | |||
129 | #define AUTOFS_DEV_IOCTL_SETPIPEFD \ | ||
130 | _IOWR(AUTOFS_IOCTL, \ | ||
131 | AUTOFS_DEV_IOCTL_SETPIPEFD_CMD, struct autofs_dev_ioctl) | ||
132 | |||
133 | #define AUTOFS_DEV_IOCTL_CATATONIC \ | ||
134 | _IOWR(AUTOFS_IOCTL, \ | ||
135 | AUTOFS_DEV_IOCTL_CATATONIC_CMD, struct autofs_dev_ioctl) | ||
136 | |||
137 | #define AUTOFS_DEV_IOCTL_TIMEOUT \ | ||
138 | _IOWR(AUTOFS_IOCTL, \ | ||
139 | AUTOFS_DEV_IOCTL_TIMEOUT_CMD, struct autofs_dev_ioctl) | ||
140 | |||
141 | #define AUTOFS_DEV_IOCTL_REQUESTER \ | ||
142 | _IOWR(AUTOFS_IOCTL, \ | ||
143 | AUTOFS_DEV_IOCTL_REQUESTER_CMD, struct autofs_dev_ioctl) | ||
144 | |||
145 | #define AUTOFS_DEV_IOCTL_EXPIRE \ | ||
146 | _IOWR(AUTOFS_IOCTL, \ | ||
147 | AUTOFS_DEV_IOCTL_EXPIRE_CMD, struct autofs_dev_ioctl) | ||
148 | |||
149 | #define AUTOFS_DEV_IOCTL_ASKUMOUNT \ | ||
150 | _IOWR(AUTOFS_IOCTL, \ | ||
151 | AUTOFS_DEV_IOCTL_ASKUMOUNT_CMD, struct autofs_dev_ioctl) | ||
152 | |||
153 | #define AUTOFS_DEV_IOCTL_ISMOUNTPOINT \ | ||
154 | _IOWR(AUTOFS_IOCTL, \ | ||
155 | AUTOFS_DEV_IOCTL_ISMOUNTPOINT_CMD, struct autofs_dev_ioctl) | ||
156 | |||
157 | #endif /* _LINUX_AUTO_DEV_IOCTL_H */ | ||
diff --git a/include/linux/auto_fs4.h b/include/linux/auto_fs4.h index b785c6f8644d..2253716d4b92 100644 --- a/include/linux/auto_fs4.h +++ b/include/linux/auto_fs4.h | |||
@@ -23,12 +23,17 @@ | |||
23 | #define AUTOFS_MIN_PROTO_VERSION 3 | 23 | #define AUTOFS_MIN_PROTO_VERSION 3 |
24 | #define AUTOFS_MAX_PROTO_VERSION 5 | 24 | #define AUTOFS_MAX_PROTO_VERSION 5 |
25 | 25 | ||
26 | #define AUTOFS_PROTO_SUBVERSION 0 | 26 | #define AUTOFS_PROTO_SUBVERSION 1 |
27 | 27 | ||
28 | /* Mask for expire behaviour */ | 28 | /* Mask for expire behaviour */ |
29 | #define AUTOFS_EXP_IMMEDIATE 1 | 29 | #define AUTOFS_EXP_IMMEDIATE 1 |
30 | #define AUTOFS_EXP_LEAVES 2 | 30 | #define AUTOFS_EXP_LEAVES 2 |
31 | 31 | ||
32 | #define AUTOFS_TYPE_ANY 0x0000 | ||
33 | #define AUTOFS_TYPE_INDIRECT 0x0001 | ||
34 | #define AUTOFS_TYPE_DIRECT 0x0002 | ||
35 | #define AUTOFS_TYPE_OFFSET 0x0004 | ||
36 | |||
32 | /* Daemon notification packet types */ | 37 | /* Daemon notification packet types */ |
33 | enum autofs_notify { | 38 | enum autofs_notify { |
34 | NFY_NONE, | 39 | NFY_NONE, |
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index 0a24d5550eb3..bee52abb8a4d 100644 --- a/include/linux/backing-dev.h +++ b/include/linux/backing-dev.h | |||
@@ -175,6 +175,8 @@ int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ratio); | |||
175 | * BDI_CAP_READ_MAP: Can be mapped for reading | 175 | * BDI_CAP_READ_MAP: Can be mapped for reading |
176 | * BDI_CAP_WRITE_MAP: Can be mapped for writing | 176 | * BDI_CAP_WRITE_MAP: Can be mapped for writing |
177 | * BDI_CAP_EXEC_MAP: Can be mapped for execution | 177 | * BDI_CAP_EXEC_MAP: Can be mapped for execution |
178 | * | ||
179 | * BDI_CAP_SWAP_BACKED: Count shmem/tmpfs objects as swap-backed. | ||
178 | */ | 180 | */ |
179 | #define BDI_CAP_NO_ACCT_DIRTY 0x00000001 | 181 | #define BDI_CAP_NO_ACCT_DIRTY 0x00000001 |
180 | #define BDI_CAP_NO_WRITEBACK 0x00000002 | 182 | #define BDI_CAP_NO_WRITEBACK 0x00000002 |
@@ -184,6 +186,7 @@ int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ratio); | |||
184 | #define BDI_CAP_WRITE_MAP 0x00000020 | 186 | #define BDI_CAP_WRITE_MAP 0x00000020 |
185 | #define BDI_CAP_EXEC_MAP 0x00000040 | 187 | #define BDI_CAP_EXEC_MAP 0x00000040 |
186 | #define BDI_CAP_NO_ACCT_WB 0x00000080 | 188 | #define BDI_CAP_NO_ACCT_WB 0x00000080 |
189 | #define BDI_CAP_SWAP_BACKED 0x00000100 | ||
187 | 190 | ||
188 | #define BDI_CAP_VMFLAGS \ | 191 | #define BDI_CAP_VMFLAGS \ |
189 | (BDI_CAP_READ_MAP | BDI_CAP_WRITE_MAP | BDI_CAP_EXEC_MAP) | 192 | (BDI_CAP_READ_MAP | BDI_CAP_WRITE_MAP | BDI_CAP_EXEC_MAP) |
@@ -248,6 +251,11 @@ static inline bool bdi_cap_account_writeback(struct backing_dev_info *bdi) | |||
248 | BDI_CAP_NO_WRITEBACK)); | 251 | BDI_CAP_NO_WRITEBACK)); |
249 | } | 252 | } |
250 | 253 | ||
254 | static inline bool bdi_cap_swap_backed(struct backing_dev_info *bdi) | ||
255 | { | ||
256 | return bdi->capabilities & BDI_CAP_SWAP_BACKED; | ||
257 | } | ||
258 | |||
251 | static inline bool mapping_cap_writeback_dirty(struct address_space *mapping) | 259 | static inline bool mapping_cap_writeback_dirty(struct address_space *mapping) |
252 | { | 260 | { |
253 | return bdi_cap_writeback_dirty(mapping->backing_dev_info); | 261 | return bdi_cap_writeback_dirty(mapping->backing_dev_info); |
@@ -258,4 +266,9 @@ static inline bool mapping_cap_account_dirty(struct address_space *mapping) | |||
258 | return bdi_cap_account_dirty(mapping->backing_dev_info); | 266 | return bdi_cap_account_dirty(mapping->backing_dev_info); |
259 | } | 267 | } |
260 | 268 | ||
269 | static inline bool mapping_cap_swap_backed(struct address_space *mapping) | ||
270 | { | ||
271 | return bdi_cap_swap_backed(mapping->backing_dev_info); | ||
272 | } | ||
273 | |||
261 | #endif /* _LINUX_BACKING_DEV_H */ | 274 | #endif /* _LINUX_BACKING_DEV_H */ |
diff --git a/include/linux/bcd.h b/include/linux/bcd.h index 7ac518e3c152..22ea563ba3eb 100644 --- a/include/linux/bcd.h +++ b/include/linux/bcd.h | |||
@@ -1,12 +1,3 @@ | |||
1 | /* Permission is hereby granted to copy, modify and redistribute this code | ||
2 | * in terms of the GNU Library General Public License, Version 2 or later, | ||
3 | * at your option. | ||
4 | */ | ||
5 | |||
6 | /* macros to translate to/from binary and binary-coded decimal (frequently | ||
7 | * found in RTC chips). | ||
8 | */ | ||
9 | |||
10 | #ifndef _BCD_H | 1 | #ifndef _BCD_H |
11 | #define _BCD_H | 2 | #define _BCD_H |
12 | 3 | ||
@@ -15,11 +6,4 @@ | |||
15 | unsigned bcd2bin(unsigned char val) __attribute_const__; | 6 | unsigned bcd2bin(unsigned char val) __attribute_const__; |
16 | unsigned char bin2bcd(unsigned val) __attribute_const__; | 7 | unsigned char bin2bcd(unsigned val) __attribute_const__; |
17 | 8 | ||
18 | #define BCD2BIN(val) bcd2bin(val) | ||
19 | #define BIN2BCD(val) bin2bcd(val) | ||
20 | |||
21 | /* backwards compat */ | ||
22 | #define BCD_TO_BIN(val) ((val)=BCD2BIN(val)) | ||
23 | #define BIN_TO_BCD(val) ((val)=BIN2BCD(val)) | ||
24 | |||
25 | #endif /* _BCD_H */ | 9 | #endif /* _BCD_H */ |
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index 826f62350805..7394b5b349ff 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
@@ -36,6 +36,10 @@ struct linux_binprm{ | |||
36 | unsigned long p; /* current top of mem */ | 36 | unsigned long p; /* current top of mem */ |
37 | unsigned int sh_bang:1, | 37 | unsigned int sh_bang:1, |
38 | misc_bang:1; | 38 | misc_bang:1; |
39 | #ifdef __alpha__ | ||
40 | unsigned int taso:1; | ||
41 | #endif | ||
42 | unsigned int recursion_depth; | ||
39 | struct file * file; | 43 | struct file * file; |
40 | int e_uid, e_gid; | 44 | int e_uid, e_gid; |
41 | kernel_cap_t cap_post_exec_permitted; | 45 | kernel_cap_t cap_post_exec_permitted; |
@@ -58,6 +62,7 @@ struct linux_binprm{ | |||
58 | #define BINPRM_FLAGS_EXECFD_BIT 1 | 62 | #define BINPRM_FLAGS_EXECFD_BIT 1 |
59 | #define BINPRM_FLAGS_EXECFD (1 << BINPRM_FLAGS_EXECFD_BIT) | 63 | #define BINPRM_FLAGS_EXECFD (1 << BINPRM_FLAGS_EXECFD_BIT) |
60 | 64 | ||
65 | #define BINPRM_MAX_RECURSION 4 | ||
61 | 66 | ||
62 | /* | 67 | /* |
63 | * This structure defines the functions that are used to load the binary formats that | 68 | * This structure defines the functions that are used to load the binary formats that |
diff --git a/include/linux/bio.h b/include/linux/bio.h index ff5b4cf9e2da..1c91a176b9ae 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -79,6 +79,13 @@ struct bio { | |||
79 | 79 | ||
80 | unsigned int bi_size; /* residual I/O count */ | 80 | unsigned int bi_size; /* residual I/O count */ |
81 | 81 | ||
82 | /* | ||
83 | * To keep track of the max segment size, we account for the | ||
84 | * sizes of the first and last mergeable segments in this bio. | ||
85 | */ | ||
86 | unsigned int bi_seg_front_size; | ||
87 | unsigned int bi_seg_back_size; | ||
88 | |||
82 | unsigned int bi_max_vecs; /* max bvl_vecs we can hold */ | 89 | unsigned int bi_max_vecs; /* max bvl_vecs we can hold */ |
83 | 90 | ||
84 | unsigned int bi_comp_cpu; /* completion CPU */ | 91 | unsigned int bi_comp_cpu; /* completion CPU */ |
@@ -129,25 +136,30 @@ struct bio { | |||
129 | * bit 2 -- barrier | 136 | * bit 2 -- barrier |
130 | * Insert a serialization point in the IO queue, forcing previously | 137 | * Insert a serialization point in the IO queue, forcing previously |
131 | * submitted IO to be completed before this oen is issued. | 138 | * submitted IO to be completed before this oen is issued. |
132 | * bit 3 -- fail fast, don't want low level driver retries | 139 | * bit 3 -- synchronous I/O hint: the block layer will unplug immediately |
133 | * bit 4 -- synchronous I/O hint: the block layer will unplug immediately | ||
134 | * Note that this does NOT indicate that the IO itself is sync, just | 140 | * Note that this does NOT indicate that the IO itself is sync, just |
135 | * that the block layer will not postpone issue of this IO by plugging. | 141 | * that the block layer will not postpone issue of this IO by plugging. |
136 | * bit 5 -- metadata request | 142 | * bit 4 -- metadata request |
137 | * Used for tracing to differentiate metadata and data IO. May also | 143 | * Used for tracing to differentiate metadata and data IO. May also |
138 | * get some preferential treatment in the IO scheduler | 144 | * get some preferential treatment in the IO scheduler |
139 | * bit 6 -- discard sectors | 145 | * bit 5 -- discard sectors |
140 | * Informs the lower level device that this range of sectors is no longer | 146 | * Informs the lower level device that this range of sectors is no longer |
141 | * used by the file system and may thus be freed by the device. Used | 147 | * used by the file system and may thus be freed by the device. Used |
142 | * for flash based storage. | 148 | * for flash based storage. |
149 | * bit 6 -- fail fast device errors | ||
150 | * bit 7 -- fail fast transport errors | ||
151 | * bit 8 -- fail fast driver errors | ||
152 | * Don't want driver retries for any fast fail whatever the reason. | ||
143 | */ | 153 | */ |
144 | #define BIO_RW 0 /* Must match RW in req flags (blkdev.h) */ | 154 | #define BIO_RW 0 /* Must match RW in req flags (blkdev.h) */ |
145 | #define BIO_RW_AHEAD 1 /* Must match FAILFAST in req flags */ | 155 | #define BIO_RW_AHEAD 1 /* Must match FAILFAST in req flags */ |
146 | #define BIO_RW_BARRIER 2 | 156 | #define BIO_RW_BARRIER 2 |
147 | #define BIO_RW_FAILFAST 3 | 157 | #define BIO_RW_SYNC 3 |
148 | #define BIO_RW_SYNC 4 | 158 | #define BIO_RW_META 4 |
149 | #define BIO_RW_META 5 | 159 | #define BIO_RW_DISCARD 5 |
150 | #define BIO_RW_DISCARD 6 | 160 | #define BIO_RW_FAILFAST_DEV 6 |
161 | #define BIO_RW_FAILFAST_TRANSPORT 7 | ||
162 | #define BIO_RW_FAILFAST_DRIVER 8 | ||
151 | 163 | ||
152 | /* | 164 | /* |
153 | * upper 16 bits of bi_rw define the io priority of this bio | 165 | * upper 16 bits of bi_rw define the io priority of this bio |
@@ -174,7 +186,10 @@ struct bio { | |||
174 | #define bio_sectors(bio) ((bio)->bi_size >> 9) | 186 | #define bio_sectors(bio) ((bio)->bi_size >> 9) |
175 | #define bio_barrier(bio) ((bio)->bi_rw & (1 << BIO_RW_BARRIER)) | 187 | #define bio_barrier(bio) ((bio)->bi_rw & (1 << BIO_RW_BARRIER)) |
176 | #define bio_sync(bio) ((bio)->bi_rw & (1 << BIO_RW_SYNC)) | 188 | #define bio_sync(bio) ((bio)->bi_rw & (1 << BIO_RW_SYNC)) |
177 | #define bio_failfast(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST)) | 189 | #define bio_failfast_dev(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST_DEV)) |
190 | #define bio_failfast_transport(bio) \ | ||
191 | ((bio)->bi_rw & (1 << BIO_RW_FAILFAST_TRANSPORT)) | ||
192 | #define bio_failfast_driver(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST_DRIVER)) | ||
178 | #define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD)) | 193 | #define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD)) |
179 | #define bio_rw_meta(bio) ((bio)->bi_rw & (1 << BIO_RW_META)) | 194 | #define bio_rw_meta(bio) ((bio)->bi_rw & (1 << BIO_RW_META)) |
180 | #define bio_discard(bio) ((bio)->bi_rw & (1 << BIO_RW_DISCARD)) | 195 | #define bio_discard(bio) ((bio)->bi_rw & (1 << BIO_RW_DISCARD)) |
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index 89781fd48859..1abfe664c444 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h | |||
@@ -110,7 +110,6 @@ extern int __bitmap_weight(const unsigned long *bitmap, int bits); | |||
110 | 110 | ||
111 | extern int bitmap_scnprintf(char *buf, unsigned int len, | 111 | extern int bitmap_scnprintf(char *buf, unsigned int len, |
112 | const unsigned long *src, int nbits); | 112 | const unsigned long *src, int nbits); |
113 | extern int bitmap_scnprintf_len(unsigned int nr_bits); | ||
114 | extern int __bitmap_parse(const char *buf, unsigned int buflen, int is_user, | 113 | extern int __bitmap_parse(const char *buf, unsigned int buflen, int is_user, |
115 | unsigned long *dst, int nbits); | 114 | unsigned long *dst, int nbits); |
116 | extern int bitmap_parse_user(const char __user *ubuf, unsigned int ulen, | 115 | extern int bitmap_parse_user(const char __user *ubuf, unsigned int ulen, |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index a92d9e4ea96e..b4fe68fe3a57 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -87,7 +87,9 @@ enum { | |||
87 | */ | 87 | */ |
88 | enum rq_flag_bits { | 88 | enum rq_flag_bits { |
89 | __REQ_RW, /* not set, read. set, write */ | 89 | __REQ_RW, /* not set, read. set, write */ |
90 | __REQ_FAILFAST, /* no low level driver retries */ | 90 | __REQ_FAILFAST_DEV, /* no driver retries of device errors */ |
91 | __REQ_FAILFAST_TRANSPORT, /* no driver retries of transport errors */ | ||
92 | __REQ_FAILFAST_DRIVER, /* no driver retries of driver errors */ | ||
91 | __REQ_DISCARD, /* request to discard sectors */ | 93 | __REQ_DISCARD, /* request to discard sectors */ |
92 | __REQ_SORTED, /* elevator knows about this request */ | 94 | __REQ_SORTED, /* elevator knows about this request */ |
93 | __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ | 95 | __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ |
@@ -111,8 +113,10 @@ enum rq_flag_bits { | |||
111 | }; | 113 | }; |
112 | 114 | ||
113 | #define REQ_RW (1 << __REQ_RW) | 115 | #define REQ_RW (1 << __REQ_RW) |
116 | #define REQ_FAILFAST_DEV (1 << __REQ_FAILFAST_DEV) | ||
117 | #define REQ_FAILFAST_TRANSPORT (1 << __REQ_FAILFAST_TRANSPORT) | ||
118 | #define REQ_FAILFAST_DRIVER (1 << __REQ_FAILFAST_DRIVER) | ||
114 | #define REQ_DISCARD (1 << __REQ_DISCARD) | 119 | #define REQ_DISCARD (1 << __REQ_DISCARD) |
115 | #define REQ_FAILFAST (1 << __REQ_FAILFAST) | ||
116 | #define REQ_SORTED (1 << __REQ_SORTED) | 120 | #define REQ_SORTED (1 << __REQ_SORTED) |
117 | #define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER) | 121 | #define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER) |
118 | #define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER) | 122 | #define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER) |
@@ -560,7 +564,12 @@ enum { | |||
560 | #define blk_special_request(rq) ((rq)->cmd_type == REQ_TYPE_SPECIAL) | 564 | #define blk_special_request(rq) ((rq)->cmd_type == REQ_TYPE_SPECIAL) |
561 | #define blk_sense_request(rq) ((rq)->cmd_type == REQ_TYPE_SENSE) | 565 | #define blk_sense_request(rq) ((rq)->cmd_type == REQ_TYPE_SENSE) |
562 | 566 | ||
563 | #define blk_noretry_request(rq) ((rq)->cmd_flags & REQ_FAILFAST) | 567 | #define blk_failfast_dev(rq) ((rq)->cmd_flags & REQ_FAILFAST_DEV) |
568 | #define blk_failfast_transport(rq) ((rq)->cmd_flags & REQ_FAILFAST_TRANSPORT) | ||
569 | #define blk_failfast_driver(rq) ((rq)->cmd_flags & REQ_FAILFAST_DRIVER) | ||
570 | #define blk_noretry_request(rq) (blk_failfast_dev(rq) || \ | ||
571 | blk_failfast_transport(rq) || \ | ||
572 | blk_failfast_driver(rq)) | ||
564 | #define blk_rq_started(rq) ((rq)->cmd_flags & REQ_STARTED) | 573 | #define blk_rq_started(rq) ((rq)->cmd_flags & REQ_STARTED) |
565 | 574 | ||
566 | #define blk_account_rq(rq) (blk_rq_started(rq) && (blk_fs_request(rq) || blk_discard_rq(rq))) | 575 | #define blk_account_rq(rq) (blk_rq_started(rq) && (blk_fs_request(rq) || blk_discard_rq(rq))) |
@@ -856,7 +865,6 @@ extern void blk_ordered_complete_seq(struct request_queue *, unsigned, int); | |||
856 | extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); | 865 | extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); |
857 | extern void blk_dump_rq_flags(struct request *, char *); | 866 | extern void blk_dump_rq_flags(struct request *, char *); |
858 | extern void generic_unplug_device(struct request_queue *); | 867 | extern void generic_unplug_device(struct request_queue *); |
859 | extern void __generic_unplug_device(struct request_queue *); | ||
860 | extern long nr_blockdev_pages(void); | 868 | extern long nr_blockdev_pages(void); |
861 | 869 | ||
862 | int blk_get_queue(struct request_queue *); | 870 | int blk_get_queue(struct request_queue *); |
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index 3a31eb506164..bdf505d33e77 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h | |||
@@ -24,6 +24,7 @@ enum blktrace_cat { | |||
24 | BLK_TC_AHEAD = 1 << 11, /* readahead */ | 24 | BLK_TC_AHEAD = 1 << 11, /* readahead */ |
25 | BLK_TC_META = 1 << 12, /* metadata */ | 25 | BLK_TC_META = 1 << 12, /* metadata */ |
26 | BLK_TC_DISCARD = 1 << 13, /* discard requests */ | 26 | BLK_TC_DISCARD = 1 << 13, /* discard requests */ |
27 | BLK_TC_DRV_DATA = 1 << 14, /* binary per-driver data */ | ||
27 | 28 | ||
28 | BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ | 29 | BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ |
29 | }; | 30 | }; |
@@ -51,6 +52,7 @@ enum blktrace_act { | |||
51 | __BLK_TA_BOUNCE, /* bio was bounced */ | 52 | __BLK_TA_BOUNCE, /* bio was bounced */ |
52 | __BLK_TA_REMAP, /* bio was remapped */ | 53 | __BLK_TA_REMAP, /* bio was remapped */ |
53 | __BLK_TA_ABORT, /* request aborted */ | 54 | __BLK_TA_ABORT, /* request aborted */ |
55 | __BLK_TA_DRV_DATA, /* driver-specific binary data */ | ||
54 | }; | 56 | }; |
55 | 57 | ||
56 | /* | 58 | /* |
@@ -82,6 +84,7 @@ enum blktrace_notify { | |||
82 | #define BLK_TA_BOUNCE (__BLK_TA_BOUNCE) | 84 | #define BLK_TA_BOUNCE (__BLK_TA_BOUNCE) |
83 | #define BLK_TA_REMAP (__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE)) | 85 | #define BLK_TA_REMAP (__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE)) |
84 | #define BLK_TA_ABORT (__BLK_TA_ABORT | BLK_TC_ACT(BLK_TC_QUEUE)) | 86 | #define BLK_TA_ABORT (__BLK_TA_ABORT | BLK_TC_ACT(BLK_TC_QUEUE)) |
87 | #define BLK_TA_DRV_DATA (__BLK_TA_DRV_DATA | BLK_TC_ACT(BLK_TC_DRV_DATA)) | ||
85 | 88 | ||
86 | #define BLK_TN_PROCESS (__BLK_TN_PROCESS | BLK_TC_ACT(BLK_TC_NOTIFY)) | 89 | #define BLK_TN_PROCESS (__BLK_TN_PROCESS | BLK_TC_ACT(BLK_TC_NOTIFY)) |
87 | #define BLK_TN_TIMESTAMP (__BLK_TN_TIMESTAMP | BLK_TC_ACT(BLK_TC_NOTIFY)) | 90 | #define BLK_TN_TIMESTAMP (__BLK_TN_TIMESTAMP | BLK_TC_ACT(BLK_TC_NOTIFY)) |
@@ -317,6 +320,34 @@ static inline void blk_add_trace_remap(struct request_queue *q, struct bio *bio, | |||
317 | __blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP, !bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r); | 320 | __blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP, !bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r); |
318 | } | 321 | } |
319 | 322 | ||
323 | /** | ||
324 | * blk_add_driver_data - Add binary message with driver-specific data | ||
325 | * @q: queue the io is for | ||
326 | * @rq: io request | ||
327 | * @data: driver-specific data | ||
328 | * @len: length of driver-specific data | ||
329 | * | ||
330 | * Description: | ||
331 | * Some drivers might want to write driver-specific data per request. | ||
332 | * | ||
333 | **/ | ||
334 | static inline void blk_add_driver_data(struct request_queue *q, | ||
335 | struct request *rq, | ||
336 | void *data, size_t len) | ||
337 | { | ||
338 | struct blk_trace *bt = q->blk_trace; | ||
339 | |||
340 | if (likely(!bt)) | ||
341 | return; | ||
342 | |||
343 | if (blk_pc_request(rq)) | ||
344 | __blk_add_trace(bt, 0, rq->data_len, 0, BLK_TA_DRV_DATA, | ||
345 | rq->errors, len, data); | ||
346 | else | ||
347 | __blk_add_trace(bt, rq->hard_sector, rq->hard_nr_sectors << 9, | ||
348 | 0, BLK_TA_DRV_DATA, rq->errors, len, data); | ||
349 | } | ||
350 | |||
320 | extern int blk_trace_setup(struct request_queue *q, char *name, dev_t dev, | 351 | extern int blk_trace_setup(struct request_queue *q, char *name, dev_t dev, |
321 | char __user *arg); | 352 | char __user *arg); |
322 | extern int blk_trace_startstop(struct request_queue *q, int start); | 353 | extern int blk_trace_startstop(struct request_queue *q, int start); |
@@ -330,6 +361,7 @@ extern int blk_trace_remove(struct request_queue *q); | |||
330 | #define blk_add_trace_generic(q, rq, rw, what) do { } while (0) | 361 | #define blk_add_trace_generic(q, rq, rw, what) do { } while (0) |
331 | #define blk_add_trace_pdu_int(q, what, bio, pdu) do { } while (0) | 362 | #define blk_add_trace_pdu_int(q, what, bio, pdu) do { } while (0) |
332 | #define blk_add_trace_remap(q, bio, dev, f, t) do {} while (0) | 363 | #define blk_add_trace_remap(q, bio, dev, f, t) do {} while (0) |
364 | #define blk_add_driver_data(q, rq, data, len) do {} while (0) | ||
333 | #define do_blk_trace_setup(q, name, dev, buts) (-ENOTTY) | 365 | #define do_blk_trace_setup(q, name, dev, buts) (-ENOTTY) |
334 | #define blk_trace_setup(q, name, dev, arg) (-ENOTTY) | 366 | #define blk_trace_setup(q, name, dev, arg) (-ENOTTY) |
335 | #define blk_trace_startstop(q, start) (-ENOTTY) | 367 | #define blk_trace_startstop(q, start) (-ENOTTY) |
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index eadaab44015f..3ce64b90118c 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -322,7 +322,7 @@ static inline void wait_on_buffer(struct buffer_head *bh) | |||
322 | 322 | ||
323 | static inline int trylock_buffer(struct buffer_head *bh) | 323 | static inline int trylock_buffer(struct buffer_head *bh) |
324 | { | 324 | { |
325 | return likely(!test_and_set_bit(BH_Lock, &bh->b_state)); | 325 | return likely(!test_and_set_bit_lock(BH_Lock, &bh->b_state)); |
326 | } | 326 | } |
327 | 327 | ||
328 | static inline void lock_buffer(struct buffer_head *bh) | 328 | static inline void lock_buffer(struct buffer_head *bh) |
diff --git a/include/linux/byteorder/Kbuild b/include/linux/byteorder/Kbuild index 1133d5f9d818..fbaa7f9cee32 100644 --- a/include/linux/byteorder/Kbuild +++ b/include/linux/byteorder/Kbuild | |||
@@ -1,3 +1,4 @@ | |||
1 | unifdef-y += big_endian.h | 1 | unifdef-y += big_endian.h |
2 | unifdef-y += little_endian.h | 2 | unifdef-y += little_endian.h |
3 | unifdef-y += swab.h | 3 | unifdef-y += swab.h |
4 | unifdef-y += swabb.h | ||
diff --git a/include/linux/byteorder/big_endian.h b/include/linux/byteorder/big_endian.h index 44f95b92393b..1cba3f3efe5f 100644 --- a/include/linux/byteorder/big_endian.h +++ b/include/linux/byteorder/big_endian.h | |||
@@ -10,6 +10,7 @@ | |||
10 | 10 | ||
11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
12 | #include <linux/byteorder/swab.h> | 12 | #include <linux/byteorder/swab.h> |
13 | #include <linux/byteorder/swabb.h> | ||
13 | 14 | ||
14 | #define __constant_htonl(x) ((__force __be32)(__u32)(x)) | 15 | #define __constant_htonl(x) ((__force __be32)(__u32)(x)) |
15 | #define __constant_ntohl(x) ((__force __u32)(__be32)(x)) | 16 | #define __constant_ntohl(x) ((__force __u32)(__be32)(x)) |
diff --git a/include/linux/byteorder/little_endian.h b/include/linux/byteorder/little_endian.h index 4cc170a31762..cedc1b5a289c 100644 --- a/include/linux/byteorder/little_endian.h +++ b/include/linux/byteorder/little_endian.h | |||
@@ -10,6 +10,7 @@ | |||
10 | 10 | ||
11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
12 | #include <linux/byteorder/swab.h> | 12 | #include <linux/byteorder/swab.h> |
13 | #include <linux/byteorder/swabb.h> | ||
13 | 14 | ||
14 | #define __constant_htonl(x) ((__force __be32)___constant_swab32((x))) | 15 | #define __constant_htonl(x) ((__force __be32)___constant_swab32((x))) |
15 | #define __constant_ntohl(x) ___constant_swab32((__force __be32)(x)) | 16 | #define __constant_ntohl(x) ___constant_swab32((__force __be32)(x)) |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index c98dd7cb7076..8b00f6643e93 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -9,12 +9,12 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/sched.h> | 11 | #include <linux/sched.h> |
12 | #include <linux/kref.h> | ||
13 | #include <linux/cpumask.h> | 12 | #include <linux/cpumask.h> |
14 | #include <linux/nodemask.h> | 13 | #include <linux/nodemask.h> |
15 | #include <linux/rcupdate.h> | 14 | #include <linux/rcupdate.h> |
16 | #include <linux/cgroupstats.h> | 15 | #include <linux/cgroupstats.h> |
17 | #include <linux/prio_heap.h> | 16 | #include <linux/prio_heap.h> |
17 | #include <linux/rwsem.h> | ||
18 | 18 | ||
19 | #ifdef CONFIG_CGROUPS | 19 | #ifdef CONFIG_CGROUPS |
20 | 20 | ||
@@ -137,6 +137,15 @@ struct cgroup { | |||
137 | * release_list_lock | 137 | * release_list_lock |
138 | */ | 138 | */ |
139 | struct list_head release_list; | 139 | struct list_head release_list; |
140 | |||
141 | /* pids_mutex protects the fields below */ | ||
142 | struct rw_semaphore pids_mutex; | ||
143 | /* Array of process ids in the cgroup */ | ||
144 | pid_t *tasks_pids; | ||
145 | /* How many files are using the current tasks_pids array */ | ||
146 | int pids_use_count; | ||
147 | /* Length of the current tasks_pids array */ | ||
148 | int pids_length; | ||
140 | }; | 149 | }; |
141 | 150 | ||
142 | /* A css_set is a structure holding pointers to a set of | 151 | /* A css_set is a structure holding pointers to a set of |
@@ -149,7 +158,7 @@ struct cgroup { | |||
149 | struct css_set { | 158 | struct css_set { |
150 | 159 | ||
151 | /* Reference count */ | 160 | /* Reference count */ |
152 | struct kref ref; | 161 | atomic_t refcount; |
153 | 162 | ||
154 | /* | 163 | /* |
155 | * List running through all cgroup groups in the same hash | 164 | * List running through all cgroup groups in the same hash |
@@ -326,7 +335,8 @@ struct cgroup_subsys { | |||
326 | */ | 335 | */ |
327 | void (*mm_owner_changed)(struct cgroup_subsys *ss, | 336 | void (*mm_owner_changed)(struct cgroup_subsys *ss, |
328 | struct cgroup *old, | 337 | struct cgroup *old, |
329 | struct cgroup *new); | 338 | struct cgroup *new, |
339 | struct task_struct *p); | ||
330 | int subsys_id; | 340 | int subsys_id; |
331 | int active; | 341 | int active; |
332 | int disabled; | 342 | int disabled; |
@@ -393,6 +403,9 @@ void cgroup_iter_end(struct cgroup *cgrp, struct cgroup_iter *it); | |||
393 | int cgroup_scan_tasks(struct cgroup_scanner *scan); | 403 | int cgroup_scan_tasks(struct cgroup_scanner *scan); |
394 | int cgroup_attach_task(struct cgroup *, struct task_struct *); | 404 | int cgroup_attach_task(struct cgroup *, struct task_struct *); |
395 | 405 | ||
406 | void cgroup_mm_owner_callbacks(struct task_struct *old, | ||
407 | struct task_struct *new); | ||
408 | |||
396 | #else /* !CONFIG_CGROUPS */ | 409 | #else /* !CONFIG_CGROUPS */ |
397 | 410 | ||
398 | static inline int cgroup_init_early(void) { return 0; } | 411 | static inline int cgroup_init_early(void) { return 0; } |
@@ -411,15 +424,9 @@ static inline int cgroupstats_build(struct cgroupstats *stats, | |||
411 | return -EINVAL; | 424 | return -EINVAL; |
412 | } | 425 | } |
413 | 426 | ||
427 | static inline void cgroup_mm_owner_callbacks(struct task_struct *old, | ||
428 | struct task_struct *new) {} | ||
429 | |||
414 | #endif /* !CONFIG_CGROUPS */ | 430 | #endif /* !CONFIG_CGROUPS */ |
415 | 431 | ||
416 | #ifdef CONFIG_MM_OWNER | ||
417 | extern void | ||
418 | cgroup_mm_owner_callbacks(struct task_struct *old, struct task_struct *new); | ||
419 | #else /* !CONFIG_MM_OWNER */ | ||
420 | static inline void | ||
421 | cgroup_mm_owner_callbacks(struct task_struct *old, struct task_struct *new) | ||
422 | { | ||
423 | } | ||
424 | #endif /* CONFIG_MM_OWNER */ | ||
425 | #endif /* _LINUX_CGROUP_H */ | 432 | #endif /* _LINUX_CGROUP_H */ |
diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h index e2877454ec82..9c22396e8b50 100644 --- a/include/linux/cgroup_subsys.h +++ b/include/linux/cgroup_subsys.h | |||
@@ -48,3 +48,9 @@ SUBSYS(devices) | |||
48 | #endif | 48 | #endif |
49 | 49 | ||
50 | /* */ | 50 | /* */ |
51 | |||
52 | #ifdef CONFIG_CGROUP_FREEZER | ||
53 | SUBSYS(freezer) | ||
54 | #endif | ||
55 | |||
56 | /* */ | ||
diff --git a/include/linux/clk.h b/include/linux/clk.h index 5ca8c6fddb56..778777316ea4 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h | |||
@@ -35,6 +35,8 @@ struct clk; | |||
35 | * clk_get may return different clock producers depending on @dev.) | 35 | * clk_get may return different clock producers depending on @dev.) |
36 | * | 36 | * |
37 | * Drivers must assume that the clock source is not enabled. | 37 | * Drivers must assume that the clock source is not enabled. |
38 | * | ||
39 | * clk_get should not be called from within interrupt context. | ||
38 | */ | 40 | */ |
39 | struct clk *clk_get(struct device *dev, const char *id); | 41 | struct clk *clk_get(struct device *dev, const char *id); |
40 | 42 | ||
@@ -76,6 +78,8 @@ unsigned long clk_get_rate(struct clk *clk); | |||
76 | * Note: drivers must ensure that all clk_enable calls made on this | 78 | * Note: drivers must ensure that all clk_enable calls made on this |
77 | * clock source are balanced by clk_disable calls prior to calling | 79 | * clock source are balanced by clk_disable calls prior to calling |
78 | * this function. | 80 | * this function. |
81 | * | ||
82 | * clk_put should not be called from within interrupt context. | ||
79 | */ | 83 | */ |
80 | void clk_put(struct clk *clk); | 84 | void clk_put(struct clk *clk); |
81 | 85 | ||
diff --git a/include/linux/compat.h b/include/linux/compat.h index cf8d11cad5ae..f061a1ea1b74 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -78,7 +78,6 @@ typedef struct { | |||
78 | compat_sigset_word sig[_COMPAT_NSIG_WORDS]; | 78 | compat_sigset_word sig[_COMPAT_NSIG_WORDS]; |
79 | } compat_sigset_t; | 79 | } compat_sigset_t; |
80 | 80 | ||
81 | extern int cp_compat_stat(struct kstat *, struct compat_stat __user *); | ||
82 | extern int get_compat_timespec(struct timespec *, const struct compat_timespec __user *); | 81 | extern int get_compat_timespec(struct timespec *, const struct compat_timespec __user *); |
83 | extern int put_compat_timespec(const struct timespec *, struct compat_timespec __user *); | 82 | extern int put_compat_timespec(const struct timespec *, struct compat_timespec __user *); |
84 | 83 | ||
@@ -235,6 +234,11 @@ extern int get_compat_itimerspec(struct itimerspec *dst, | |||
235 | extern int put_compat_itimerspec(struct compat_itimerspec __user *dst, | 234 | extern int put_compat_itimerspec(struct compat_itimerspec __user *dst, |
236 | const struct itimerspec *src); | 235 | const struct itimerspec *src); |
237 | 236 | ||
237 | asmlinkage long compat_sys_gettimeofday(struct compat_timeval __user *tv, | ||
238 | struct timezone __user *tz); | ||
239 | asmlinkage long compat_sys_settimeofday(struct compat_timeval __user *tv, | ||
240 | struct timezone __user *tz); | ||
241 | |||
238 | asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp); | 242 | asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp); |
239 | 243 | ||
240 | extern int compat_printk(const char *fmt, ...); | 244 | extern int compat_printk(const char *fmt, ...); |
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h index 025e4f575103..0acf3b737e2e 100644 --- a/include/linux/crash_dump.h +++ b/include/linux/crash_dump.h | |||
@@ -8,12 +8,9 @@ | |||
8 | #include <linux/proc_fs.h> | 8 | #include <linux/proc_fs.h> |
9 | 9 | ||
10 | #define ELFCORE_ADDR_MAX (-1ULL) | 10 | #define ELFCORE_ADDR_MAX (-1ULL) |
11 | #define ELFCORE_ADDR_ERR (-2ULL) | ||
11 | 12 | ||
12 | #ifdef CONFIG_PROC_VMCORE | ||
13 | extern unsigned long long elfcorehdr_addr; | 13 | extern unsigned long long elfcorehdr_addr; |
14 | #else | ||
15 | static const unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX; | ||
16 | #endif | ||
17 | 14 | ||
18 | extern ssize_t copy_oldmem_page(unsigned long, char *, size_t, | 15 | extern ssize_t copy_oldmem_page(unsigned long, char *, size_t, |
19 | unsigned long, int); | 16 | unsigned long, int); |
@@ -28,10 +25,43 @@ extern struct proc_dir_entry *proc_vmcore; | |||
28 | 25 | ||
29 | #define vmcore_elf_check_arch(x) (elf_check_arch(x) || vmcore_elf_check_arch_cross(x)) | 26 | #define vmcore_elf_check_arch(x) (elf_check_arch(x) || vmcore_elf_check_arch_cross(x)) |
30 | 27 | ||
28 | /* | ||
29 | * is_kdump_kernel() checks whether this kernel is booting after a panic of | ||
30 | * previous kernel or not. This is determined by checking if previous kernel | ||
31 | * has passed the elf core header address on command line. | ||
32 | * | ||
33 | * This is not just a test if CONFIG_CRASH_DUMP is enabled or not. It will | ||
34 | * return 1 if CONFIG_CRASH_DUMP=y and if kernel is booting after a panic of | ||
35 | * previous kernel. | ||
36 | */ | ||
37 | |||
31 | static inline int is_kdump_kernel(void) | 38 | static inline int is_kdump_kernel(void) |
32 | { | 39 | { |
33 | return (elfcorehdr_addr != ELFCORE_ADDR_MAX) ? 1 : 0; | 40 | return (elfcorehdr_addr != ELFCORE_ADDR_MAX) ? 1 : 0; |
34 | } | 41 | } |
42 | |||
43 | /* is_vmcore_usable() checks if the kernel is booting after a panic and | ||
44 | * the vmcore region is usable. | ||
45 | * | ||
46 | * This makes use of the fact that due to alignment -2ULL is not | ||
47 | * a valid pointer, much in the vain of IS_ERR(), except | ||
48 | * dealing directly with an unsigned long long rather than a pointer. | ||
49 | */ | ||
50 | |||
51 | static inline int is_vmcore_usable(void) | ||
52 | { | ||
53 | return is_kdump_kernel() && elfcorehdr_addr != ELFCORE_ADDR_ERR ? 1 : 0; | ||
54 | } | ||
55 | |||
56 | /* vmcore_unusable() marks the vmcore as unusable, | ||
57 | * without disturbing the logic of is_kdump_kernel() | ||
58 | */ | ||
59 | |||
60 | static inline void vmcore_unusable(void) | ||
61 | { | ||
62 | if (is_kdump_kernel()) | ||
63 | elfcorehdr_addr = ELFCORE_ADDR_ERR; | ||
64 | } | ||
35 | #else /* !CONFIG_CRASH_DUMP */ | 65 | #else /* !CONFIG_CRASH_DUMP */ |
36 | static inline int is_kdump_kernel(void) { return 0; } | 66 | static inline int is_kdump_kernel(void) { return 0; } |
37 | #endif /* CONFIG_CRASH_DUMP */ | 67 | #endif /* CONFIG_CRASH_DUMP */ |
diff --git a/include/linux/device.h b/include/linux/device.h index 246937c9cbc7..987f5912720a 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -90,6 +90,9 @@ int __must_check bus_for_each_drv(struct bus_type *bus, | |||
90 | struct device_driver *start, void *data, | 90 | struct device_driver *start, void *data, |
91 | int (*fn)(struct device_driver *, void *)); | 91 | int (*fn)(struct device_driver *, void *)); |
92 | 92 | ||
93 | void bus_sort_breadthfirst(struct bus_type *bus, | ||
94 | int (*compare)(const struct device *a, | ||
95 | const struct device *b)); | ||
93 | /* | 96 | /* |
94 | * Bus notifiers: Get notified of addition/removal of devices | 97 | * Bus notifiers: Get notified of addition/removal of devices |
95 | * and binding/unbinding of drivers to devices. | 98 | * and binding/unbinding of drivers to devices. |
@@ -502,7 +505,6 @@ extern struct device *device_create(struct class *cls, struct device *parent, | |||
502 | dev_t devt, void *drvdata, | 505 | dev_t devt, void *drvdata, |
503 | const char *fmt, ...) | 506 | const char *fmt, ...) |
504 | __attribute__((format(printf, 5, 6))); | 507 | __attribute__((format(printf, 5, 6))); |
505 | #define device_create_drvdata device_create | ||
506 | extern void device_destroy(struct class *cls, dev_t devt); | 508 | extern void device_destroy(struct class *cls, dev_t devt); |
507 | 509 | ||
508 | /* | 510 | /* |
@@ -551,7 +553,11 @@ extern const char *dev_driver_string(const struct device *dev); | |||
551 | #define dev_info(dev, format, arg...) \ | 553 | #define dev_info(dev, format, arg...) \ |
552 | dev_printk(KERN_INFO , dev , format , ## arg) | 554 | dev_printk(KERN_INFO , dev , format , ## arg) |
553 | 555 | ||
554 | #ifdef DEBUG | 556 | #if defined(CONFIG_DYNAMIC_PRINTK_DEBUG) |
557 | #define dev_dbg(dev, format, ...) do { \ | ||
558 | dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \ | ||
559 | } while (0) | ||
560 | #elif defined(DEBUG) | ||
555 | #define dev_dbg(dev, format, arg...) \ | 561 | #define dev_dbg(dev, format, arg...) \ |
556 | dev_printk(KERN_DEBUG , dev , format , ## arg) | 562 | dev_printk(KERN_DEBUG , dev , format , ## arg) |
557 | #else | 563 | #else |
@@ -567,6 +573,14 @@ extern const char *dev_driver_string(const struct device *dev); | |||
567 | ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; }) | 573 | ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; }) |
568 | #endif | 574 | #endif |
569 | 575 | ||
576 | /* | ||
577 | * dev_WARN() acts like dev_printk(), but with the key difference | ||
578 | * of using a WARN/WARN_ON to get the message out, including the | ||
579 | * file/line information and a backtrace. | ||
580 | */ | ||
581 | #define dev_WARN(dev, format, arg...) \ | ||
582 | WARN(1, "Device: %s\n" format, dev_driver_string(dev), ## arg); | ||
583 | |||
570 | /* Create alias, so I can be autoloaded. */ | 584 | /* Create alias, so I can be autoloaded. */ |
571 | #define MODULE_ALIAS_CHARDEV(major,minor) \ | 585 | #define MODULE_ALIAS_CHARDEV(major,minor) \ |
572 | MODULE_ALIAS("char-major-" __stringify(major) "-" __stringify(minor)) | 586 | MODULE_ALIAS("char-major-" __stringify(major) "-" __stringify(minor)) |
diff --git a/include/linux/dma_remapping.h b/include/linux/dma_remapping.h new file mode 100644 index 000000000000..bff5c65f81dc --- /dev/null +++ b/include/linux/dma_remapping.h | |||
@@ -0,0 +1,157 @@ | |||
1 | #ifndef _DMA_REMAPPING_H | ||
2 | #define _DMA_REMAPPING_H | ||
3 | |||
4 | /* | ||
5 | * We need a fixed PAGE_SIZE of 4K irrespective of | ||
6 | * arch PAGE_SIZE for IOMMU page tables. | ||
7 | */ | ||
8 | #define PAGE_SHIFT_4K (12) | ||
9 | #define PAGE_SIZE_4K (1UL << PAGE_SHIFT_4K) | ||
10 | #define PAGE_MASK_4K (((u64)-1) << PAGE_SHIFT_4K) | ||
11 | #define PAGE_ALIGN_4K(addr) (((addr) + PAGE_SIZE_4K - 1) & PAGE_MASK_4K) | ||
12 | |||
13 | #define IOVA_PFN(addr) ((addr) >> PAGE_SHIFT_4K) | ||
14 | #define DMA_32BIT_PFN IOVA_PFN(DMA_32BIT_MASK) | ||
15 | #define DMA_64BIT_PFN IOVA_PFN(DMA_64BIT_MASK) | ||
16 | |||
17 | |||
18 | /* | ||
19 | * 0: Present | ||
20 | * 1-11: Reserved | ||
21 | * 12-63: Context Ptr (12 - (haw-1)) | ||
22 | * 64-127: Reserved | ||
23 | */ | ||
24 | struct root_entry { | ||
25 | u64 val; | ||
26 | u64 rsvd1; | ||
27 | }; | ||
28 | #define ROOT_ENTRY_NR (PAGE_SIZE_4K/sizeof(struct root_entry)) | ||
29 | static inline bool root_present(struct root_entry *root) | ||
30 | { | ||
31 | return (root->val & 1); | ||
32 | } | ||
33 | static inline void set_root_present(struct root_entry *root) | ||
34 | { | ||
35 | root->val |= 1; | ||
36 | } | ||
37 | static inline void set_root_value(struct root_entry *root, unsigned long value) | ||
38 | { | ||
39 | root->val |= value & PAGE_MASK_4K; | ||
40 | } | ||
41 | |||
42 | struct context_entry; | ||
43 | static inline struct context_entry * | ||
44 | get_context_addr_from_root(struct root_entry *root) | ||
45 | { | ||
46 | return (struct context_entry *) | ||
47 | (root_present(root)?phys_to_virt( | ||
48 | root->val & PAGE_MASK_4K): | ||
49 | NULL); | ||
50 | } | ||
51 | |||
52 | /* | ||
53 | * low 64 bits: | ||
54 | * 0: present | ||
55 | * 1: fault processing disable | ||
56 | * 2-3: translation type | ||
57 | * 12-63: address space root | ||
58 | * high 64 bits: | ||
59 | * 0-2: address width | ||
60 | * 3-6: aval | ||
61 | * 8-23: domain id | ||
62 | */ | ||
63 | struct context_entry { | ||
64 | u64 lo; | ||
65 | u64 hi; | ||
66 | }; | ||
67 | #define context_present(c) ((c).lo & 1) | ||
68 | #define context_fault_disable(c) (((c).lo >> 1) & 1) | ||
69 | #define context_translation_type(c) (((c).lo >> 2) & 3) | ||
70 | #define context_address_root(c) ((c).lo & PAGE_MASK_4K) | ||
71 | #define context_address_width(c) ((c).hi & 7) | ||
72 | #define context_domain_id(c) (((c).hi >> 8) & ((1 << 16) - 1)) | ||
73 | |||
74 | #define context_set_present(c) do {(c).lo |= 1;} while (0) | ||
75 | #define context_set_fault_enable(c) \ | ||
76 | do {(c).lo &= (((u64)-1) << 2) | 1;} while (0) | ||
77 | #define context_set_translation_type(c, val) \ | ||
78 | do { \ | ||
79 | (c).lo &= (((u64)-1) << 4) | 3; \ | ||
80 | (c).lo |= ((val) & 3) << 2; \ | ||
81 | } while (0) | ||
82 | #define CONTEXT_TT_MULTI_LEVEL 0 | ||
83 | #define context_set_address_root(c, val) \ | ||
84 | do {(c).lo |= (val) & PAGE_MASK_4K;} while (0) | ||
85 | #define context_set_address_width(c, val) do {(c).hi |= (val) & 7;} while (0) | ||
86 | #define context_set_domain_id(c, val) \ | ||
87 | do {(c).hi |= ((val) & ((1 << 16) - 1)) << 8;} while (0) | ||
88 | #define context_clear_entry(c) do {(c).lo = 0; (c).hi = 0;} while (0) | ||
89 | |||
90 | /* | ||
91 | * 0: readable | ||
92 | * 1: writable | ||
93 | * 2-6: reserved | ||
94 | * 7: super page | ||
95 | * 8-11: available | ||
96 | * 12-63: Host physcial address | ||
97 | */ | ||
98 | struct dma_pte { | ||
99 | u64 val; | ||
100 | }; | ||
101 | #define dma_clear_pte(p) do {(p).val = 0;} while (0) | ||
102 | |||
103 | #define DMA_PTE_READ (1) | ||
104 | #define DMA_PTE_WRITE (2) | ||
105 | |||
106 | #define dma_set_pte_readable(p) do {(p).val |= DMA_PTE_READ;} while (0) | ||
107 | #define dma_set_pte_writable(p) do {(p).val |= DMA_PTE_WRITE;} while (0) | ||
108 | #define dma_set_pte_prot(p, prot) \ | ||
109 | do {(p).val = ((p).val & ~3) | ((prot) & 3); } while (0) | ||
110 | #define dma_pte_addr(p) ((p).val & PAGE_MASK_4K) | ||
111 | #define dma_set_pte_addr(p, addr) do {\ | ||
112 | (p).val |= ((addr) & PAGE_MASK_4K); } while (0) | ||
113 | #define dma_pte_present(p) (((p).val & 3) != 0) | ||
114 | |||
115 | struct intel_iommu; | ||
116 | |||
117 | struct dmar_domain { | ||
118 | int id; /* domain id */ | ||
119 | struct intel_iommu *iommu; /* back pointer to owning iommu */ | ||
120 | |||
121 | struct list_head devices; /* all devices' list */ | ||
122 | struct iova_domain iovad; /* iova's that belong to this domain */ | ||
123 | |||
124 | struct dma_pte *pgd; /* virtual address */ | ||
125 | spinlock_t mapping_lock; /* page table lock */ | ||
126 | int gaw; /* max guest address width */ | ||
127 | |||
128 | /* adjusted guest address width, 0 is level 2 30-bit */ | ||
129 | int agaw; | ||
130 | |||
131 | #define DOMAIN_FLAG_MULTIPLE_DEVICES 1 | ||
132 | int flags; | ||
133 | }; | ||
134 | |||
135 | /* PCI domain-device relationship */ | ||
136 | struct device_domain_info { | ||
137 | struct list_head link; /* link to domain siblings */ | ||
138 | struct list_head global; /* link to global list */ | ||
139 | u8 bus; /* PCI bus numer */ | ||
140 | u8 devfn; /* PCI devfn number */ | ||
141 | struct pci_dev *dev; /* it's NULL for PCIE-to-PCI bridge */ | ||
142 | struct dmar_domain *domain; /* pointer to domain */ | ||
143 | }; | ||
144 | |||
145 | extern int init_dmars(void); | ||
146 | extern void free_dmar_iommu(struct intel_iommu *iommu); | ||
147 | |||
148 | extern int dmar_disabled; | ||
149 | |||
150 | #ifndef CONFIG_DMAR_GFX_WA | ||
151 | static inline void iommu_prepare_gfx_mapping(void) | ||
152 | { | ||
153 | return; | ||
154 | } | ||
155 | #endif /* !CONFIG_DMAR_GFX_WA */ | ||
156 | |||
157 | #endif | ||
diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h index 6e4ace270276..79a8ed8e6a7d 100644 --- a/include/linux/dvb/frontend.h +++ b/include/linux/dvb/frontend.h | |||
@@ -166,6 +166,7 @@ typedef enum fe_modulation { | |||
166 | VSB_16, | 166 | VSB_16, |
167 | PSK_8, | 167 | PSK_8, |
168 | APSK_16, | 168 | APSK_16, |
169 | APSK_32, | ||
169 | DQPSK, | 170 | DQPSK, |
170 | } fe_modulation_t; | 171 | } fe_modulation_t; |
171 | 172 | ||
@@ -295,6 +296,7 @@ typedef enum fe_delivery_system { | |||
295 | SYS_DVBC_ANNEX_AC, | 296 | SYS_DVBC_ANNEX_AC, |
296 | SYS_DVBC_ANNEX_B, | 297 | SYS_DVBC_ANNEX_B, |
297 | SYS_DVBT, | 298 | SYS_DVBT, |
299 | SYS_DSS, | ||
298 | SYS_DVBS, | 300 | SYS_DVBS, |
299 | SYS_DVBS2, | 301 | SYS_DVBS2, |
300 | SYS_DVBH, | 302 | SYS_DVBH, |
diff --git a/include/linux/dynamic_printk.h b/include/linux/dynamic_printk.h new file mode 100644 index 000000000000..2d528d009074 --- /dev/null +++ b/include/linux/dynamic_printk.h | |||
@@ -0,0 +1,93 @@ | |||
1 | #ifndef _DYNAMIC_PRINTK_H | ||
2 | #define _DYNAMIC_PRINTK_H | ||
3 | |||
4 | #define DYNAMIC_DEBUG_HASH_BITS 6 | ||
5 | #define DEBUG_HASH_TABLE_SIZE (1 << DYNAMIC_DEBUG_HASH_BITS) | ||
6 | |||
7 | #define TYPE_BOOLEAN 1 | ||
8 | |||
9 | #define DYNAMIC_ENABLED_ALL 0 | ||
10 | #define DYNAMIC_ENABLED_NONE 1 | ||
11 | #define DYNAMIC_ENABLED_SOME 2 | ||
12 | |||
13 | extern int dynamic_enabled; | ||
14 | |||
15 | /* dynamic_printk_enabled, and dynamic_printk_enabled2 are bitmasks in which | ||
16 | * bit n is set to 1 if any modname hashes into the bucket n, 0 otherwise. They | ||
17 | * use independent hash functions, to reduce the chance of false positives. | ||
18 | */ | ||
19 | extern long long dynamic_printk_enabled; | ||
20 | extern long long dynamic_printk_enabled2; | ||
21 | |||
22 | struct mod_debug { | ||
23 | char *modname; | ||
24 | char *logical_modname; | ||
25 | char *flag_names; | ||
26 | int type; | ||
27 | int hash; | ||
28 | int hash2; | ||
29 | } __attribute__((aligned(8))); | ||
30 | |||
31 | int register_dynamic_debug_module(char *mod_name, int type, char *share_name, | ||
32 | char *flags, int hash, int hash2); | ||
33 | |||
34 | #if defined(CONFIG_DYNAMIC_PRINTK_DEBUG) | ||
35 | extern int unregister_dynamic_debug_module(char *mod_name); | ||
36 | extern int __dynamic_dbg_enabled_helper(char *modname, int type, | ||
37 | int value, int hash); | ||
38 | |||
39 | #define __dynamic_dbg_enabled(module, type, value, level, hash) ({ \ | ||
40 | int __ret = 0; \ | ||
41 | if (unlikely((dynamic_printk_enabled & (1LL << DEBUG_HASH)) && \ | ||
42 | (dynamic_printk_enabled2 & (1LL << DEBUG_HASH2)))) \ | ||
43 | __ret = __dynamic_dbg_enabled_helper(module, type, \ | ||
44 | value, hash);\ | ||
45 | __ret; }) | ||
46 | |||
47 | #define dynamic_pr_debug(fmt, ...) do { \ | ||
48 | static char mod_name[] \ | ||
49 | __attribute__((section("__verbose_strings"))) \ | ||
50 | = KBUILD_MODNAME; \ | ||
51 | static struct mod_debug descriptor \ | ||
52 | __used \ | ||
53 | __attribute__((section("__verbose"), aligned(8))) = \ | ||
54 | { mod_name, mod_name, NULL, TYPE_BOOLEAN, DEBUG_HASH, DEBUG_HASH2 };\ | ||
55 | if (__dynamic_dbg_enabled(KBUILD_MODNAME, TYPE_BOOLEAN, \ | ||
56 | 0, 0, DEBUG_HASH)) \ | ||
57 | printk(KERN_DEBUG KBUILD_MODNAME ":" fmt, \ | ||
58 | ##__VA_ARGS__); \ | ||
59 | } while (0) | ||
60 | |||
61 | #define dynamic_dev_dbg(dev, format, ...) do { \ | ||
62 | static char mod_name[] \ | ||
63 | __attribute__((section("__verbose_strings"))) \ | ||
64 | = KBUILD_MODNAME; \ | ||
65 | static struct mod_debug descriptor \ | ||
66 | __used \ | ||
67 | __attribute__((section("__verbose"), aligned(8))) = \ | ||
68 | { mod_name, mod_name, NULL, TYPE_BOOLEAN, DEBUG_HASH, DEBUG_HASH2 };\ | ||
69 | if (__dynamic_dbg_enabled(KBUILD_MODNAME, TYPE_BOOLEAN, \ | ||
70 | 0, 0, DEBUG_HASH)) \ | ||
71 | dev_printk(KERN_DEBUG, dev, \ | ||
72 | KBUILD_MODNAME ": " format, \ | ||
73 | ##__VA_ARGS__); \ | ||
74 | } while (0) | ||
75 | |||
76 | #else | ||
77 | |||
78 | static inline int unregister_dynamic_debug_module(const char *mod_name) | ||
79 | { | ||
80 | return 0; | ||
81 | } | ||
82 | static inline int __dynamic_dbg_enabled_helper(char *modname, int type, | ||
83 | int value, int hash) | ||
84 | { | ||
85 | return 0; | ||
86 | } | ||
87 | |||
88 | #define __dynamic_dbg_enabled(module, type, value, level, hash) ({ 0; }) | ||
89 | #define dynamic_pr_debug(fmt, ...) do { } while (0) | ||
90 | #define dynamic_dev_dbg(dev, format, ...) do { } while (0) | ||
91 | #endif | ||
92 | |||
93 | #endif | ||
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h index 2efe7b863cff..78c775a83f7c 100644 --- a/include/linux/ext2_fs.h +++ b/include/linux/ext2_fs.h | |||
@@ -47,7 +47,7 @@ | |||
47 | #ifdef EXT2FS_DEBUG | 47 | #ifdef EXT2FS_DEBUG |
48 | # define ext2_debug(f, a...) { \ | 48 | # define ext2_debug(f, a...) { \ |
49 | printk ("EXT2-fs DEBUG (%s, %d): %s:", \ | 49 | printk ("EXT2-fs DEBUG (%s, %d): %s:", \ |
50 | __FILE__, __LINE__, __FUNCTION__); \ | 50 | __FILE__, __LINE__, __func__); \ |
51 | printk (f, ## a); \ | 51 | printk (f, ## a); \ |
52 | } | 52 | } |
53 | #else | 53 | #else |
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 8120fa1bc235..d14f02918483 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
@@ -43,7 +43,7 @@ | |||
43 | #define ext3_debug(f, a...) \ | 43 | #define ext3_debug(f, a...) \ |
44 | do { \ | 44 | do { \ |
45 | printk (KERN_DEBUG "EXT3-fs DEBUG (%s, %d): %s:", \ | 45 | printk (KERN_DEBUG "EXT3-fs DEBUG (%s, %d): %s:", \ |
46 | __FILE__, __LINE__, __FUNCTION__); \ | 46 | __FILE__, __LINE__, __func__); \ |
47 | printk (KERN_DEBUG f, ## a); \ | 47 | printk (KERN_DEBUG f, ## a); \ |
48 | } while (0) | 48 | } while (0) |
49 | #else | 49 | #else |
@@ -380,6 +380,8 @@ struct ext3_inode { | |||
380 | #define EXT3_MOUNT_QUOTA 0x80000 /* Some quota option set */ | 380 | #define EXT3_MOUNT_QUOTA 0x80000 /* Some quota option set */ |
381 | #define EXT3_MOUNT_USRQUOTA 0x100000 /* "old" user quota */ | 381 | #define EXT3_MOUNT_USRQUOTA 0x100000 /* "old" user quota */ |
382 | #define EXT3_MOUNT_GRPQUOTA 0x200000 /* "old" group quota */ | 382 | #define EXT3_MOUNT_GRPQUOTA 0x200000 /* "old" group quota */ |
383 | #define EXT3_MOUNT_DATA_ERR_ABORT 0x400000 /* Abort on file data write | ||
384 | * error in ordered mode */ | ||
383 | 385 | ||
384 | /* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */ | 386 | /* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */ |
385 | #ifndef _LINUX_EXT2_FS_H | 387 | #ifndef _LINUX_EXT2_FS_H |
@@ -871,7 +873,7 @@ extern void ext3_update_dynamic_rev (struct super_block *sb); | |||
871 | #define ext3_std_error(sb, errno) \ | 873 | #define ext3_std_error(sb, errno) \ |
872 | do { \ | 874 | do { \ |
873 | if ((errno)) \ | 875 | if ((errno)) \ |
874 | __ext3_std_error((sb), __FUNCTION__, (errno)); \ | 876 | __ext3_std_error((sb), __func__, (errno)); \ |
875 | } while (0) | 877 | } while (0) |
876 | 878 | ||
877 | /* | 879 | /* |
diff --git a/include/linux/ext3_jbd.h b/include/linux/ext3_jbd.h index 8c43b13a02fe..cf82d519be40 100644 --- a/include/linux/ext3_jbd.h +++ b/include/linux/ext3_jbd.h | |||
@@ -137,17 +137,17 @@ int __ext3_journal_dirty_metadata(const char *where, | |||
137 | handle_t *handle, struct buffer_head *bh); | 137 | handle_t *handle, struct buffer_head *bh); |
138 | 138 | ||
139 | #define ext3_journal_get_undo_access(handle, bh) \ | 139 | #define ext3_journal_get_undo_access(handle, bh) \ |
140 | __ext3_journal_get_undo_access(__FUNCTION__, (handle), (bh)) | 140 | __ext3_journal_get_undo_access(__func__, (handle), (bh)) |
141 | #define ext3_journal_get_write_access(handle, bh) \ | 141 | #define ext3_journal_get_write_access(handle, bh) \ |
142 | __ext3_journal_get_write_access(__FUNCTION__, (handle), (bh)) | 142 | __ext3_journal_get_write_access(__func__, (handle), (bh)) |
143 | #define ext3_journal_revoke(handle, blocknr, bh) \ | 143 | #define ext3_journal_revoke(handle, blocknr, bh) \ |
144 | __ext3_journal_revoke(__FUNCTION__, (handle), (blocknr), (bh)) | 144 | __ext3_journal_revoke(__func__, (handle), (blocknr), (bh)) |
145 | #define ext3_journal_get_create_access(handle, bh) \ | 145 | #define ext3_journal_get_create_access(handle, bh) \ |
146 | __ext3_journal_get_create_access(__FUNCTION__, (handle), (bh)) | 146 | __ext3_journal_get_create_access(__func__, (handle), (bh)) |
147 | #define ext3_journal_dirty_metadata(handle, bh) \ | 147 | #define ext3_journal_dirty_metadata(handle, bh) \ |
148 | __ext3_journal_dirty_metadata(__FUNCTION__, (handle), (bh)) | 148 | __ext3_journal_dirty_metadata(__func__, (handle), (bh)) |
149 | #define ext3_journal_forget(handle, bh) \ | 149 | #define ext3_journal_forget(handle, bh) \ |
150 | __ext3_journal_forget(__FUNCTION__, (handle), (bh)) | 150 | __ext3_journal_forget(__func__, (handle), (bh)) |
151 | 151 | ||
152 | int ext3_journal_dirty_data(handle_t *handle, struct buffer_head *bh); | 152 | int ext3_journal_dirty_data(handle_t *handle, struct buffer_head *bh); |
153 | 153 | ||
@@ -160,7 +160,7 @@ static inline handle_t *ext3_journal_start(struct inode *inode, int nblocks) | |||
160 | } | 160 | } |
161 | 161 | ||
162 | #define ext3_journal_stop(handle) \ | 162 | #define ext3_journal_stop(handle) \ |
163 | __ext3_journal_stop(__FUNCTION__, (handle)) | 163 | __ext3_journal_stop(__func__, (handle)) |
164 | 164 | ||
165 | static inline handle_t *ext3_journal_current_handle(void) | 165 | static inline handle_t *ext3_journal_current_handle(void) |
166 | { | 166 | { |
diff --git a/include/linux/fb.h b/include/linux/fb.h index 531ccd5f5960..75a81eaf3430 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -808,6 +808,7 @@ struct fb_tile_ops { | |||
808 | struct fb_info { | 808 | struct fb_info { |
809 | int node; | 809 | int node; |
810 | int flags; | 810 | int flags; |
811 | struct mutex lock; /* Lock for open/release/ioctl funcs */ | ||
811 | struct fb_var_screeninfo var; /* Current var */ | 812 | struct fb_var_screeninfo var; /* Current var */ |
812 | struct fb_fix_screeninfo fix; /* Current fix */ | 813 | struct fb_fix_screeninfo fix; /* Current fix */ |
813 | struct fb_monspecs monspecs; /* Current Monitor specs */ | 814 | struct fb_monspecs monspecs; /* Current Monitor specs */ |
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h index 0f0e271f97fa..4d078e99c017 100644 --- a/include/linux/firewire-cdev.h +++ b/include/linux/firewire-cdev.h | |||
@@ -154,8 +154,13 @@ struct fw_cdev_event_iso_interrupt { | |||
154 | * @request: Valid if @common.type == %FW_CDEV_EVENT_REQUEST | 154 | * @request: Valid if @common.type == %FW_CDEV_EVENT_REQUEST |
155 | * @iso_interrupt: Valid if @common.type == %FW_CDEV_EVENT_ISO_INTERRUPT | 155 | * @iso_interrupt: Valid if @common.type == %FW_CDEV_EVENT_ISO_INTERRUPT |
156 | * | 156 | * |
157 | * Convenience union for userspace use. Events could be read(2) into a char | 157 | * Convenience union for userspace use. Events could be read(2) into an |
158 | * buffer and then cast to this union for further processing. | 158 | * appropriately aligned char buffer and then cast to this union for further |
159 | * processing. Note that for a request, response or iso_interrupt event, | ||
160 | * the data[] or header[] may make the size of the full event larger than | ||
161 | * sizeof(union fw_cdev_event). Also note that if you attempt to read(2) | ||
162 | * an event into a buffer that is not large enough for it, the data that does | ||
163 | * not fit will be discarded so that the next read(2) will return a new event. | ||
159 | */ | 164 | */ |
160 | union fw_cdev_event { | 165 | union fw_cdev_event { |
161 | struct fw_cdev_event_common common; | 166 | struct fw_cdev_event_common common; |
diff --git a/include/linux/freezer.h b/include/linux/freezer.h index deddeedf3257..8f225339eee9 100644 --- a/include/linux/freezer.h +++ b/include/linux/freezer.h | |||
@@ -6,7 +6,7 @@ | |||
6 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
7 | #include <linux/wait.h> | 7 | #include <linux/wait.h> |
8 | 8 | ||
9 | #ifdef CONFIG_PM_SLEEP | 9 | #ifdef CONFIG_FREEZER |
10 | /* | 10 | /* |
11 | * Check if a process has been frozen | 11 | * Check if a process has been frozen |
12 | */ | 12 | */ |
@@ -39,28 +39,18 @@ static inline void clear_freeze_flag(struct task_struct *p) | |||
39 | clear_tsk_thread_flag(p, TIF_FREEZE); | 39 | clear_tsk_thread_flag(p, TIF_FREEZE); |
40 | } | 40 | } |
41 | 41 | ||
42 | static inline bool should_send_signal(struct task_struct *p) | ||
43 | { | ||
44 | return !(p->flags & PF_FREEZER_NOSIG); | ||
45 | } | ||
46 | |||
42 | /* | 47 | /* |
43 | * Wake up a frozen process | 48 | * Wake up a frozen process |
44 | * | ||
45 | * task_lock() is taken to prevent the race with refrigerator() which may | ||
46 | * occur if the freezing of tasks fails. Namely, without the lock, if the | ||
47 | * freezing of tasks failed, thaw_tasks() might have run before a task in | ||
48 | * refrigerator() could call frozen_process(), in which case the task would be | ||
49 | * frozen and no one would thaw it. | ||
50 | */ | 49 | */ |
51 | static inline int thaw_process(struct task_struct *p) | 50 | extern int __thaw_process(struct task_struct *p); |
52 | { | 51 | |
53 | task_lock(p); | 52 | /* Takes and releases task alloc lock using task_lock() */ |
54 | if (frozen(p)) { | 53 | extern int thaw_process(struct task_struct *p); |
55 | p->flags &= ~PF_FROZEN; | ||
56 | task_unlock(p); | ||
57 | wake_up_process(p); | ||
58 | return 1; | ||
59 | } | ||
60 | clear_freeze_flag(p); | ||
61 | task_unlock(p); | ||
62 | return 0; | ||
63 | } | ||
64 | 54 | ||
65 | extern void refrigerator(void); | 55 | extern void refrigerator(void); |
66 | extern int freeze_processes(void); | 56 | extern int freeze_processes(void); |
@@ -75,6 +65,15 @@ static inline int try_to_freeze(void) | |||
75 | return 0; | 65 | return 0; |
76 | } | 66 | } |
77 | 67 | ||
68 | extern bool freeze_task(struct task_struct *p, bool sig_only); | ||
69 | extern void cancel_freezing(struct task_struct *p); | ||
70 | |||
71 | #ifdef CONFIG_CGROUP_FREEZER | ||
72 | extern int cgroup_frozen(struct task_struct *task); | ||
73 | #else /* !CONFIG_CGROUP_FREEZER */ | ||
74 | static inline int cgroup_frozen(struct task_struct *task) { return 0; } | ||
75 | #endif /* !CONFIG_CGROUP_FREEZER */ | ||
76 | |||
78 | /* | 77 | /* |
79 | * The PF_FREEZER_SKIP flag should be set by a vfork parent right before it | 78 | * The PF_FREEZER_SKIP flag should be set by a vfork parent right before it |
80 | * calls wait_for_completion(&vfork) and reset right after it returns from this | 79 | * calls wait_for_completion(&vfork) and reset right after it returns from this |
@@ -166,7 +165,7 @@ static inline void set_freezable_with_signal(void) | |||
166 | } while (try_to_freeze()); \ | 165 | } while (try_to_freeze()); \ |
167 | __retval; \ | 166 | __retval; \ |
168 | }) | 167 | }) |
169 | #else /* !CONFIG_PM_SLEEP */ | 168 | #else /* !CONFIG_FREEZER */ |
170 | static inline int frozen(struct task_struct *p) { return 0; } | 169 | static inline int frozen(struct task_struct *p) { return 0; } |
171 | static inline int freezing(struct task_struct *p) { return 0; } | 170 | static inline int freezing(struct task_struct *p) { return 0; } |
172 | static inline void set_freeze_flag(struct task_struct *p) {} | 171 | static inline void set_freeze_flag(struct task_struct *p) {} |
@@ -191,6 +190,6 @@ static inline void set_freezable_with_signal(void) {} | |||
191 | #define wait_event_freezable_timeout(wq, condition, timeout) \ | 190 | #define wait_event_freezable_timeout(wq, condition, timeout) \ |
192 | wait_event_interruptible_timeout(wq, condition, timeout) | 191 | wait_event_interruptible_timeout(wq, condition, timeout) |
193 | 192 | ||
194 | #endif /* !CONFIG_PM_SLEEP */ | 193 | #endif /* !CONFIG_FREEZER */ |
195 | 194 | ||
196 | #endif /* FREEZER_H_INCLUDED */ | 195 | #endif /* FREEZER_H_INCLUDED */ |
diff --git a/include/linux/gameport.h b/include/linux/gameport.h index f64e29c0ef3f..0cd825f7363a 100644 --- a/include/linux/gameport.h +++ b/include/linux/gameport.h | |||
@@ -146,10 +146,11 @@ static inline void gameport_unpin_driver(struct gameport *gameport) | |||
146 | mutex_unlock(&gameport->drv_mutex); | 146 | mutex_unlock(&gameport->drv_mutex); |
147 | } | 147 | } |
148 | 148 | ||
149 | void __gameport_register_driver(struct gameport_driver *drv, struct module *owner); | 149 | int __gameport_register_driver(struct gameport_driver *drv, |
150 | static inline void gameport_register_driver(struct gameport_driver *drv) | 150 | struct module *owner, const char *mod_name); |
151 | static inline int __must_check gameport_register_driver(struct gameport_driver *drv) | ||
151 | { | 152 | { |
152 | __gameport_register_driver(drv, THIS_MODULE); | 153 | return __gameport_register_driver(drv, THIS_MODULE, KBUILD_MODNAME); |
153 | } | 154 | } |
154 | 155 | ||
155 | void gameport_unregister_driver(struct gameport_driver *drv); | 156 | void gameport_unregister_driver(struct gameport_driver *drv); |
diff --git a/include/linux/gpio.h b/include/linux/gpio.h index 730a20b83576..e10c49a5b96e 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h | |||
@@ -8,6 +8,7 @@ | |||
8 | 8 | ||
9 | #else | 9 | #else |
10 | 10 | ||
11 | #include <linux/kernel.h> | ||
11 | #include <linux/types.h> | 12 | #include <linux/types.h> |
12 | #include <linux/errno.h> | 13 | #include <linux/errno.h> |
13 | 14 | ||
@@ -32,6 +33,8 @@ static inline int gpio_request(unsigned gpio, const char *label) | |||
32 | 33 | ||
33 | static inline void gpio_free(unsigned gpio) | 34 | static inline void gpio_free(unsigned gpio) |
34 | { | 35 | { |
36 | might_sleep(); | ||
37 | |||
35 | /* GPIO can never have been requested */ | 38 | /* GPIO can never have been requested */ |
36 | WARN_ON(1); | 39 | WARN_ON(1); |
37 | } | 40 | } |
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index 493435bcdbe5..01d67ba9e985 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
@@ -60,7 +60,7 @@ | |||
60 | #define I2C_DRIVERID_WM8775 69 /* wm8775 audio processor */ | 60 | #define I2C_DRIVERID_WM8775 69 /* wm8775 audio processor */ |
61 | #define I2C_DRIVERID_CS53L32A 70 /* cs53l32a audio processor */ | 61 | #define I2C_DRIVERID_CS53L32A 70 /* cs53l32a audio processor */ |
62 | #define I2C_DRIVERID_CX25840 71 /* cx2584x video encoder */ | 62 | #define I2C_DRIVERID_CX25840 71 /* cx2584x video encoder */ |
63 | #define I2C_DRIVERID_SAA7127 72 /* saa7124 video encoder */ | 63 | #define I2C_DRIVERID_SAA7127 72 /* saa7127 video encoder */ |
64 | #define I2C_DRIVERID_SAA711X 73 /* saa711x video encoders */ | 64 | #define I2C_DRIVERID_SAA711X 73 /* saa711x video encoders */ |
65 | #define I2C_DRIVERID_AKITAIOEXP 74 /* IO Expander on Sharp SL-C1000 */ | 65 | #define I2C_DRIVERID_AKITAIOEXP 74 /* IO Expander on Sharp SL-C1000 */ |
66 | #define I2C_DRIVERID_INFRARED 75 /* I2C InfraRed on Video boards */ | 66 | #define I2C_DRIVERID_INFRARED 75 /* I2C InfraRed on Video boards */ |
diff --git a/include/linux/i2c/twl4030.h b/include/linux/i2c/twl4030.h new file mode 100644 index 000000000000..cdb453162a97 --- /dev/null +++ b/include/linux/i2c/twl4030.h | |||
@@ -0,0 +1,339 @@ | |||
1 | /* | ||
2 | * twl4030.h - header for TWL4030 PM and audio CODEC device | ||
3 | * | ||
4 | * Copyright (C) 2005-2006 Texas Instruments, Inc. | ||
5 | * | ||
6 | * Based on tlv320aic23.c: | ||
7 | * Copyright (c) by Kai Svahn <kai.svahn@nokia.com> | ||
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 of the License, or | ||
12 | * (at your option) 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
22 | * | ||
23 | */ | ||
24 | |||
25 | #ifndef __TWL4030_H_ | ||
26 | #define __TWL4030_H_ | ||
27 | |||
28 | /* | ||
29 | * Using the twl4030 core we address registers using a pair | ||
30 | * { module id, relative register offset } | ||
31 | * which that core then maps to the relevant | ||
32 | * { i2c slave, absolute register address } | ||
33 | * | ||
34 | * The module IDs are meaningful only to the twl4030 core code, | ||
35 | * which uses them as array indices to look up the first register | ||
36 | * address each module uses within a given i2c slave. | ||
37 | */ | ||
38 | |||
39 | /* Slave 0 (i2c address 0x48) */ | ||
40 | #define TWL4030_MODULE_USB 0x00 | ||
41 | |||
42 | /* Slave 1 (i2c address 0x49) */ | ||
43 | #define TWL4030_MODULE_AUDIO_VOICE 0x01 | ||
44 | #define TWL4030_MODULE_GPIO 0x02 | ||
45 | #define TWL4030_MODULE_INTBR 0x03 | ||
46 | #define TWL4030_MODULE_PIH 0x04 | ||
47 | #define TWL4030_MODULE_TEST 0x05 | ||
48 | |||
49 | /* Slave 2 (i2c address 0x4a) */ | ||
50 | #define TWL4030_MODULE_KEYPAD 0x06 | ||
51 | #define TWL4030_MODULE_MADC 0x07 | ||
52 | #define TWL4030_MODULE_INTERRUPTS 0x08 | ||
53 | #define TWL4030_MODULE_LED 0x09 | ||
54 | #define TWL4030_MODULE_MAIN_CHARGE 0x0A | ||
55 | #define TWL4030_MODULE_PRECHARGE 0x0B | ||
56 | #define TWL4030_MODULE_PWM0 0x0C | ||
57 | #define TWL4030_MODULE_PWM1 0x0D | ||
58 | #define TWL4030_MODULE_PWMA 0x0E | ||
59 | #define TWL4030_MODULE_PWMB 0x0F | ||
60 | |||
61 | /* Slave 3 (i2c address 0x4b) */ | ||
62 | #define TWL4030_MODULE_BACKUP 0x10 | ||
63 | #define TWL4030_MODULE_INT 0x11 | ||
64 | #define TWL4030_MODULE_PM_MASTER 0x12 | ||
65 | #define TWL4030_MODULE_PM_RECEIVER 0x13 | ||
66 | #define TWL4030_MODULE_RTC 0x14 | ||
67 | #define TWL4030_MODULE_SECURED_REG 0x15 | ||
68 | |||
69 | /* | ||
70 | * Read and write single 8-bit registers | ||
71 | */ | ||
72 | int twl4030_i2c_write_u8(u8 mod_no, u8 val, u8 reg); | ||
73 | int twl4030_i2c_read_u8(u8 mod_no, u8 *val, u8 reg); | ||
74 | |||
75 | /* | ||
76 | * Read and write several 8-bit registers at once. | ||
77 | * | ||
78 | * IMPORTANT: For twl4030_i2c_write(), allocate num_bytes + 1 | ||
79 | * for the value, and populate your data starting at offset 1. | ||
80 | */ | ||
81 | int twl4030_i2c_write(u8 mod_no, u8 *value, u8 reg, u8 num_bytes); | ||
82 | int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, u8 num_bytes); | ||
83 | |||
84 | /*----------------------------------------------------------------------*/ | ||
85 | |||
86 | /* | ||
87 | * NOTE: at up to 1024 registers, this is a big chip. | ||
88 | * | ||
89 | * Avoid putting register declarations in this file, instead of into | ||
90 | * a driver-private file, unless some of the registers in a block | ||
91 | * need to be shared with other drivers. One example is blocks that | ||
92 | * have Secondary IRQ Handler (SIH) registers. | ||
93 | */ | ||
94 | |||
95 | #define TWL4030_SIH_CTRL_EXCLEN_MASK BIT(0) | ||
96 | #define TWL4030_SIH_CTRL_PENDDIS_MASK BIT(1) | ||
97 | #define TWL4030_SIH_CTRL_COR_MASK BIT(2) | ||
98 | |||
99 | /*----------------------------------------------------------------------*/ | ||
100 | |||
101 | /* | ||
102 | * GPIO Block Register offsets (use TWL4030_MODULE_GPIO) | ||
103 | */ | ||
104 | |||
105 | #define REG_GPIODATAIN1 0x0 | ||
106 | #define REG_GPIODATAIN2 0x1 | ||
107 | #define REG_GPIODATAIN3 0x2 | ||
108 | #define REG_GPIODATADIR1 0x3 | ||
109 | #define REG_GPIODATADIR2 0x4 | ||
110 | #define REG_GPIODATADIR3 0x5 | ||
111 | #define REG_GPIODATAOUT1 0x6 | ||
112 | #define REG_GPIODATAOUT2 0x7 | ||
113 | #define REG_GPIODATAOUT3 0x8 | ||
114 | #define REG_CLEARGPIODATAOUT1 0x9 | ||
115 | #define REG_CLEARGPIODATAOUT2 0xA | ||
116 | #define REG_CLEARGPIODATAOUT3 0xB | ||
117 | #define REG_SETGPIODATAOUT1 0xC | ||
118 | #define REG_SETGPIODATAOUT2 0xD | ||
119 | #define REG_SETGPIODATAOUT3 0xE | ||
120 | #define REG_GPIO_DEBEN1 0xF | ||
121 | #define REG_GPIO_DEBEN2 0x10 | ||
122 | #define REG_GPIO_DEBEN3 0x11 | ||
123 | #define REG_GPIO_CTRL 0x12 | ||
124 | #define REG_GPIOPUPDCTR1 0x13 | ||
125 | #define REG_GPIOPUPDCTR2 0x14 | ||
126 | #define REG_GPIOPUPDCTR3 0x15 | ||
127 | #define REG_GPIOPUPDCTR4 0x16 | ||
128 | #define REG_GPIOPUPDCTR5 0x17 | ||
129 | #define REG_GPIO_ISR1A 0x19 | ||
130 | #define REG_GPIO_ISR2A 0x1A | ||
131 | #define REG_GPIO_ISR3A 0x1B | ||
132 | #define REG_GPIO_IMR1A 0x1C | ||
133 | #define REG_GPIO_IMR2A 0x1D | ||
134 | #define REG_GPIO_IMR3A 0x1E | ||
135 | #define REG_GPIO_ISR1B 0x1F | ||
136 | #define REG_GPIO_ISR2B 0x20 | ||
137 | #define REG_GPIO_ISR3B 0x21 | ||
138 | #define REG_GPIO_IMR1B 0x22 | ||
139 | #define REG_GPIO_IMR2B 0x23 | ||
140 | #define REG_GPIO_IMR3B 0x24 | ||
141 | #define REG_GPIO_EDR1 0x28 | ||
142 | #define REG_GPIO_EDR2 0x29 | ||
143 | #define REG_GPIO_EDR3 0x2A | ||
144 | #define REG_GPIO_EDR4 0x2B | ||
145 | #define REG_GPIO_EDR5 0x2C | ||
146 | #define REG_GPIO_SIH_CTRL 0x2D | ||
147 | |||
148 | /* Up to 18 signals are available as GPIOs, when their | ||
149 | * pins are not assigned to another use (such as ULPI/USB). | ||
150 | */ | ||
151 | #define TWL4030_GPIO_MAX 18 | ||
152 | |||
153 | /*----------------------------------------------------------------------*/ | ||
154 | |||
155 | /* | ||
156 | * Keypad register offsets (use TWL4030_MODULE_KEYPAD) | ||
157 | * ... SIH/interrupt only | ||
158 | */ | ||
159 | |||
160 | #define TWL4030_KEYPAD_KEYP_ISR1 0x11 | ||
161 | #define TWL4030_KEYPAD_KEYP_IMR1 0x12 | ||
162 | #define TWL4030_KEYPAD_KEYP_ISR2 0x13 | ||
163 | #define TWL4030_KEYPAD_KEYP_IMR2 0x14 | ||
164 | #define TWL4030_KEYPAD_KEYP_SIR 0x15 /* test register */ | ||
165 | #define TWL4030_KEYPAD_KEYP_EDR 0x16 | ||
166 | #define TWL4030_KEYPAD_KEYP_SIH_CTRL 0x17 | ||
167 | |||
168 | /*----------------------------------------------------------------------*/ | ||
169 | |||
170 | /* | ||
171 | * Multichannel ADC register offsets (use TWL4030_MODULE_MADC) | ||
172 | * ... SIH/interrupt only | ||
173 | */ | ||
174 | |||
175 | #define TWL4030_MADC_ISR1 0x61 | ||
176 | #define TWL4030_MADC_IMR1 0x62 | ||
177 | #define TWL4030_MADC_ISR2 0x63 | ||
178 | #define TWL4030_MADC_IMR2 0x64 | ||
179 | #define TWL4030_MADC_SIR 0x65 /* test register */ | ||
180 | #define TWL4030_MADC_EDR 0x66 | ||
181 | #define TWL4030_MADC_SIH_CTRL 0x67 | ||
182 | |||
183 | /*----------------------------------------------------------------------*/ | ||
184 | |||
185 | /* | ||
186 | * Battery charger register offsets (use TWL4030_MODULE_INTERRUPTS) | ||
187 | */ | ||
188 | |||
189 | #define TWL4030_INTERRUPTS_BCIISR1A 0x0 | ||
190 | #define TWL4030_INTERRUPTS_BCIISR2A 0x1 | ||
191 | #define TWL4030_INTERRUPTS_BCIIMR1A 0x2 | ||
192 | #define TWL4030_INTERRUPTS_BCIIMR2A 0x3 | ||
193 | #define TWL4030_INTERRUPTS_BCIISR1B 0x4 | ||
194 | #define TWL4030_INTERRUPTS_BCIISR2B 0x5 | ||
195 | #define TWL4030_INTERRUPTS_BCIIMR1B 0x6 | ||
196 | #define TWL4030_INTERRUPTS_BCIIMR2B 0x7 | ||
197 | #define TWL4030_INTERRUPTS_BCISIR1 0x8 /* test register */ | ||
198 | #define TWL4030_INTERRUPTS_BCISIR2 0x9 /* test register */ | ||
199 | #define TWL4030_INTERRUPTS_BCIEDR1 0xa | ||
200 | #define TWL4030_INTERRUPTS_BCIEDR2 0xb | ||
201 | #define TWL4030_INTERRUPTS_BCIEDR3 0xc | ||
202 | #define TWL4030_INTERRUPTS_BCISIHCTRL 0xd | ||
203 | |||
204 | /*----------------------------------------------------------------------*/ | ||
205 | |||
206 | /* | ||
207 | * Power Interrupt block register offsets (use TWL4030_MODULE_INT) | ||
208 | */ | ||
209 | |||
210 | #define TWL4030_INT_PWR_ISR1 0x0 | ||
211 | #define TWL4030_INT_PWR_IMR1 0x1 | ||
212 | #define TWL4030_INT_PWR_ISR2 0x2 | ||
213 | #define TWL4030_INT_PWR_IMR2 0x3 | ||
214 | #define TWL4030_INT_PWR_SIR 0x4 /* test register */ | ||
215 | #define TWL4030_INT_PWR_EDR1 0x5 | ||
216 | #define TWL4030_INT_PWR_EDR2 0x6 | ||
217 | #define TWL4030_INT_PWR_SIH_CTRL 0x7 | ||
218 | |||
219 | /*----------------------------------------------------------------------*/ | ||
220 | |||
221 | struct twl4030_bci_platform_data { | ||
222 | int *battery_tmp_tbl; | ||
223 | unsigned int tblsize; | ||
224 | }; | ||
225 | |||
226 | /* TWL4030_GPIO_MAX (18) GPIOs, with interrupts */ | ||
227 | struct twl4030_gpio_platform_data { | ||
228 | int gpio_base; | ||
229 | unsigned irq_base, irq_end; | ||
230 | |||
231 | /* For gpio-N, bit (1 << N) in "pullups" is set if that pullup | ||
232 | * should be enabled. Else, if that bit is set in "pulldowns", | ||
233 | * that pulldown is enabled. Don't waste power by letting any | ||
234 | * digital inputs float... | ||
235 | */ | ||
236 | u32 pullups; | ||
237 | u32 pulldowns; | ||
238 | |||
239 | int (*setup)(struct device *dev, | ||
240 | unsigned gpio, unsigned ngpio); | ||
241 | int (*teardown)(struct device *dev, | ||
242 | unsigned gpio, unsigned ngpio); | ||
243 | }; | ||
244 | |||
245 | struct twl4030_madc_platform_data { | ||
246 | int irq_line; | ||
247 | }; | ||
248 | |||
249 | struct twl4030_keypad_data { | ||
250 | int rows; | ||
251 | int cols; | ||
252 | int *keymap; | ||
253 | int irq; | ||
254 | unsigned int keymapsize; | ||
255 | unsigned int rep:1; | ||
256 | }; | ||
257 | |||
258 | enum twl4030_usb_mode { | ||
259 | T2_USB_MODE_ULPI = 1, | ||
260 | T2_USB_MODE_CEA2011_3PIN = 2, | ||
261 | }; | ||
262 | |||
263 | struct twl4030_usb_data { | ||
264 | enum twl4030_usb_mode usb_mode; | ||
265 | }; | ||
266 | |||
267 | struct twl4030_platform_data { | ||
268 | unsigned irq_base, irq_end; | ||
269 | struct twl4030_bci_platform_data *bci; | ||
270 | struct twl4030_gpio_platform_data *gpio; | ||
271 | struct twl4030_madc_platform_data *madc; | ||
272 | struct twl4030_keypad_data *keypad; | ||
273 | struct twl4030_usb_data *usb; | ||
274 | |||
275 | /* REVISIT more to come ... _nothing_ should be hard-wired */ | ||
276 | }; | ||
277 | |||
278 | /*----------------------------------------------------------------------*/ | ||
279 | |||
280 | /* | ||
281 | * FIXME completely stop using TWL4030_IRQ_BASE ... instead, pass the | ||
282 | * IRQ data to subsidiary devices using platform device resources. | ||
283 | */ | ||
284 | |||
285 | /* IRQ information-need base */ | ||
286 | #include <mach/irqs.h> | ||
287 | /* TWL4030 interrupts */ | ||
288 | |||
289 | /* #define TWL4030_MODIRQ_GPIO (TWL4030_IRQ_BASE + 0) */ | ||
290 | #define TWL4030_MODIRQ_KEYPAD (TWL4030_IRQ_BASE + 1) | ||
291 | #define TWL4030_MODIRQ_BCI (TWL4030_IRQ_BASE + 2) | ||
292 | #define TWL4030_MODIRQ_MADC (TWL4030_IRQ_BASE + 3) | ||
293 | /* #define TWL4030_MODIRQ_USB (TWL4030_IRQ_BASE + 4) */ | ||
294 | #define TWL4030_MODIRQ_PWR (TWL4030_IRQ_BASE + 5) | ||
295 | |||
296 | #define TWL4030_PWRIRQ_PWRBTN (TWL4030_PWR_IRQ_BASE + 0) | ||
297 | #define TWL4030_PWRIRQ_CHG_PRES (TWL4030_PWR_IRQ_BASE + 1) | ||
298 | #define TWL4030_PWRIRQ_USB_PRES (TWL4030_PWR_IRQ_BASE + 2) | ||
299 | #define TWL4030_PWRIRQ_RTC (TWL4030_PWR_IRQ_BASE + 3) | ||
300 | #define TWL4030_PWRIRQ_HOT_DIE (TWL4030_PWR_IRQ_BASE + 4) | ||
301 | #define TWL4030_PWRIRQ_PWROK_TIMEOUT (TWL4030_PWR_IRQ_BASE + 5) | ||
302 | #define TWL4030_PWRIRQ_MBCHG (TWL4030_PWR_IRQ_BASE + 6) | ||
303 | #define TWL4030_PWRIRQ_SC_DETECT (TWL4030_PWR_IRQ_BASE + 7) | ||
304 | |||
305 | /* Rest are unsued currently*/ | ||
306 | |||
307 | /* Offsets to Power Registers */ | ||
308 | #define TWL4030_VDAC_DEV_GRP 0x3B | ||
309 | #define TWL4030_VDAC_DEDICATED 0x3E | ||
310 | #define TWL4030_VAUX1_DEV_GRP 0x17 | ||
311 | #define TWL4030_VAUX1_DEDICATED 0x1A | ||
312 | #define TWL4030_VAUX2_DEV_GRP 0x1B | ||
313 | #define TWL4030_VAUX2_DEDICATED 0x1E | ||
314 | #define TWL4030_VAUX3_DEV_GRP 0x1F | ||
315 | #define TWL4030_VAUX3_DEDICATED 0x22 | ||
316 | |||
317 | /* TWL4030 GPIO interrupt definitions */ | ||
318 | |||
319 | #define TWL4030_GPIO_IRQ_NO(n) (TWL4030_GPIO_IRQ_BASE + (n)) | ||
320 | #define TWL4030_GPIO_IS_ENABLE 1 | ||
321 | |||
322 | /* | ||
323 | * Exported TWL4030 GPIO APIs | ||
324 | * | ||
325 | * WARNING -- use standard GPIO and IRQ calls instead; these will vanish. | ||
326 | */ | ||
327 | int twl4030_get_gpio_datain(int gpio); | ||
328 | int twl4030_request_gpio(int gpio); | ||
329 | int twl4030_set_gpio_debounce(int gpio, int enable); | ||
330 | int twl4030_free_gpio(int gpio); | ||
331 | |||
332 | #if defined(CONFIG_TWL4030_BCI_BATTERY) || \ | ||
333 | defined(CONFIG_TWL4030_BCI_BATTERY_MODULE) | ||
334 | extern int twl4030charger_usb_en(int enable); | ||
335 | #else | ||
336 | static inline int twl4030charger_usb_en(int enable) { return 0; } | ||
337 | #endif | ||
338 | |||
339 | #endif /* End of __TWL4030_H */ | ||
diff --git a/include/linux/i2o.h b/include/linux/i2o.h index 75ae6d8aba4f..4c4e57d1f19d 100644 --- a/include/linux/i2o.h +++ b/include/linux/i2o.h | |||
@@ -570,7 +570,6 @@ struct i2o_controller { | |||
570 | #endif | 570 | #endif |
571 | spinlock_t lock; /* lock for controller | 571 | spinlock_t lock; /* lock for controller |
572 | configuration */ | 572 | configuration */ |
573 | |||
574 | void *driver_data[I2O_MAX_DRIVERS]; /* storage for drivers */ | 573 | void *driver_data[I2O_MAX_DRIVERS]; /* storage for drivers */ |
575 | }; | 574 | }; |
576 | 575 | ||
@@ -691,289 +690,22 @@ static inline u32 i2o_dma_high(dma_addr_t dma_addr) | |||
691 | }; | 690 | }; |
692 | #endif | 691 | #endif |
693 | 692 | ||
694 | /** | 693 | extern u16 i2o_sg_tablesize(struct i2o_controller *c, u16 body_size); |
695 | * i2o_sg_tablesize - Calculate the maximum number of elements in a SGL | 694 | extern dma_addr_t i2o_dma_map_single(struct i2o_controller *c, void *ptr, |
696 | * @c: I2O controller for which the calculation should be done | ||
697 | * @body_size: maximum body size used for message in 32-bit words. | ||
698 | * | ||
699 | * Return the maximum number of SG elements in a SG list. | ||
700 | */ | ||
701 | static inline u16 i2o_sg_tablesize(struct i2o_controller *c, u16 body_size) | ||
702 | { | ||
703 | i2o_status_block *sb = c->status_block.virt; | ||
704 | u16 sg_count = | ||
705 | (sb->inbound_frame_size - sizeof(struct i2o_message) / 4) - | ||
706 | body_size; | ||
707 | |||
708 | if (c->pae_support) { | ||
709 | /* | ||
710 | * for 64-bit a SG attribute element must be added and each | ||
711 | * SG element needs 12 bytes instead of 8. | ||
712 | */ | ||
713 | sg_count -= 2; | ||
714 | sg_count /= 3; | ||
715 | } else | ||
716 | sg_count /= 2; | ||
717 | |||
718 | if (c->short_req && (sg_count > 8)) | ||
719 | sg_count = 8; | ||
720 | |||
721 | return sg_count; | ||
722 | }; | ||
723 | |||
724 | /** | ||
725 | * i2o_dma_map_single - Map pointer to controller and fill in I2O message. | ||
726 | * @c: I2O controller | ||
727 | * @ptr: pointer to the data which should be mapped | ||
728 | * @size: size of data in bytes | ||
729 | * @direction: DMA_TO_DEVICE / DMA_FROM_DEVICE | ||
730 | * @sg_ptr: pointer to the SG list inside the I2O message | ||
731 | * | ||
732 | * This function does all necessary DMA handling and also writes the I2O | ||
733 | * SGL elements into the I2O message. For details on DMA handling see also | ||
734 | * dma_map_single(). The pointer sg_ptr will only be set to the end of the | ||
735 | * SG list if the allocation was successful. | ||
736 | * | ||
737 | * Returns DMA address which must be checked for failures using | ||
738 | * dma_mapping_error(). | ||
739 | */ | ||
740 | static inline dma_addr_t i2o_dma_map_single(struct i2o_controller *c, void *ptr, | ||
741 | size_t size, | 695 | size_t size, |
742 | enum dma_data_direction direction, | 696 | enum dma_data_direction direction, |
743 | u32 ** sg_ptr) | 697 | u32 ** sg_ptr); |
744 | { | 698 | extern int i2o_dma_map_sg(struct i2o_controller *c, |
745 | u32 sg_flags; | ||
746 | u32 *mptr = *sg_ptr; | ||
747 | dma_addr_t dma_addr; | ||
748 | |||
749 | switch (direction) { | ||
750 | case DMA_TO_DEVICE: | ||
751 | sg_flags = 0xd4000000; | ||
752 | break; | ||
753 | case DMA_FROM_DEVICE: | ||
754 | sg_flags = 0xd0000000; | ||
755 | break; | ||
756 | default: | ||
757 | return 0; | ||
758 | } | ||
759 | |||
760 | dma_addr = dma_map_single(&c->pdev->dev, ptr, size, direction); | ||
761 | if (!dma_mapping_error(&c->pdev->dev, dma_addr)) { | ||
762 | #ifdef CONFIG_I2O_EXT_ADAPTEC_DMA64 | ||
763 | if ((sizeof(dma_addr_t) > 4) && c->pae_support) { | ||
764 | *mptr++ = cpu_to_le32(0x7C020002); | ||
765 | *mptr++ = cpu_to_le32(PAGE_SIZE); | ||
766 | } | ||
767 | #endif | ||
768 | |||
769 | *mptr++ = cpu_to_le32(sg_flags | size); | ||
770 | *mptr++ = cpu_to_le32(i2o_dma_low(dma_addr)); | ||
771 | #ifdef CONFIG_I2O_EXT_ADAPTEC_DMA64 | ||
772 | if ((sizeof(dma_addr_t) > 4) && c->pae_support) | ||
773 | *mptr++ = cpu_to_le32(i2o_dma_high(dma_addr)); | ||
774 | #endif | ||
775 | *sg_ptr = mptr; | ||
776 | } | ||
777 | return dma_addr; | ||
778 | }; | ||
779 | |||
780 | /** | ||
781 | * i2o_dma_map_sg - Map a SG List to controller and fill in I2O message. | ||
782 | * @c: I2O controller | ||
783 | * @sg: SG list to be mapped | ||
784 | * @sg_count: number of elements in the SG list | ||
785 | * @direction: DMA_TO_DEVICE / DMA_FROM_DEVICE | ||
786 | * @sg_ptr: pointer to the SG list inside the I2O message | ||
787 | * | ||
788 | * This function does all necessary DMA handling and also writes the I2O | ||
789 | * SGL elements into the I2O message. For details on DMA handling see also | ||
790 | * dma_map_sg(). The pointer sg_ptr will only be set to the end of the SG | ||
791 | * list if the allocation was successful. | ||
792 | * | ||
793 | * Returns 0 on failure or 1 on success. | ||
794 | */ | ||
795 | static inline int i2o_dma_map_sg(struct i2o_controller *c, | ||
796 | struct scatterlist *sg, int sg_count, | 699 | struct scatterlist *sg, int sg_count, |
797 | enum dma_data_direction direction, | 700 | enum dma_data_direction direction, |
798 | u32 ** sg_ptr) | 701 | u32 ** sg_ptr); |
799 | { | 702 | extern int i2o_dma_alloc(struct device *dev, struct i2o_dma *addr, size_t len); |
800 | u32 sg_flags; | 703 | extern void i2o_dma_free(struct device *dev, struct i2o_dma *addr); |
801 | u32 *mptr = *sg_ptr; | 704 | extern int i2o_dma_realloc(struct device *dev, struct i2o_dma *addr, |
802 | 705 | size_t len); | |
803 | switch (direction) { | 706 | extern int i2o_pool_alloc(struct i2o_pool *pool, const char *name, |
804 | case DMA_TO_DEVICE: | 707 | size_t size, int min_nr); |
805 | sg_flags = 0x14000000; | 708 | extern void i2o_pool_free(struct i2o_pool *pool); |
806 | break; | ||
807 | case DMA_FROM_DEVICE: | ||
808 | sg_flags = 0x10000000; | ||
809 | break; | ||
810 | default: | ||
811 | return 0; | ||
812 | } | ||
813 | |||
814 | sg_count = dma_map_sg(&c->pdev->dev, sg, sg_count, direction); | ||
815 | if (!sg_count) | ||
816 | return 0; | ||
817 | |||
818 | #ifdef CONFIG_I2O_EXT_ADAPTEC_DMA64 | ||
819 | if ((sizeof(dma_addr_t) > 4) && c->pae_support) { | ||
820 | *mptr++ = cpu_to_le32(0x7C020002); | ||
821 | *mptr++ = cpu_to_le32(PAGE_SIZE); | ||
822 | } | ||
823 | #endif | ||
824 | |||
825 | while (sg_count-- > 0) { | ||
826 | if (!sg_count) | ||
827 | sg_flags |= 0xC0000000; | ||
828 | *mptr++ = cpu_to_le32(sg_flags | sg_dma_len(sg)); | ||
829 | *mptr++ = cpu_to_le32(i2o_dma_low(sg_dma_address(sg))); | ||
830 | #ifdef CONFIG_I2O_EXT_ADAPTEC_DMA64 | ||
831 | if ((sizeof(dma_addr_t) > 4) && c->pae_support) | ||
832 | *mptr++ = cpu_to_le32(i2o_dma_high(sg_dma_address(sg))); | ||
833 | #endif | ||
834 | sg = sg_next(sg); | ||
835 | } | ||
836 | *sg_ptr = mptr; | ||
837 | |||
838 | return 1; | ||
839 | }; | ||
840 | |||
841 | /** | ||
842 | * i2o_dma_alloc - Allocate DMA memory | ||
843 | * @dev: struct device pointer to the PCI device of the I2O controller | ||
844 | * @addr: i2o_dma struct which should get the DMA buffer | ||
845 | * @len: length of the new DMA memory | ||
846 | * @gfp_mask: GFP mask | ||
847 | * | ||
848 | * Allocate a coherent DMA memory and write the pointers into addr. | ||
849 | * | ||
850 | * Returns 0 on success or -ENOMEM on failure. | ||
851 | */ | ||
852 | static inline int i2o_dma_alloc(struct device *dev, struct i2o_dma *addr, | ||
853 | size_t len, gfp_t gfp_mask) | ||
854 | { | ||
855 | struct pci_dev *pdev = to_pci_dev(dev); | ||
856 | int dma_64 = 0; | ||
857 | |||
858 | if ((sizeof(dma_addr_t) > 4) && (pdev->dma_mask == DMA_64BIT_MASK)) { | ||
859 | dma_64 = 1; | ||
860 | if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) | ||
861 | return -ENOMEM; | ||
862 | } | ||
863 | |||
864 | addr->virt = dma_alloc_coherent(dev, len, &addr->phys, gfp_mask); | ||
865 | |||
866 | if ((sizeof(dma_addr_t) > 4) && dma_64) | ||
867 | if (pci_set_dma_mask(pdev, DMA_64BIT_MASK)) | ||
868 | printk(KERN_WARNING "i2o: unable to set 64-bit DMA"); | ||
869 | |||
870 | if (!addr->virt) | ||
871 | return -ENOMEM; | ||
872 | |||
873 | memset(addr->virt, 0, len); | ||
874 | addr->len = len; | ||
875 | |||
876 | return 0; | ||
877 | }; | ||
878 | |||
879 | /** | ||
880 | * i2o_dma_free - Free DMA memory | ||
881 | * @dev: struct device pointer to the PCI device of the I2O controller | ||
882 | * @addr: i2o_dma struct which contains the DMA buffer | ||
883 | * | ||
884 | * Free a coherent DMA memory and set virtual address of addr to NULL. | ||
885 | */ | ||
886 | static inline void i2o_dma_free(struct device *dev, struct i2o_dma *addr) | ||
887 | { | ||
888 | if (addr->virt) { | ||
889 | if (addr->phys) | ||
890 | dma_free_coherent(dev, addr->len, addr->virt, | ||
891 | addr->phys); | ||
892 | else | ||
893 | kfree(addr->virt); | ||
894 | addr->virt = NULL; | ||
895 | } | ||
896 | }; | ||
897 | |||
898 | /** | ||
899 | * i2o_dma_realloc - Realloc DMA memory | ||
900 | * @dev: struct device pointer to the PCI device of the I2O controller | ||
901 | * @addr: pointer to a i2o_dma struct DMA buffer | ||
902 | * @len: new length of memory | ||
903 | * @gfp_mask: GFP mask | ||
904 | * | ||
905 | * If there was something allocated in the addr, free it first. If len > 0 | ||
906 | * than try to allocate it and write the addresses back to the addr | ||
907 | * structure. If len == 0 set the virtual address to NULL. | ||
908 | * | ||
909 | * Returns the 0 on success or negative error code on failure. | ||
910 | */ | ||
911 | static inline int i2o_dma_realloc(struct device *dev, struct i2o_dma *addr, | ||
912 | size_t len, gfp_t gfp_mask) | ||
913 | { | ||
914 | i2o_dma_free(dev, addr); | ||
915 | |||
916 | if (len) | ||
917 | return i2o_dma_alloc(dev, addr, len, gfp_mask); | ||
918 | |||
919 | return 0; | ||
920 | }; | ||
921 | |||
922 | /* | ||
923 | * i2o_pool_alloc - Allocate an slab cache and mempool | ||
924 | * @mempool: pointer to struct i2o_pool to write data into. | ||
925 | * @name: name which is used to identify cache | ||
926 | * @size: size of each object | ||
927 | * @min_nr: minimum number of objects | ||
928 | * | ||
929 | * First allocates a slab cache with name and size. Then allocates a | ||
930 | * mempool which uses the slab cache for allocation and freeing. | ||
931 | * | ||
932 | * Returns 0 on success or negative error code on failure. | ||
933 | */ | ||
934 | static inline int i2o_pool_alloc(struct i2o_pool *pool, const char *name, | ||
935 | size_t size, int min_nr) | ||
936 | { | ||
937 | pool->name = kmalloc(strlen(name) + 1, GFP_KERNEL); | ||
938 | if (!pool->name) | ||
939 | goto exit; | ||
940 | strcpy(pool->name, name); | ||
941 | |||
942 | pool->slab = | ||
943 | kmem_cache_create(pool->name, size, 0, SLAB_HWCACHE_ALIGN, NULL); | ||
944 | if (!pool->slab) | ||
945 | goto free_name; | ||
946 | |||
947 | pool->mempool = mempool_create_slab_pool(min_nr, pool->slab); | ||
948 | if (!pool->mempool) | ||
949 | goto free_slab; | ||
950 | |||
951 | return 0; | ||
952 | |||
953 | free_slab: | ||
954 | kmem_cache_destroy(pool->slab); | ||
955 | |||
956 | free_name: | ||
957 | kfree(pool->name); | ||
958 | |||
959 | exit: | ||
960 | return -ENOMEM; | ||
961 | }; | ||
962 | |||
963 | /* | ||
964 | * i2o_pool_free - Free slab cache and mempool again | ||
965 | * @mempool: pointer to struct i2o_pool which should be freed | ||
966 | * | ||
967 | * Note that you have to return all objects to the mempool again before | ||
968 | * calling i2o_pool_free(). | ||
969 | */ | ||
970 | static inline void i2o_pool_free(struct i2o_pool *pool) | ||
971 | { | ||
972 | mempool_destroy(pool->mempool); | ||
973 | kmem_cache_destroy(pool->slab); | ||
974 | kfree(pool->name); | ||
975 | }; | ||
976 | |||
977 | /* I2O driver (OSM) functions */ | 709 | /* I2O driver (OSM) functions */ |
978 | extern int i2o_driver_register(struct i2o_driver *); | 710 | extern int i2o_driver_register(struct i2o_driver *); |
979 | extern void i2o_driver_unregister(struct i2o_driver *); | 711 | extern void i2o_driver_unregister(struct i2o_driver *); |
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h index 03067443198a..a93a8dd33118 100644 --- a/include/linux/icmpv6.h +++ b/include/linux/icmpv6.h | |||
@@ -40,16 +40,18 @@ struct icmp6hdr { | |||
40 | struct icmpv6_nd_ra { | 40 | struct icmpv6_nd_ra { |
41 | __u8 hop_limit; | 41 | __u8 hop_limit; |
42 | #if defined(__LITTLE_ENDIAN_BITFIELD) | 42 | #if defined(__LITTLE_ENDIAN_BITFIELD) |
43 | __u8 reserved:4, | 43 | __u8 reserved:3, |
44 | router_pref:2, | 44 | router_pref:2, |
45 | home_agent:1, | ||
45 | other:1, | 46 | other:1, |
46 | managed:1; | 47 | managed:1; |
47 | 48 | ||
48 | #elif defined(__BIG_ENDIAN_BITFIELD) | 49 | #elif defined(__BIG_ENDIAN_BITFIELD) |
49 | __u8 managed:1, | 50 | __u8 managed:1, |
50 | other:1, | 51 | other:1, |
52 | home_agent:1, | ||
51 | router_pref:2, | 53 | router_pref:2, |
52 | reserved:4; | 54 | reserved:3; |
53 | #else | 55 | #else |
54 | #error "Please fix <asm/byteorder.h>" | 56 | #error "Please fix <asm/byteorder.h>" |
55 | #endif | 57 | #endif |
diff --git a/include/linux/init.h b/include/linux/init.h index 93538b696e3d..ad63824460e3 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -233,9 +233,6 @@ struct obs_kernel_param { | |||
233 | __attribute__((aligned((sizeof(long))))) \ | 233 | __attribute__((aligned((sizeof(long))))) \ |
234 | = { __setup_str_##unique_id, fn, early } | 234 | = { __setup_str_##unique_id, fn, early } |
235 | 235 | ||
236 | #define __setup_null_param(str, unique_id) \ | ||
237 | __setup_param(str, unique_id, NULL, 0) | ||
238 | |||
239 | #define __setup(str, fn) \ | 236 | #define __setup(str, fn) \ |
240 | __setup_param(str, fn, fn, 0) | 237 | __setup_param(str, fn, fn, 0) |
241 | 238 | ||
@@ -296,7 +293,6 @@ void __init parse_early_param(void); | |||
296 | void cleanup_module(void) __attribute__((alias(#exitfn))); | 293 | void cleanup_module(void) __attribute__((alias(#exitfn))); |
297 | 294 | ||
298 | #define __setup_param(str, unique_id, fn) /* nothing */ | 295 | #define __setup_param(str, unique_id, fn) /* nothing */ |
299 | #define __setup_null_param(str, unique_id) /* nothing */ | ||
300 | #define __setup(str, func) /* nothing */ | 296 | #define __setup(str, func) /* nothing */ |
301 | #endif | 297 | #endif |
302 | 298 | ||
diff --git a/include/linux/input.h b/include/linux/input.h index a5802c9c81a4..b86fb5581ce6 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -577,9 +577,22 @@ struct input_absinfo { | |||
577 | #define KEY_BRL_DOT9 0x1f9 | 577 | #define KEY_BRL_DOT9 0x1f9 |
578 | #define KEY_BRL_DOT10 0x1fa | 578 | #define KEY_BRL_DOT10 0x1fa |
579 | 579 | ||
580 | #define KEY_NUMERIC_0 0x200 /* used by phones, remote controls, */ | ||
581 | #define KEY_NUMERIC_1 0x201 /* and other keypads */ | ||
582 | #define KEY_NUMERIC_2 0x202 | ||
583 | #define KEY_NUMERIC_3 0x203 | ||
584 | #define KEY_NUMERIC_4 0x204 | ||
585 | #define KEY_NUMERIC_5 0x205 | ||
586 | #define KEY_NUMERIC_6 0x206 | ||
587 | #define KEY_NUMERIC_7 0x207 | ||
588 | #define KEY_NUMERIC_8 0x208 | ||
589 | #define KEY_NUMERIC_9 0x209 | ||
590 | #define KEY_NUMERIC_STAR 0x20a | ||
591 | #define KEY_NUMERIC_POUND 0x20b | ||
592 | |||
580 | /* We avoid low common keys in module aliases so they don't get huge. */ | 593 | /* We avoid low common keys in module aliases so they don't get huge. */ |
581 | #define KEY_MIN_INTERESTING KEY_MUTE | 594 | #define KEY_MIN_INTERESTING KEY_MUTE |
582 | #define KEY_MAX 0x1ff | 595 | #define KEY_MAX 0x2ff |
583 | #define KEY_CNT (KEY_MAX+1) | 596 | #define KEY_CNT (KEY_MAX+1) |
584 | 597 | ||
585 | /* | 598 | /* |
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h new file mode 100644 index 000000000000..2e117f30a76c --- /dev/null +++ b/include/linux/intel-iommu.h | |||
@@ -0,0 +1,327 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2006, Intel Corporation. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License along with | ||
14 | * this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
15 | * Place - Suite 330, Boston, MA 02111-1307 USA. | ||
16 | * | ||
17 | * Copyright (C) 2006-2008 Intel Corporation | ||
18 | * Author: Ashok Raj <ashok.raj@intel.com> | ||
19 | * Author: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com> | ||
20 | */ | ||
21 | |||
22 | #ifndef _INTEL_IOMMU_H_ | ||
23 | #define _INTEL_IOMMU_H_ | ||
24 | |||
25 | #include <linux/types.h> | ||
26 | #include <linux/msi.h> | ||
27 | #include <linux/sysdev.h> | ||
28 | #include <linux/iova.h> | ||
29 | #include <linux/io.h> | ||
30 | #include <linux/dma_remapping.h> | ||
31 | #include <asm/cacheflush.h> | ||
32 | |||
33 | /* | ||
34 | * Intel IOMMU register specification per version 1.0 public spec. | ||
35 | */ | ||
36 | |||
37 | #define DMAR_VER_REG 0x0 /* Arch version supported by this IOMMU */ | ||
38 | #define DMAR_CAP_REG 0x8 /* Hardware supported capabilities */ | ||
39 | #define DMAR_ECAP_REG 0x10 /* Extended capabilities supported */ | ||
40 | #define DMAR_GCMD_REG 0x18 /* Global command register */ | ||
41 | #define DMAR_GSTS_REG 0x1c /* Global status register */ | ||
42 | #define DMAR_RTADDR_REG 0x20 /* Root entry table */ | ||
43 | #define DMAR_CCMD_REG 0x28 /* Context command reg */ | ||
44 | #define DMAR_FSTS_REG 0x34 /* Fault Status register */ | ||
45 | #define DMAR_FECTL_REG 0x38 /* Fault control register */ | ||
46 | #define DMAR_FEDATA_REG 0x3c /* Fault event interrupt data register */ | ||
47 | #define DMAR_FEADDR_REG 0x40 /* Fault event interrupt addr register */ | ||
48 | #define DMAR_FEUADDR_REG 0x44 /* Upper address register */ | ||
49 | #define DMAR_AFLOG_REG 0x58 /* Advanced Fault control */ | ||
50 | #define DMAR_PMEN_REG 0x64 /* Enable Protected Memory Region */ | ||
51 | #define DMAR_PLMBASE_REG 0x68 /* PMRR Low addr */ | ||
52 | #define DMAR_PLMLIMIT_REG 0x6c /* PMRR low limit */ | ||
53 | #define DMAR_PHMBASE_REG 0x70 /* pmrr high base addr */ | ||
54 | #define DMAR_PHMLIMIT_REG 0x78 /* pmrr high limit */ | ||
55 | #define DMAR_IQH_REG 0x80 /* Invalidation queue head register */ | ||
56 | #define DMAR_IQT_REG 0x88 /* Invalidation queue tail register */ | ||
57 | #define DMAR_IQA_REG 0x90 /* Invalidation queue addr register */ | ||
58 | #define DMAR_ICS_REG 0x98 /* Invalidation complete status register */ | ||
59 | #define DMAR_IRTA_REG 0xb8 /* Interrupt remapping table addr register */ | ||
60 | |||
61 | #define OFFSET_STRIDE (9) | ||
62 | /* | ||
63 | #define dmar_readl(dmar, reg) readl(dmar + reg) | ||
64 | #define dmar_readq(dmar, reg) ({ \ | ||
65 | u32 lo, hi; \ | ||
66 | lo = readl(dmar + reg); \ | ||
67 | hi = readl(dmar + reg + 4); \ | ||
68 | (((u64) hi) << 32) + lo; }) | ||
69 | */ | ||
70 | static inline u64 dmar_readq(void __iomem *addr) | ||
71 | { | ||
72 | u32 lo, hi; | ||
73 | lo = readl(addr); | ||
74 | hi = readl(addr + 4); | ||
75 | return (((u64) hi) << 32) + lo; | ||
76 | } | ||
77 | |||
78 | static inline void dmar_writeq(void __iomem *addr, u64 val) | ||
79 | { | ||
80 | writel((u32)val, addr); | ||
81 | writel((u32)(val >> 32), addr + 4); | ||
82 | } | ||
83 | |||
84 | #define DMAR_VER_MAJOR(v) (((v) & 0xf0) >> 4) | ||
85 | #define DMAR_VER_MINOR(v) ((v) & 0x0f) | ||
86 | |||
87 | /* | ||
88 | * Decoding Capability Register | ||
89 | */ | ||
90 | #define cap_read_drain(c) (((c) >> 55) & 1) | ||
91 | #define cap_write_drain(c) (((c) >> 54) & 1) | ||
92 | #define cap_max_amask_val(c) (((c) >> 48) & 0x3f) | ||
93 | #define cap_num_fault_regs(c) ((((c) >> 40) & 0xff) + 1) | ||
94 | #define cap_pgsel_inv(c) (((c) >> 39) & 1) | ||
95 | |||
96 | #define cap_super_page_val(c) (((c) >> 34) & 0xf) | ||
97 | #define cap_super_offset(c) (((find_first_bit(&cap_super_page_val(c), 4)) \ | ||
98 | * OFFSET_STRIDE) + 21) | ||
99 | |||
100 | #define cap_fault_reg_offset(c) ((((c) >> 24) & 0x3ff) * 16) | ||
101 | #define cap_max_fault_reg_offset(c) \ | ||
102 | (cap_fault_reg_offset(c) + cap_num_fault_regs(c) * 16) | ||
103 | |||
104 | #define cap_zlr(c) (((c) >> 22) & 1) | ||
105 | #define cap_isoch(c) (((c) >> 23) & 1) | ||
106 | #define cap_mgaw(c) ((((c) >> 16) & 0x3f) + 1) | ||
107 | #define cap_sagaw(c) (((c) >> 8) & 0x1f) | ||
108 | #define cap_caching_mode(c) (((c) >> 7) & 1) | ||
109 | #define cap_phmr(c) (((c) >> 6) & 1) | ||
110 | #define cap_plmr(c) (((c) >> 5) & 1) | ||
111 | #define cap_rwbf(c) (((c) >> 4) & 1) | ||
112 | #define cap_afl(c) (((c) >> 3) & 1) | ||
113 | #define cap_ndoms(c) (((unsigned long)1) << (4 + 2 * ((c) & 0x7))) | ||
114 | /* | ||
115 | * Extended Capability Register | ||
116 | */ | ||
117 | |||
118 | #define ecap_niotlb_iunits(e) ((((e) >> 24) & 0xff) + 1) | ||
119 | #define ecap_iotlb_offset(e) ((((e) >> 8) & 0x3ff) * 16) | ||
120 | #define ecap_max_iotlb_offset(e) \ | ||
121 | (ecap_iotlb_offset(e) + ecap_niotlb_iunits(e) * 16) | ||
122 | #define ecap_coherent(e) ((e) & 0x1) | ||
123 | #define ecap_qis(e) ((e) & 0x2) | ||
124 | #define ecap_eim_support(e) ((e >> 4) & 0x1) | ||
125 | #define ecap_ir_support(e) ((e >> 3) & 0x1) | ||
126 | #define ecap_max_handle_mask(e) ((e >> 20) & 0xf) | ||
127 | |||
128 | |||
129 | /* IOTLB_REG */ | ||
130 | #define DMA_TLB_GLOBAL_FLUSH (((u64)1) << 60) | ||
131 | #define DMA_TLB_DSI_FLUSH (((u64)2) << 60) | ||
132 | #define DMA_TLB_PSI_FLUSH (((u64)3) << 60) | ||
133 | #define DMA_TLB_IIRG(type) ((type >> 60) & 7) | ||
134 | #define DMA_TLB_IAIG(val) (((val) >> 57) & 7) | ||
135 | #define DMA_TLB_READ_DRAIN (((u64)1) << 49) | ||
136 | #define DMA_TLB_WRITE_DRAIN (((u64)1) << 48) | ||
137 | #define DMA_TLB_DID(id) (((u64)((id) & 0xffff)) << 32) | ||
138 | #define DMA_TLB_IVT (((u64)1) << 63) | ||
139 | #define DMA_TLB_IH_NONLEAF (((u64)1) << 6) | ||
140 | #define DMA_TLB_MAX_SIZE (0x3f) | ||
141 | |||
142 | /* INVALID_DESC */ | ||
143 | #define DMA_ID_TLB_GLOBAL_FLUSH (((u64)1) << 3) | ||
144 | #define DMA_ID_TLB_DSI_FLUSH (((u64)2) << 3) | ||
145 | #define DMA_ID_TLB_PSI_FLUSH (((u64)3) << 3) | ||
146 | #define DMA_ID_TLB_READ_DRAIN (((u64)1) << 7) | ||
147 | #define DMA_ID_TLB_WRITE_DRAIN (((u64)1) << 6) | ||
148 | #define DMA_ID_TLB_DID(id) (((u64)((id & 0xffff) << 16))) | ||
149 | #define DMA_ID_TLB_IH_NONLEAF (((u64)1) << 6) | ||
150 | #define DMA_ID_TLB_ADDR(addr) (addr) | ||
151 | #define DMA_ID_TLB_ADDR_MASK(mask) (mask) | ||
152 | |||
153 | /* PMEN_REG */ | ||
154 | #define DMA_PMEN_EPM (((u32)1)<<31) | ||
155 | #define DMA_PMEN_PRS (((u32)1)<<0) | ||
156 | |||
157 | /* GCMD_REG */ | ||
158 | #define DMA_GCMD_TE (((u32)1) << 31) | ||
159 | #define DMA_GCMD_SRTP (((u32)1) << 30) | ||
160 | #define DMA_GCMD_SFL (((u32)1) << 29) | ||
161 | #define DMA_GCMD_EAFL (((u32)1) << 28) | ||
162 | #define DMA_GCMD_WBF (((u32)1) << 27) | ||
163 | #define DMA_GCMD_QIE (((u32)1) << 26) | ||
164 | #define DMA_GCMD_SIRTP (((u32)1) << 24) | ||
165 | #define DMA_GCMD_IRE (((u32) 1) << 25) | ||
166 | |||
167 | /* GSTS_REG */ | ||
168 | #define DMA_GSTS_TES (((u32)1) << 31) | ||
169 | #define DMA_GSTS_RTPS (((u32)1) << 30) | ||
170 | #define DMA_GSTS_FLS (((u32)1) << 29) | ||
171 | #define DMA_GSTS_AFLS (((u32)1) << 28) | ||
172 | #define DMA_GSTS_WBFS (((u32)1) << 27) | ||
173 | #define DMA_GSTS_QIES (((u32)1) << 26) | ||
174 | #define DMA_GSTS_IRTPS (((u32)1) << 24) | ||
175 | #define DMA_GSTS_IRES (((u32)1) << 25) | ||
176 | |||
177 | /* CCMD_REG */ | ||
178 | #define DMA_CCMD_ICC (((u64)1) << 63) | ||
179 | #define DMA_CCMD_GLOBAL_INVL (((u64)1) << 61) | ||
180 | #define DMA_CCMD_DOMAIN_INVL (((u64)2) << 61) | ||
181 | #define DMA_CCMD_DEVICE_INVL (((u64)3) << 61) | ||
182 | #define DMA_CCMD_FM(m) (((u64)((m) & 0x3)) << 32) | ||
183 | #define DMA_CCMD_MASK_NOBIT 0 | ||
184 | #define DMA_CCMD_MASK_1BIT 1 | ||
185 | #define DMA_CCMD_MASK_2BIT 2 | ||
186 | #define DMA_CCMD_MASK_3BIT 3 | ||
187 | #define DMA_CCMD_SID(s) (((u64)((s) & 0xffff)) << 16) | ||
188 | #define DMA_CCMD_DID(d) ((u64)((d) & 0xffff)) | ||
189 | |||
190 | /* FECTL_REG */ | ||
191 | #define DMA_FECTL_IM (((u32)1) << 31) | ||
192 | |||
193 | /* FSTS_REG */ | ||
194 | #define DMA_FSTS_PPF ((u32)2) | ||
195 | #define DMA_FSTS_PFO ((u32)1) | ||
196 | #define dma_fsts_fault_record_index(s) (((s) >> 8) & 0xff) | ||
197 | |||
198 | /* FRCD_REG, 32 bits access */ | ||
199 | #define DMA_FRCD_F (((u32)1) << 31) | ||
200 | #define dma_frcd_type(d) ((d >> 30) & 1) | ||
201 | #define dma_frcd_fault_reason(c) (c & 0xff) | ||
202 | #define dma_frcd_source_id(c) (c & 0xffff) | ||
203 | #define dma_frcd_page_addr(d) (d & (((u64)-1) << 12)) /* low 64 bit */ | ||
204 | |||
205 | #define DMAR_OPERATION_TIMEOUT ((cycles_t) tsc_khz*10*1000) /* 10sec */ | ||
206 | |||
207 | #define IOMMU_WAIT_OP(iommu, offset, op, cond, sts) \ | ||
208 | {\ | ||
209 | cycles_t start_time = get_cycles();\ | ||
210 | while (1) {\ | ||
211 | sts = op (iommu->reg + offset);\ | ||
212 | if (cond)\ | ||
213 | break;\ | ||
214 | if (DMAR_OPERATION_TIMEOUT < (get_cycles() - start_time))\ | ||
215 | panic("DMAR hardware is malfunctioning\n");\ | ||
216 | cpu_relax();\ | ||
217 | }\ | ||
218 | } | ||
219 | |||
220 | #define QI_LENGTH 256 /* queue length */ | ||
221 | |||
222 | enum { | ||
223 | QI_FREE, | ||
224 | QI_IN_USE, | ||
225 | QI_DONE | ||
226 | }; | ||
227 | |||
228 | #define QI_CC_TYPE 0x1 | ||
229 | #define QI_IOTLB_TYPE 0x2 | ||
230 | #define QI_DIOTLB_TYPE 0x3 | ||
231 | #define QI_IEC_TYPE 0x4 | ||
232 | #define QI_IWD_TYPE 0x5 | ||
233 | |||
234 | #define QI_IEC_SELECTIVE (((u64)1) << 4) | ||
235 | #define QI_IEC_IIDEX(idx) (((u64)(idx & 0xffff) << 32)) | ||
236 | #define QI_IEC_IM(m) (((u64)(m & 0x1f) << 27)) | ||
237 | |||
238 | #define QI_IWD_STATUS_DATA(d) (((u64)d) << 32) | ||
239 | #define QI_IWD_STATUS_WRITE (((u64)1) << 5) | ||
240 | |||
241 | struct qi_desc { | ||
242 | u64 low, high; | ||
243 | }; | ||
244 | |||
245 | struct q_inval { | ||
246 | spinlock_t q_lock; | ||
247 | struct qi_desc *desc; /* invalidation queue */ | ||
248 | int *desc_status; /* desc status */ | ||
249 | int free_head; /* first free entry */ | ||
250 | int free_tail; /* last free entry */ | ||
251 | int free_cnt; | ||
252 | }; | ||
253 | |||
254 | #ifdef CONFIG_INTR_REMAP | ||
255 | /* 1MB - maximum possible interrupt remapping table size */ | ||
256 | #define INTR_REMAP_PAGE_ORDER 8 | ||
257 | #define INTR_REMAP_TABLE_REG_SIZE 0xf | ||
258 | |||
259 | #define INTR_REMAP_TABLE_ENTRIES 65536 | ||
260 | |||
261 | struct ir_table { | ||
262 | struct irte *base; | ||
263 | }; | ||
264 | #endif | ||
265 | |||
266 | struct intel_iommu { | ||
267 | void __iomem *reg; /* Pointer to hardware regs, virtual addr */ | ||
268 | u64 cap; | ||
269 | u64 ecap; | ||
270 | int seg; | ||
271 | u32 gcmd; /* Holds TE, EAFL. Don't need SRTP, SFL, WBF */ | ||
272 | spinlock_t register_lock; /* protect register handling */ | ||
273 | int seq_id; /* sequence id of the iommu */ | ||
274 | |||
275 | #ifdef CONFIG_DMAR | ||
276 | unsigned long *domain_ids; /* bitmap of domains */ | ||
277 | struct dmar_domain **domains; /* ptr to domains */ | ||
278 | spinlock_t lock; /* protect context, domain ids */ | ||
279 | struct root_entry *root_entry; /* virtual address */ | ||
280 | |||
281 | unsigned int irq; | ||
282 | unsigned char name[7]; /* Device Name */ | ||
283 | struct msi_msg saved_msg; | ||
284 | struct sys_device sysdev; | ||
285 | #endif | ||
286 | struct q_inval *qi; /* Queued invalidation info */ | ||
287 | #ifdef CONFIG_INTR_REMAP | ||
288 | struct ir_table *ir_table; /* Interrupt remapping info */ | ||
289 | #endif | ||
290 | }; | ||
291 | |||
292 | static inline void __iommu_flush_cache( | ||
293 | struct intel_iommu *iommu, void *addr, int size) | ||
294 | { | ||
295 | if (!ecap_coherent(iommu->ecap)) | ||
296 | clflush_cache_range(addr, size); | ||
297 | } | ||
298 | |||
299 | extern struct dmar_drhd_unit * dmar_find_matched_drhd_unit(struct pci_dev *dev); | ||
300 | |||
301 | extern int alloc_iommu(struct dmar_drhd_unit *drhd); | ||
302 | extern void free_iommu(struct intel_iommu *iommu); | ||
303 | extern int dmar_enable_qi(struct intel_iommu *iommu); | ||
304 | extern void qi_global_iec(struct intel_iommu *iommu); | ||
305 | |||
306 | extern void qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu); | ||
307 | |||
308 | void intel_iommu_domain_exit(struct dmar_domain *domain); | ||
309 | struct dmar_domain *intel_iommu_domain_alloc(struct pci_dev *pdev); | ||
310 | int intel_iommu_context_mapping(struct dmar_domain *domain, | ||
311 | struct pci_dev *pdev); | ||
312 | int intel_iommu_page_mapping(struct dmar_domain *domain, dma_addr_t iova, | ||
313 | u64 hpa, size_t size, int prot); | ||
314 | void intel_iommu_detach_dev(struct dmar_domain *domain, u8 bus, u8 devfn); | ||
315 | struct dmar_domain *intel_iommu_find_domain(struct pci_dev *pdev); | ||
316 | u64 intel_iommu_iova_to_pfn(struct dmar_domain *domain, u64 iova); | ||
317 | |||
318 | #ifdef CONFIG_DMAR | ||
319 | int intel_iommu_found(void); | ||
320 | #else /* CONFIG_DMAR */ | ||
321 | static inline int intel_iommu_found(void) | ||
322 | { | ||
323 | return 0; | ||
324 | } | ||
325 | #endif /* CONFIG_DMAR */ | ||
326 | |||
327 | #endif | ||
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 58ff4e74b2f3..35a61dc60d51 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #include <linux/hardirq.h> | 11 | #include <linux/hardirq.h> |
12 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
13 | #include <linux/irqflags.h> | 13 | #include <linux/irqflags.h> |
14 | #include <linux/smp.h> | ||
15 | #include <linux/percpu.h> | ||
14 | #include <asm/atomic.h> | 16 | #include <asm/atomic.h> |
15 | #include <asm/ptrace.h> | 17 | #include <asm/ptrace.h> |
16 | #include <asm/system.h> | 18 | #include <asm/system.h> |
@@ -252,6 +254,8 @@ enum | |||
252 | HRTIMER_SOFTIRQ, | 254 | HRTIMER_SOFTIRQ, |
253 | #endif | 255 | #endif |
254 | RCU_SOFTIRQ, /* Preferable RCU should always be the last softirq */ | 256 | RCU_SOFTIRQ, /* Preferable RCU should always be the last softirq */ |
257 | |||
258 | NR_SOFTIRQS | ||
255 | }; | 259 | }; |
256 | 260 | ||
257 | /* softirq mask and active fields moved to irq_cpustat_t in | 261 | /* softirq mask and active fields moved to irq_cpustat_t in |
@@ -271,6 +275,25 @@ extern void softirq_init(void); | |||
271 | extern void raise_softirq_irqoff(unsigned int nr); | 275 | extern void raise_softirq_irqoff(unsigned int nr); |
272 | extern void raise_softirq(unsigned int nr); | 276 | extern void raise_softirq(unsigned int nr); |
273 | 277 | ||
278 | /* This is the worklist that queues up per-cpu softirq work. | ||
279 | * | ||
280 | * send_remote_sendirq() adds work to these lists, and | ||
281 | * the softirq handler itself dequeues from them. The queues | ||
282 | * are protected by disabling local cpu interrupts and they must | ||
283 | * only be accessed by the local cpu that they are for. | ||
284 | */ | ||
285 | DECLARE_PER_CPU(struct list_head [NR_SOFTIRQS], softirq_work_list); | ||
286 | |||
287 | /* Try to send a softirq to a remote cpu. If this cannot be done, the | ||
288 | * work will be queued to the local cpu. | ||
289 | */ | ||
290 | extern void send_remote_softirq(struct call_single_data *cp, int cpu, int softirq); | ||
291 | |||
292 | /* Like send_remote_softirq(), but the caller must disable local cpu interrupts | ||
293 | * and compute the current cpu, passed in as 'this_cpu'. | ||
294 | */ | ||
295 | extern void __send_remote_softirq(struct call_single_data *cp, int cpu, | ||
296 | int this_cpu, int softirq); | ||
274 | 297 | ||
275 | /* Tasklets --- multithreaded analogue of BHs. | 298 | /* Tasklets --- multithreaded analogue of BHs. |
276 | 299 | ||
diff --git a/include/linux/iommu-helper.h b/include/linux/iommu-helper.h index a6d0586e2bf7..3b068e5b5671 100644 --- a/include/linux/iommu-helper.h +++ b/include/linux/iommu-helper.h | |||
@@ -23,4 +23,7 @@ extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, | |||
23 | extern void iommu_area_free(unsigned long *map, unsigned long start, | 23 | extern void iommu_area_free(unsigned long *map, unsigned long start, |
24 | unsigned int nr); | 24 | unsigned int nr); |
25 | 25 | ||
26 | extern unsigned long iommu_num_pages(unsigned long addr, unsigned long len, | ||
27 | unsigned long io_page_size); | ||
28 | |||
26 | #endif | 29 | #endif |
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index ee9bcc6f32b6..041e95aac2bf 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -34,7 +34,8 @@ struct resource_list { | |||
34 | */ | 34 | */ |
35 | #define IORESOURCE_BITS 0x000000ff /* Bus-specific bits */ | 35 | #define IORESOURCE_BITS 0x000000ff /* Bus-specific bits */ |
36 | 36 | ||
37 | #define IORESOURCE_IO 0x00000100 /* Resource type */ | 37 | #define IORESOURCE_TYPE_BITS 0x00000f00 /* Resource type */ |
38 | #define IORESOURCE_IO 0x00000100 | ||
38 | #define IORESOURCE_MEM 0x00000200 | 39 | #define IORESOURCE_MEM 0x00000200 |
39 | #define IORESOURCE_IRQ 0x00000400 | 40 | #define IORESOURCE_IRQ 0x00000400 |
40 | #define IORESOURCE_DMA 0x00000800 | 41 | #define IORESOURCE_DMA 0x00000800 |
@@ -126,6 +127,10 @@ static inline resource_size_t resource_size(struct resource *res) | |||
126 | { | 127 | { |
127 | return res->end - res->start + 1; | 128 | return res->end - res->start + 1; |
128 | } | 129 | } |
130 | static inline unsigned long resource_type(struct resource *res) | ||
131 | { | ||
132 | return res->flags & IORESOURCE_TYPE_BITS; | ||
133 | } | ||
129 | 134 | ||
130 | /* Convenience shorthand with allocation */ | 135 | /* Convenience shorthand with allocation */ |
131 | #define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name)) | 136 | #define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name)) |
@@ -169,6 +174,7 @@ extern struct resource * __devm_request_region(struct device *dev, | |||
169 | 174 | ||
170 | extern void __devm_release_region(struct device *dev, struct resource *parent, | 175 | extern void __devm_release_region(struct device *dev, struct resource *parent, |
171 | resource_size_t start, resource_size_t n); | 176 | resource_size_t start, resource_size_t n); |
177 | extern int iomem_map_sanity_check(resource_size_t addr, unsigned long size); | ||
172 | 178 | ||
173 | #endif /* __ASSEMBLY__ */ | 179 | #endif /* __ASSEMBLY__ */ |
174 | #endif /* _LINUX_IOPORT_H */ | 180 | #endif /* _LINUX_IOPORT_H */ |
diff --git a/include/linux/iova.h b/include/linux/iova.h new file mode 100644 index 000000000000..228f6c94b69c --- /dev/null +++ b/include/linux/iova.h | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2006, Intel Corporation. | ||
3 | * | ||
4 | * This file is released under the GPLv2. | ||
5 | * | ||
6 | * Copyright (C) 2006-2008 Intel Corporation | ||
7 | * Author: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com> | ||
8 | * | ||
9 | */ | ||
10 | |||
11 | #ifndef _IOVA_H_ | ||
12 | #define _IOVA_H_ | ||
13 | |||
14 | #include <linux/types.h> | ||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/rbtree.h> | ||
17 | #include <linux/dma-mapping.h> | ||
18 | |||
19 | /* IO virtual address start page frame number */ | ||
20 | #define IOVA_START_PFN (1) | ||
21 | |||
22 | /* iova structure */ | ||
23 | struct iova { | ||
24 | struct rb_node node; | ||
25 | unsigned long pfn_hi; /* IOMMU dish out addr hi */ | ||
26 | unsigned long pfn_lo; /* IOMMU dish out addr lo */ | ||
27 | }; | ||
28 | |||
29 | /* holds all the iova translations for a domain */ | ||
30 | struct iova_domain { | ||
31 | spinlock_t iova_alloc_lock;/* Lock to protect iova allocation */ | ||
32 | spinlock_t iova_rbtree_lock; /* Lock to protect update of rbtree */ | ||
33 | struct rb_root rbroot; /* iova domain rbtree root */ | ||
34 | struct rb_node *cached32_node; /* Save last alloced node */ | ||
35 | unsigned long dma_32bit_pfn; | ||
36 | }; | ||
37 | |||
38 | struct iova *alloc_iova_mem(void); | ||
39 | void free_iova_mem(struct iova *iova); | ||
40 | void free_iova(struct iova_domain *iovad, unsigned long pfn); | ||
41 | void __free_iova(struct iova_domain *iovad, struct iova *iova); | ||
42 | struct iova *alloc_iova(struct iova_domain *iovad, unsigned long size, | ||
43 | unsigned long limit_pfn, | ||
44 | bool size_aligned); | ||
45 | struct iova *reserve_iova(struct iova_domain *iovad, unsigned long pfn_lo, | ||
46 | unsigned long pfn_hi); | ||
47 | void copy_reserved_iova(struct iova_domain *from, struct iova_domain *to); | ||
48 | void init_iova_domain(struct iova_domain *iovad, unsigned long pfn_32bit); | ||
49 | struct iova *find_iova(struct iova_domain *iovad, unsigned long pfn); | ||
50 | void put_iova_domain(struct iova_domain *iovad); | ||
51 | |||
52 | #endif | ||
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index 07a9b52a2654..35d4f6342fac 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
@@ -61,7 +61,7 @@ extern u8 journal_enable_debug; | |||
61 | do { \ | 61 | do { \ |
62 | if ((n) <= journal_enable_debug) { \ | 62 | if ((n) <= journal_enable_debug) { \ |
63 | printk (KERN_DEBUG "(%s, %d): %s: ", \ | 63 | printk (KERN_DEBUG "(%s, %d): %s: ", \ |
64 | __FILE__, __LINE__, __FUNCTION__); \ | 64 | __FILE__, __LINE__, __func__); \ |
65 | printk (f, ## a); \ | 65 | printk (f, ## a); \ |
66 | } \ | 66 | } \ |
67 | } while (0) | 67 | } while (0) |
@@ -816,6 +816,9 @@ struct journal_s | |||
816 | #define JFS_FLUSHED 0x008 /* The journal superblock has been flushed */ | 816 | #define JFS_FLUSHED 0x008 /* The journal superblock has been flushed */ |
817 | #define JFS_LOADED 0x010 /* The journal superblock has been loaded */ | 817 | #define JFS_LOADED 0x010 /* The journal superblock has been loaded */ |
818 | #define JFS_BARRIER 0x020 /* Use IDE barriers */ | 818 | #define JFS_BARRIER 0x020 /* Use IDE barriers */ |
819 | #define JFS_ABORT_ON_SYNCDATA_ERR 0x040 /* Abort the journal on file | ||
820 | * data write error in ordered | ||
821 | * mode */ | ||
819 | 822 | ||
820 | /* | 823 | /* |
821 | * Function declarations for the journaling transaction and buffer | 824 | * Function declarations for the journaling transaction and buffer |
@@ -984,7 +987,7 @@ extern int cleanup_journal_tail(journal_t *); | |||
984 | 987 | ||
985 | #define jbd_ENOSYS() \ | 988 | #define jbd_ENOSYS() \ |
986 | do { \ | 989 | do { \ |
987 | printk (KERN_ERR "JBD unimplemented function %s\n", __FUNCTION__); \ | 990 | printk (KERN_ERR "JBD unimplemented function %s\n", __func__); \ |
988 | current->state = TASK_UNINTERRUPTIBLE; \ | 991 | current->state = TASK_UNINTERRUPTIBLE; \ |
989 | schedule(); \ | 992 | schedule(); \ |
990 | } while (1) | 993 | } while (1) |
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index d2e91ea998fd..c7d106ef22e2 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
@@ -61,7 +61,7 @@ extern u8 jbd2_journal_enable_debug; | |||
61 | do { \ | 61 | do { \ |
62 | if ((n) <= jbd2_journal_enable_debug) { \ | 62 | if ((n) <= jbd2_journal_enable_debug) { \ |
63 | printk (KERN_DEBUG "(%s, %d): %s: ", \ | 63 | printk (KERN_DEBUG "(%s, %d): %s: ", \ |
64 | __FILE__, __LINE__, __FUNCTION__); \ | 64 | __FILE__, __LINE__, __func__); \ |
65 | printk (f, ## a); \ | 65 | printk (f, ## a); \ |
66 | } \ | 66 | } \ |
67 | } while (0) | 67 | } while (0) |
@@ -641,6 +641,11 @@ struct transaction_s | |||
641 | */ | 641 | */ |
642 | int t_handle_count; | 642 | int t_handle_count; |
643 | 643 | ||
644 | /* | ||
645 | * For use by the filesystem to store fs-specific data | ||
646 | * structures associated with the transaction | ||
647 | */ | ||
648 | struct list_head t_private_list; | ||
644 | }; | 649 | }; |
645 | 650 | ||
646 | struct transaction_run_stats_s { | 651 | struct transaction_run_stats_s { |
@@ -935,6 +940,10 @@ struct journal_s | |||
935 | 940 | ||
936 | pid_t j_last_sync_writer; | 941 | pid_t j_last_sync_writer; |
937 | 942 | ||
943 | /* This function is called when a transaction is closed */ | ||
944 | void (*j_commit_callback)(journal_t *, | ||
945 | transaction_t *); | ||
946 | |||
938 | /* | 947 | /* |
939 | * Journal statistics | 948 | * Journal statistics |
940 | */ | 949 | */ |
@@ -1143,7 +1152,7 @@ extern int jbd2_cleanup_journal_tail(journal_t *); | |||
1143 | 1152 | ||
1144 | #define jbd_ENOSYS() \ | 1153 | #define jbd_ENOSYS() \ |
1145 | do { \ | 1154 | do { \ |
1146 | printk (KERN_ERR "JBD unimplemented function %s\n", __FUNCTION__); \ | 1155 | printk (KERN_ERR "JBD unimplemented function %s\n", __func__); \ |
1147 | current->state = TASK_UNINTERRUPTIBLE; \ | 1156 | current->state = TASK_UNINTERRUPTIBLE; \ |
1148 | schedule(); \ | 1157 | schedule(); \ |
1149 | } while (1) | 1158 | } while (1) |
diff --git a/include/linux/journal-head.h b/include/linux/journal-head.h index 8a62d1e84b9b..bb70ebb6a2d5 100644 --- a/include/linux/journal-head.h +++ b/include/linux/journal-head.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * buffer_head fields for JBD | 4 | * buffer_head fields for JBD |
5 | * | 5 | * |
6 | * 27 May 2001 Andrew Morton <akpm@digeo.com> | 6 | * 27 May 2001 Andrew Morton |
7 | * Created - pulled out of fs.h | 7 | * Created - pulled out of fs.h |
8 | */ | 8 | */ |
9 | 9 | ||
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h index b96144887444..f3fe34391d8e 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h | |||
@@ -93,12 +93,10 @@ static inline void print_symbol(const char *fmt, unsigned long addr) | |||
93 | } | 93 | } |
94 | 94 | ||
95 | /* | 95 | /* |
96 | * Pretty-print a function pointer. | 96 | * Pretty-print a function pointer. This function is deprecated. |
97 | * | 97 | * Please use the "%pF" vsprintf format instead. |
98 | * ia64 and ppc64 function pointers are really function descriptors, | ||
99 | * which contain a pointer the real address. | ||
100 | */ | 98 | */ |
101 | static inline void print_fn_descriptor_symbol(const char *fmt, void *addr) | 99 | static inline void __deprecated print_fn_descriptor_symbol(const char *fmt, void *addr) |
102 | { | 100 | { |
103 | #if defined(CONFIG_IA64) || defined(CONFIG_PPC64) | 101 | #if defined(CONFIG_IA64) || defined(CONFIG_PPC64) |
104 | addr = *(void **)addr; | 102 | addr = *(void **)addr; |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 75d81f157d2e..5a566b705ca9 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/log2.h> | 16 | #include <linux/log2.h> |
17 | #include <linux/typecheck.h> | 17 | #include <linux/typecheck.h> |
18 | #include <linux/ratelimit.h> | 18 | #include <linux/ratelimit.h> |
19 | #include <linux/dynamic_printk.h> | ||
19 | #include <asm/byteorder.h> | 20 | #include <asm/byteorder.h> |
20 | #include <asm/bug.h> | 21 | #include <asm/bug.h> |
21 | 22 | ||
@@ -213,6 +214,9 @@ static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ | |||
213 | { return false; } | 214 | { return false; } |
214 | #endif | 215 | #endif |
215 | 216 | ||
217 | extern int printk_needs_cpu(int cpu); | ||
218 | extern void printk_tick(void); | ||
219 | |||
216 | extern void asmlinkage __attribute__((format(printf, 1, 2))) | 220 | extern void asmlinkage __attribute__((format(printf, 1, 2))) |
217 | early_printk(const char *fmt, ...); | 221 | early_printk(const char *fmt, ...); |
218 | 222 | ||
@@ -235,9 +239,10 @@ extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in | |||
235 | extern int panic_timeout; | 239 | extern int panic_timeout; |
236 | extern int panic_on_oops; | 240 | extern int panic_on_oops; |
237 | extern int panic_on_unrecovered_nmi; | 241 | extern int panic_on_unrecovered_nmi; |
238 | extern int tainted; | ||
239 | extern const char *print_tainted(void); | 242 | extern const char *print_tainted(void); |
240 | extern void add_taint(unsigned); | 243 | extern void add_taint(unsigned flag); |
244 | extern int test_taint(unsigned flag); | ||
245 | extern unsigned long get_taint(void); | ||
241 | extern int root_mountflags; | 246 | extern int root_mountflags; |
242 | 247 | ||
243 | /* Values used for system_state */ | 248 | /* Values used for system_state */ |
@@ -250,16 +255,17 @@ extern enum system_states { | |||
250 | SYSTEM_SUSPEND_DISK, | 255 | SYSTEM_SUSPEND_DISK, |
251 | } system_state; | 256 | } system_state; |
252 | 257 | ||
253 | #define TAINT_PROPRIETARY_MODULE (1<<0) | 258 | #define TAINT_PROPRIETARY_MODULE 0 |
254 | #define TAINT_FORCED_MODULE (1<<1) | 259 | #define TAINT_FORCED_MODULE 1 |
255 | #define TAINT_UNSAFE_SMP (1<<2) | 260 | #define TAINT_UNSAFE_SMP 2 |
256 | #define TAINT_FORCED_RMMOD (1<<3) | 261 | #define TAINT_FORCED_RMMOD 3 |
257 | #define TAINT_MACHINE_CHECK (1<<4) | 262 | #define TAINT_MACHINE_CHECK 4 |
258 | #define TAINT_BAD_PAGE (1<<5) | 263 | #define TAINT_BAD_PAGE 5 |
259 | #define TAINT_USER (1<<6) | 264 | #define TAINT_USER 6 |
260 | #define TAINT_DIE (1<<7) | 265 | #define TAINT_DIE 7 |
261 | #define TAINT_OVERRIDDEN_ACPI_TABLE (1<<8) | 266 | #define TAINT_OVERRIDDEN_ACPI_TABLE 8 |
262 | #define TAINT_WARN (1<<9) | 267 | #define TAINT_WARN 9 |
268 | #define TAINT_CRAP 10 | ||
263 | 269 | ||
264 | extern void dump_stack(void) __cold; | 270 | extern void dump_stack(void) __cold; |
265 | 271 | ||
@@ -303,8 +309,12 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
303 | #define pr_info(fmt, arg...) \ | 309 | #define pr_info(fmt, arg...) \ |
304 | printk(KERN_INFO fmt, ##arg) | 310 | printk(KERN_INFO fmt, ##arg) |
305 | 311 | ||
306 | #ifdef DEBUG | ||
307 | /* If you are writing a driver, please use dev_dbg instead */ | 312 | /* If you are writing a driver, please use dev_dbg instead */ |
313 | #if defined(CONFIG_DYNAMIC_PRINTK_DEBUG) | ||
314 | #define pr_debug(fmt, ...) do { \ | ||
315 | dynamic_pr_debug(fmt, ##__VA_ARGS__); \ | ||
316 | } while (0) | ||
317 | #elif defined(DEBUG) | ||
308 | #define pr_debug(fmt, arg...) \ | 318 | #define pr_debug(fmt, arg...) \ |
309 | printk(KERN_DEBUG fmt, ##arg) | 319 | printk(KERN_DEBUG fmt, ##arg) |
310 | #else | 320 | #else |
diff --git a/include/linux/kmod.h b/include/linux/kmod.h index a1a91577813c..92213a9194e1 100644 --- a/include/linux/kmod.h +++ b/include/linux/kmod.h | |||
@@ -99,4 +99,7 @@ struct file; | |||
99 | extern int call_usermodehelper_pipe(char *path, char *argv[], char *envp[], | 99 | extern int call_usermodehelper_pipe(char *path, char *argv[], char *envp[], |
100 | struct file **filp); | 100 | struct file **filp); |
101 | 101 | ||
102 | extern int usermodehelper_disable(void); | ||
103 | extern void usermodehelper_enable(void); | ||
104 | |||
102 | #endif /* __LINUX_KMOD_H__ */ | 105 | #endif /* __LINUX_KMOD_H__ */ |
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 70a30651cd12..797fcd781242 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -311,22 +311,33 @@ struct kvm_s390_interrupt { | |||
311 | 311 | ||
312 | /* This structure represents a single trace buffer record. */ | 312 | /* This structure represents a single trace buffer record. */ |
313 | struct kvm_trace_rec { | 313 | struct kvm_trace_rec { |
314 | __u32 event:28; | 314 | /* variable rec_val |
315 | __u32 extra_u32:3; | 315 | * is split into: |
316 | __u32 cycle_in:1; | 316 | * bits 0 - 27 -> event id |
317 | * bits 28 -30 -> number of extra data args of size u32 | ||
318 | * bits 31 -> binary indicator for if tsc is in record | ||
319 | */ | ||
320 | __u32 rec_val; | ||
317 | __u32 pid; | 321 | __u32 pid; |
318 | __u32 vcpu_id; | 322 | __u32 vcpu_id; |
319 | union { | 323 | union { |
320 | struct { | 324 | struct { |
321 | __u64 cycle_u64; | 325 | __u64 timestamp; |
322 | __u32 extra_u32[KVM_TRC_EXTRA_MAX]; | 326 | __u32 extra_u32[KVM_TRC_EXTRA_MAX]; |
323 | } __attribute__((packed)) cycle; | 327 | } __attribute__((packed)) timestamp; |
324 | struct { | 328 | struct { |
325 | __u32 extra_u32[KVM_TRC_EXTRA_MAX]; | 329 | __u32 extra_u32[KVM_TRC_EXTRA_MAX]; |
326 | } nocycle; | 330 | } notimestamp; |
327 | } u; | 331 | } u; |
328 | }; | 332 | }; |
329 | 333 | ||
334 | #define TRACE_REC_EVENT_ID(val) \ | ||
335 | (0x0fffffff & (val)) | ||
336 | #define TRACE_REC_NUM_DATA_ARGS(val) \ | ||
337 | (0x70000000 & ((val) << 28)) | ||
338 | #define TRACE_REC_TCS(val) \ | ||
339 | (0x80000000 & ((val) << 31)) | ||
340 | |||
330 | #define KVMIO 0xAE | 341 | #define KVMIO 0xAE |
331 | 342 | ||
332 | /* | 343 | /* |
@@ -372,6 +383,10 @@ struct kvm_trace_rec { | |||
372 | #define KVM_CAP_MP_STATE 14 | 383 | #define KVM_CAP_MP_STATE 14 |
373 | #define KVM_CAP_COALESCED_MMIO 15 | 384 | #define KVM_CAP_COALESCED_MMIO 15 |
374 | #define KVM_CAP_SYNC_MMU 16 /* Changes to host mmap are reflected in guest */ | 385 | #define KVM_CAP_SYNC_MMU 16 /* Changes to host mmap are reflected in guest */ |
386 | #if defined(CONFIG_X86)||defined(CONFIG_IA64) | ||
387 | #define KVM_CAP_DEVICE_ASSIGNMENT 17 | ||
388 | #endif | ||
389 | #define KVM_CAP_IOMMU 18 | ||
375 | 390 | ||
376 | /* | 391 | /* |
377 | * ioctls for VM fds | 392 | * ioctls for VM fds |
@@ -401,6 +416,10 @@ struct kvm_trace_rec { | |||
401 | _IOW(KVMIO, 0x67, struct kvm_coalesced_mmio_zone) | 416 | _IOW(KVMIO, 0x67, struct kvm_coalesced_mmio_zone) |
402 | #define KVM_UNREGISTER_COALESCED_MMIO \ | 417 | #define KVM_UNREGISTER_COALESCED_MMIO \ |
403 | _IOW(KVMIO, 0x68, struct kvm_coalesced_mmio_zone) | 418 | _IOW(KVMIO, 0x68, struct kvm_coalesced_mmio_zone) |
419 | #define KVM_ASSIGN_PCI_DEVICE _IOR(KVMIO, 0x69, \ | ||
420 | struct kvm_assigned_pci_dev) | ||
421 | #define KVM_ASSIGN_IRQ _IOR(KVMIO, 0x70, \ | ||
422 | struct kvm_assigned_irq) | ||
404 | 423 | ||
405 | /* | 424 | /* |
406 | * ioctls for vcpu fds | 425 | * ioctls for vcpu fds |
@@ -440,4 +459,45 @@ struct kvm_trace_rec { | |||
440 | #define KVM_GET_MP_STATE _IOR(KVMIO, 0x98, struct kvm_mp_state) | 459 | #define KVM_GET_MP_STATE _IOR(KVMIO, 0x98, struct kvm_mp_state) |
441 | #define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state) | 460 | #define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state) |
442 | 461 | ||
462 | #define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02) | ||
463 | #define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03) | ||
464 | #define KVM_TRC_PEND_INTR (KVM_TRC_HANDLER + 0x04) | ||
465 | #define KVM_TRC_IO_READ (KVM_TRC_HANDLER + 0x05) | ||
466 | #define KVM_TRC_IO_WRITE (KVM_TRC_HANDLER + 0x06) | ||
467 | #define KVM_TRC_CR_READ (KVM_TRC_HANDLER + 0x07) | ||
468 | #define KVM_TRC_CR_WRITE (KVM_TRC_HANDLER + 0x08) | ||
469 | #define KVM_TRC_DR_READ (KVM_TRC_HANDLER + 0x09) | ||
470 | #define KVM_TRC_DR_WRITE (KVM_TRC_HANDLER + 0x0A) | ||
471 | #define KVM_TRC_MSR_READ (KVM_TRC_HANDLER + 0x0B) | ||
472 | #define KVM_TRC_MSR_WRITE (KVM_TRC_HANDLER + 0x0C) | ||
473 | #define KVM_TRC_CPUID (KVM_TRC_HANDLER + 0x0D) | ||
474 | #define KVM_TRC_INTR (KVM_TRC_HANDLER + 0x0E) | ||
475 | #define KVM_TRC_NMI (KVM_TRC_HANDLER + 0x0F) | ||
476 | #define KVM_TRC_VMMCALL (KVM_TRC_HANDLER + 0x10) | ||
477 | #define KVM_TRC_HLT (KVM_TRC_HANDLER + 0x11) | ||
478 | #define KVM_TRC_CLTS (KVM_TRC_HANDLER + 0x12) | ||
479 | #define KVM_TRC_LMSW (KVM_TRC_HANDLER + 0x13) | ||
480 | #define KVM_TRC_APIC_ACCESS (KVM_TRC_HANDLER + 0x14) | ||
481 | #define KVM_TRC_TDP_FAULT (KVM_TRC_HANDLER + 0x15) | ||
482 | #define KVM_TRC_GTLB_WRITE (KVM_TRC_HANDLER + 0x16) | ||
483 | #define KVM_TRC_STLB_WRITE (KVM_TRC_HANDLER + 0x17) | ||
484 | #define KVM_TRC_STLB_INVAL (KVM_TRC_HANDLER + 0x18) | ||
485 | #define KVM_TRC_PPC_INSTR (KVM_TRC_HANDLER + 0x19) | ||
486 | |||
487 | struct kvm_assigned_pci_dev { | ||
488 | __u32 assigned_dev_id; | ||
489 | __u32 busnr; | ||
490 | __u32 devfn; | ||
491 | __u32 flags; | ||
492 | }; | ||
493 | |||
494 | struct kvm_assigned_irq { | ||
495 | __u32 assigned_dev_id; | ||
496 | __u32 host_irq; | ||
497 | __u32 guest_irq; | ||
498 | __u32 flags; | ||
499 | }; | ||
500 | |||
501 | #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) | ||
502 | |||
443 | #endif | 503 | #endif |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 8525afc53107..3833c48fae3a 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -34,6 +34,8 @@ | |||
34 | #define KVM_REQ_MMU_RELOAD 3 | 34 | #define KVM_REQ_MMU_RELOAD 3 |
35 | #define KVM_REQ_TRIPLE_FAULT 4 | 35 | #define KVM_REQ_TRIPLE_FAULT 4 |
36 | #define KVM_REQ_PENDING_TIMER 5 | 36 | #define KVM_REQ_PENDING_TIMER 5 |
37 | #define KVM_REQ_UNHALT 6 | ||
38 | #define KVM_REQ_MMU_SYNC 7 | ||
37 | 39 | ||
38 | struct kvm_vcpu; | 40 | struct kvm_vcpu; |
39 | extern struct kmem_cache *kvm_vcpu_cache; | 41 | extern struct kmem_cache *kvm_vcpu_cache; |
@@ -279,12 +281,68 @@ void kvm_free_physmem(struct kvm *kvm); | |||
279 | 281 | ||
280 | struct kvm *kvm_arch_create_vm(void); | 282 | struct kvm *kvm_arch_create_vm(void); |
281 | void kvm_arch_destroy_vm(struct kvm *kvm); | 283 | void kvm_arch_destroy_vm(struct kvm *kvm); |
284 | void kvm_free_all_assigned_devices(struct kvm *kvm); | ||
282 | 285 | ||
283 | int kvm_cpu_get_interrupt(struct kvm_vcpu *v); | 286 | int kvm_cpu_get_interrupt(struct kvm_vcpu *v); |
284 | int kvm_cpu_has_interrupt(struct kvm_vcpu *v); | 287 | int kvm_cpu_has_interrupt(struct kvm_vcpu *v); |
285 | int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu); | 288 | int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu); |
286 | void kvm_vcpu_kick(struct kvm_vcpu *vcpu); | 289 | void kvm_vcpu_kick(struct kvm_vcpu *vcpu); |
287 | 290 | ||
291 | int kvm_is_mmio_pfn(pfn_t pfn); | ||
292 | |||
293 | struct kvm_irq_ack_notifier { | ||
294 | struct hlist_node link; | ||
295 | unsigned gsi; | ||
296 | void (*irq_acked)(struct kvm_irq_ack_notifier *kian); | ||
297 | }; | ||
298 | |||
299 | struct kvm_assigned_dev_kernel { | ||
300 | struct kvm_irq_ack_notifier ack_notifier; | ||
301 | struct work_struct interrupt_work; | ||
302 | struct list_head list; | ||
303 | int assigned_dev_id; | ||
304 | int host_busnr; | ||
305 | int host_devfn; | ||
306 | int host_irq; | ||
307 | int guest_irq; | ||
308 | int irq_requested; | ||
309 | struct pci_dev *dev; | ||
310 | struct kvm *kvm; | ||
311 | }; | ||
312 | void kvm_set_irq(struct kvm *kvm, int irq, int level); | ||
313 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned gsi); | ||
314 | void kvm_register_irq_ack_notifier(struct kvm *kvm, | ||
315 | struct kvm_irq_ack_notifier *kian); | ||
316 | void kvm_unregister_irq_ack_notifier(struct kvm *kvm, | ||
317 | struct kvm_irq_ack_notifier *kian); | ||
318 | |||
319 | #ifdef CONFIG_DMAR | ||
320 | int kvm_iommu_map_pages(struct kvm *kvm, gfn_t base_gfn, | ||
321 | unsigned long npages); | ||
322 | int kvm_iommu_map_guest(struct kvm *kvm, | ||
323 | struct kvm_assigned_dev_kernel *assigned_dev); | ||
324 | int kvm_iommu_unmap_guest(struct kvm *kvm); | ||
325 | #else /* CONFIG_DMAR */ | ||
326 | static inline int kvm_iommu_map_pages(struct kvm *kvm, | ||
327 | gfn_t base_gfn, | ||
328 | unsigned long npages) | ||
329 | { | ||
330 | return 0; | ||
331 | } | ||
332 | |||
333 | static inline int kvm_iommu_map_guest(struct kvm *kvm, | ||
334 | struct kvm_assigned_dev_kernel | ||
335 | *assigned_dev) | ||
336 | { | ||
337 | return -ENODEV; | ||
338 | } | ||
339 | |||
340 | static inline int kvm_iommu_unmap_guest(struct kvm *kvm) | ||
341 | { | ||
342 | return 0; | ||
343 | } | ||
344 | #endif /* CONFIG_DMAR */ | ||
345 | |||
288 | static inline void kvm_guest_enter(void) | 346 | static inline void kvm_guest_enter(void) |
289 | { | 347 | { |
290 | account_system_vtime(current); | 348 | account_system_vtime(current); |
@@ -307,6 +365,11 @@ static inline gpa_t gfn_to_gpa(gfn_t gfn) | |||
307 | return (gpa_t)gfn << PAGE_SHIFT; | 365 | return (gpa_t)gfn << PAGE_SHIFT; |
308 | } | 366 | } |
309 | 367 | ||
368 | static inline hpa_t pfn_to_hpa(pfn_t pfn) | ||
369 | { | ||
370 | return (hpa_t)pfn << PAGE_SHIFT; | ||
371 | } | ||
372 | |||
310 | static inline void kvm_migrate_timers(struct kvm_vcpu *vcpu) | 373 | static inline void kvm_migrate_timers(struct kvm_vcpu *vcpu) |
311 | { | 374 | { |
312 | set_bit(KVM_REQ_MIGRATE_TIMER, &vcpu->requests); | 375 | set_bit(KVM_REQ_MIGRATE_TIMER, &vcpu->requests); |
@@ -326,6 +389,25 @@ struct kvm_stats_debugfs_item { | |||
326 | extern struct kvm_stats_debugfs_item debugfs_entries[]; | 389 | extern struct kvm_stats_debugfs_item debugfs_entries[]; |
327 | extern struct dentry *kvm_debugfs_dir; | 390 | extern struct dentry *kvm_debugfs_dir; |
328 | 391 | ||
392 | #define KVMTRACE_5D(evt, vcpu, d1, d2, d3, d4, d5, name) \ | ||
393 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
394 | vcpu, 5, d1, d2, d3, d4, d5) | ||
395 | #define KVMTRACE_4D(evt, vcpu, d1, d2, d3, d4, name) \ | ||
396 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
397 | vcpu, 4, d1, d2, d3, d4, 0) | ||
398 | #define KVMTRACE_3D(evt, vcpu, d1, d2, d3, name) \ | ||
399 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
400 | vcpu, 3, d1, d2, d3, 0, 0) | ||
401 | #define KVMTRACE_2D(evt, vcpu, d1, d2, name) \ | ||
402 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
403 | vcpu, 2, d1, d2, 0, 0, 0) | ||
404 | #define KVMTRACE_1D(evt, vcpu, d1, name) \ | ||
405 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
406 | vcpu, 1, d1, 0, 0, 0, 0) | ||
407 | #define KVMTRACE_0D(evt, vcpu, name) \ | ||
408 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
409 | vcpu, 0, 0, 0, 0, 0, 0) | ||
410 | |||
329 | #ifdef CONFIG_KVM_TRACE | 411 | #ifdef CONFIG_KVM_TRACE |
330 | int kvm_trace_ioctl(unsigned int ioctl, unsigned long arg); | 412 | int kvm_trace_ioctl(unsigned int ioctl, unsigned long arg); |
331 | void kvm_trace_cleanup(void); | 413 | void kvm_trace_cleanup(void); |
diff --git a/include/linux/map_to_7segment.h b/include/linux/map_to_7segment.h new file mode 100644 index 000000000000..7df8432c4402 --- /dev/null +++ b/include/linux/map_to_7segment.h | |||
@@ -0,0 +1,187 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2005 Henk Vergonet <Henk.Vergonet@gmail.com> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License as | ||
6 | * published by the Free Software Foundation; either version 2 of | ||
7 | * the License, or (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
17 | */ | ||
18 | |||
19 | #ifndef MAP_TO_7SEGMENT_H | ||
20 | #define MAP_TO_7SEGMENT_H | ||
21 | |||
22 | /* This file provides translation primitives and tables for the conversion | ||
23 | * of (ASCII) characters to a 7-segments notation. | ||
24 | * | ||
25 | * The 7 segment's wikipedia notation below is used as standard. | ||
26 | * See: http://en.wikipedia.org/wiki/Seven_segment_display | ||
27 | * | ||
28 | * Notation: +-a-+ | ||
29 | * f b | ||
30 | * +-g-+ | ||
31 | * e c | ||
32 | * +-d-+ | ||
33 | * | ||
34 | * Usage: | ||
35 | * | ||
36 | * Register a map variable, and fill it with a character set: | ||
37 | * static SEG7_DEFAULT_MAP(map_seg7); | ||
38 | * | ||
39 | * | ||
40 | * Then use for conversion: | ||
41 | * seg7 = map_to_seg7(&map_seg7, some_char); | ||
42 | * ... | ||
43 | * | ||
44 | * In device drivers it is recommended, if required, to make the char map | ||
45 | * accessible via the sysfs interface using the following scheme: | ||
46 | * | ||
47 | * static ssize_t show_map(struct device *dev, char *buf) { | ||
48 | * memcpy(buf, &map_seg7, sizeof(map_seg7)); | ||
49 | * return sizeof(map_seg7); | ||
50 | * } | ||
51 | * static ssize_t store_map(struct device *dev, const char *buf, size_t cnt) { | ||
52 | * if(cnt != sizeof(map_seg7)) | ||
53 | * return -EINVAL; | ||
54 | * memcpy(&map_seg7, buf, cnt); | ||
55 | * return cnt; | ||
56 | * } | ||
57 | * static DEVICE_ATTR(map_seg7, PERMS_RW, show_map, store_map); | ||
58 | * | ||
59 | * History: | ||
60 | * 2005-05-31 RFC linux-kernel@vger.kernel.org | ||
61 | */ | ||
62 | #include <linux/errno.h> | ||
63 | |||
64 | |||
65 | #define BIT_SEG7_A 0 | ||
66 | #define BIT_SEG7_B 1 | ||
67 | #define BIT_SEG7_C 2 | ||
68 | #define BIT_SEG7_D 3 | ||
69 | #define BIT_SEG7_E 4 | ||
70 | #define BIT_SEG7_F 5 | ||
71 | #define BIT_SEG7_G 6 | ||
72 | #define BIT_SEG7_RESERVED 7 | ||
73 | |||
74 | struct seg7_conversion_map { | ||
75 | unsigned char table[128]; | ||
76 | }; | ||
77 | |||
78 | static inline int map_to_seg7(struct seg7_conversion_map *map, int c) | ||
79 | { | ||
80 | return c >= 0 && c < sizeof(map->table) ? map->table[c] : -EINVAL; | ||
81 | } | ||
82 | |||
83 | #define SEG7_CONVERSION_MAP(_name, _map) \ | ||
84 | struct seg7_conversion_map _name = { .table = { _map } } | ||
85 | |||
86 | /* | ||
87 | * It is recommended to use a facility that allows user space to redefine | ||
88 | * custom character sets for LCD devices. Please use a sysfs interface | ||
89 | * as described above. | ||
90 | */ | ||
91 | #define MAP_TO_SEG7_SYSFS_FILE "map_seg7" | ||
92 | |||
93 | /******************************************************************************* | ||
94 | * ASCII conversion table | ||
95 | ******************************************************************************/ | ||
96 | |||
97 | #define _SEG7(l,a,b,c,d,e,f,g) \ | ||
98 | ( a<<BIT_SEG7_A | b<<BIT_SEG7_B | c<<BIT_SEG7_C | d<<BIT_SEG7_D | \ | ||
99 | e<<BIT_SEG7_E | f<<BIT_SEG7_F | g<<BIT_SEG7_G ) | ||
100 | |||
101 | #define _MAP_0_32_ASCII_SEG7_NON_PRINTABLE \ | ||
102 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
103 | |||
104 | #define _MAP_33_47_ASCII_SEG7_SYMBOL \ | ||
105 | _SEG7('!',0,0,0,0,1,1,0), _SEG7('"',0,1,0,0,0,1,0), _SEG7('#',0,1,1,0,1,1,0),\ | ||
106 | _SEG7('$',1,0,1,1,0,1,1), _SEG7('%',0,0,1,0,0,1,0), _SEG7('&',1,0,1,1,1,1,1),\ | ||
107 | _SEG7('\'',0,0,0,0,0,1,0),_SEG7('(',1,0,0,1,1,1,0), _SEG7(')',1,1,1,1,0,0,0),\ | ||
108 | _SEG7('*',0,1,1,0,1,1,1), _SEG7('+',0,1,1,0,0,0,1), _SEG7(',',0,0,0,0,1,0,0),\ | ||
109 | _SEG7('-',0,0,0,0,0,0,1), _SEG7('.',0,0,0,0,1,0,0), _SEG7('/',0,1,0,0,1,0,1), | ||
110 | |||
111 | #define _MAP_48_57_ASCII_SEG7_NUMERIC \ | ||
112 | _SEG7('0',1,1,1,1,1,1,0), _SEG7('1',0,1,1,0,0,0,0), _SEG7('2',1,1,0,1,1,0,1),\ | ||
113 | _SEG7('3',1,1,1,1,0,0,1), _SEG7('4',0,1,1,0,0,1,1), _SEG7('5',1,0,1,1,0,1,1),\ | ||
114 | _SEG7('6',1,0,1,1,1,1,1), _SEG7('7',1,1,1,0,0,0,0), _SEG7('8',1,1,1,1,1,1,1),\ | ||
115 | _SEG7('9',1,1,1,1,0,1,1), | ||
116 | |||
117 | #define _MAP_58_64_ASCII_SEG7_SYMBOL \ | ||
118 | _SEG7(':',0,0,0,1,0,0,1), _SEG7(';',0,0,0,1,0,0,1), _SEG7('<',1,0,0,0,0,1,1),\ | ||
119 | _SEG7('=',0,0,0,1,0,0,1), _SEG7('>',1,1,0,0,0,0,1), _SEG7('?',1,1,1,0,0,1,0),\ | ||
120 | _SEG7('@',1,1,0,1,1,1,1), | ||
121 | |||
122 | #define _MAP_65_90_ASCII_SEG7_ALPHA_UPPR \ | ||
123 | _SEG7('A',1,1,1,0,1,1,1), _SEG7('B',1,1,1,1,1,1,1), _SEG7('C',1,0,0,1,1,1,0),\ | ||
124 | _SEG7('D',1,1,1,1,1,1,0), _SEG7('E',1,0,0,1,1,1,1), _SEG7('F',1,0,0,0,1,1,1),\ | ||
125 | _SEG7('G',1,1,1,1,0,1,1), _SEG7('H',0,1,1,0,1,1,1), _SEG7('I',0,1,1,0,0,0,0),\ | ||
126 | _SEG7('J',0,1,1,1,0,0,0), _SEG7('K',0,1,1,0,1,1,1), _SEG7('L',0,0,0,1,1,1,0),\ | ||
127 | _SEG7('M',1,1,1,0,1,1,0), _SEG7('N',1,1,1,0,1,1,0), _SEG7('O',1,1,1,1,1,1,0),\ | ||
128 | _SEG7('P',1,1,0,0,1,1,1), _SEG7('Q',1,1,1,1,1,1,0), _SEG7('R',1,1,1,0,1,1,1),\ | ||
129 | _SEG7('S',1,0,1,1,0,1,1), _SEG7('T',0,0,0,1,1,1,1), _SEG7('U',0,1,1,1,1,1,0),\ | ||
130 | _SEG7('V',0,1,1,1,1,1,0), _SEG7('W',0,1,1,1,1,1,1), _SEG7('X',0,1,1,0,1,1,1),\ | ||
131 | _SEG7('Y',0,1,1,0,0,1,1), _SEG7('Z',1,1,0,1,1,0,1), | ||
132 | |||
133 | #define _MAP_91_96_ASCII_SEG7_SYMBOL \ | ||
134 | _SEG7('[',1,0,0,1,1,1,0), _SEG7('\\',0,0,1,0,0,1,1),_SEG7(']',1,1,1,1,0,0,0),\ | ||
135 | _SEG7('^',1,1,0,0,0,1,0), _SEG7('_',0,0,0,1,0,0,0), _SEG7('`',0,1,0,0,0,0,0), | ||
136 | |||
137 | #define _MAP_97_122_ASCII_SEG7_ALPHA_LOWER \ | ||
138 | _SEG7('A',1,1,1,0,1,1,1), _SEG7('b',0,0,1,1,1,1,1), _SEG7('c',0,0,0,1,1,0,1),\ | ||
139 | _SEG7('d',0,1,1,1,1,0,1), _SEG7('E',1,0,0,1,1,1,1), _SEG7('F',1,0,0,0,1,1,1),\ | ||
140 | _SEG7('G',1,1,1,1,0,1,1), _SEG7('h',0,0,1,0,1,1,1), _SEG7('i',0,0,1,0,0,0,0),\ | ||
141 | _SEG7('j',0,0,1,1,0,0,0), _SEG7('k',0,0,1,0,1,1,1), _SEG7('L',0,0,0,1,1,1,0),\ | ||
142 | _SEG7('M',1,1,1,0,1,1,0), _SEG7('n',0,0,1,0,1,0,1), _SEG7('o',0,0,1,1,1,0,1),\ | ||
143 | _SEG7('P',1,1,0,0,1,1,1), _SEG7('q',1,1,1,0,0,1,1), _SEG7('r',0,0,0,0,1,0,1),\ | ||
144 | _SEG7('S',1,0,1,1,0,1,1), _SEG7('T',0,0,0,1,1,1,1), _SEG7('u',0,0,1,1,1,0,0),\ | ||
145 | _SEG7('v',0,0,1,1,1,0,0), _SEG7('W',0,1,1,1,1,1,1), _SEG7('X',0,1,1,0,1,1,1),\ | ||
146 | _SEG7('y',0,1,1,1,0,1,1), _SEG7('Z',1,1,0,1,1,0,1), | ||
147 | |||
148 | #define _MAP_123_126_ASCII_SEG7_SYMBOL \ | ||
149 | _SEG7('{',1,0,0,1,1,1,0), _SEG7('|',0,0,0,0,1,1,0), _SEG7('}',1,1,1,1,0,0,0),\ | ||
150 | _SEG7('~',1,0,0,0,0,0,0), | ||
151 | |||
152 | /* Maps */ | ||
153 | |||
154 | /* This set tries to map as close as possible to the visible characteristics | ||
155 | * of the ASCII symbol, lowercase and uppercase letters may differ in | ||
156 | * presentation on the display. | ||
157 | */ | ||
158 | #define MAP_ASCII7SEG_ALPHANUM \ | ||
159 | _MAP_0_32_ASCII_SEG7_NON_PRINTABLE \ | ||
160 | _MAP_33_47_ASCII_SEG7_SYMBOL \ | ||
161 | _MAP_48_57_ASCII_SEG7_NUMERIC \ | ||
162 | _MAP_58_64_ASCII_SEG7_SYMBOL \ | ||
163 | _MAP_65_90_ASCII_SEG7_ALPHA_UPPR \ | ||
164 | _MAP_91_96_ASCII_SEG7_SYMBOL \ | ||
165 | _MAP_97_122_ASCII_SEG7_ALPHA_LOWER \ | ||
166 | _MAP_123_126_ASCII_SEG7_SYMBOL | ||
167 | |||
168 | /* This set tries to map as close as possible to the symbolic characteristics | ||
169 | * of the ASCII character for maximum discrimination. | ||
170 | * For now this means all alpha chars are in lower case representations. | ||
171 | * (This for example facilitates the use of hex numbers with uppercase input.) | ||
172 | */ | ||
173 | #define MAP_ASCII7SEG_ALPHANUM_LC \ | ||
174 | _MAP_0_32_ASCII_SEG7_NON_PRINTABLE \ | ||
175 | _MAP_33_47_ASCII_SEG7_SYMBOL \ | ||
176 | _MAP_48_57_ASCII_SEG7_NUMERIC \ | ||
177 | _MAP_58_64_ASCII_SEG7_SYMBOL \ | ||
178 | _MAP_97_122_ASCII_SEG7_ALPHA_LOWER \ | ||
179 | _MAP_91_96_ASCII_SEG7_SYMBOL \ | ||
180 | _MAP_97_122_ASCII_SEG7_ALPHA_LOWER \ | ||
181 | _MAP_123_126_ASCII_SEG7_SYMBOL | ||
182 | |||
183 | #define SEG7_DEFAULT_MAP(_name) \ | ||
184 | SEG7_CONVERSION_MAP(_name,MAP_ASCII7SEG_ALPHANUM) | ||
185 | |||
186 | #endif /* MAP_TO_7SEGMENT_H */ | ||
187 | |||
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index fdf3967e1397..1fbe14d39521 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -27,16 +27,13 @@ struct mm_struct; | |||
27 | 27 | ||
28 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR | 28 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR |
29 | 29 | ||
30 | #define page_reset_bad_cgroup(page) ((page)->page_cgroup = 0) | ||
31 | |||
32 | extern struct page_cgroup *page_get_page_cgroup(struct page *page); | ||
33 | extern int mem_cgroup_charge(struct page *page, struct mm_struct *mm, | 30 | extern int mem_cgroup_charge(struct page *page, struct mm_struct *mm, |
34 | gfp_t gfp_mask); | 31 | gfp_t gfp_mask); |
35 | extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm, | 32 | extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm, |
36 | gfp_t gfp_mask); | 33 | gfp_t gfp_mask); |
34 | extern void mem_cgroup_move_lists(struct page *page, enum lru_list lru); | ||
37 | extern void mem_cgroup_uncharge_page(struct page *page); | 35 | extern void mem_cgroup_uncharge_page(struct page *page); |
38 | extern void mem_cgroup_uncharge_cache_page(struct page *page); | 36 | extern void mem_cgroup_uncharge_cache_page(struct page *page); |
39 | extern void mem_cgroup_move_lists(struct page *page, bool active); | ||
40 | extern int mem_cgroup_shrink_usage(struct mm_struct *mm, gfp_t gfp_mask); | 37 | extern int mem_cgroup_shrink_usage(struct mm_struct *mm, gfp_t gfp_mask); |
41 | 38 | ||
42 | extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, | 39 | extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, |
@@ -44,7 +41,7 @@ extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, | |||
44 | unsigned long *scanned, int order, | 41 | unsigned long *scanned, int order, |
45 | int mode, struct zone *z, | 42 | int mode, struct zone *z, |
46 | struct mem_cgroup *mem_cont, | 43 | struct mem_cgroup *mem_cont, |
47 | int active); | 44 | int active, int file); |
48 | extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); | 45 | extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); |
49 | int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); | 46 | int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); |
50 | 47 | ||
@@ -69,21 +66,11 @@ extern void mem_cgroup_note_reclaim_priority(struct mem_cgroup *mem, | |||
69 | extern void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem, | 66 | extern void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem, |
70 | int priority); | 67 | int priority); |
71 | 68 | ||
72 | extern long mem_cgroup_calc_reclaim_active(struct mem_cgroup *mem, | 69 | extern long mem_cgroup_calc_reclaim(struct mem_cgroup *mem, struct zone *zone, |
73 | struct zone *zone, int priority); | 70 | int priority, enum lru_list lru); |
74 | extern long mem_cgroup_calc_reclaim_inactive(struct mem_cgroup *mem, | ||
75 | struct zone *zone, int priority); | ||
76 | |||
77 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ | ||
78 | static inline void page_reset_bad_cgroup(struct page *page) | ||
79 | { | ||
80 | } | ||
81 | 71 | ||
82 | static inline struct page_cgroup *page_get_page_cgroup(struct page *page) | ||
83 | { | ||
84 | return NULL; | ||
85 | } | ||
86 | 72 | ||
73 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ | ||
87 | static inline int mem_cgroup_charge(struct page *page, | 74 | static inline int mem_cgroup_charge(struct page *page, |
88 | struct mm_struct *mm, gfp_t gfp_mask) | 75 | struct mm_struct *mm, gfp_t gfp_mask) |
89 | { | 76 | { |
@@ -159,14 +146,9 @@ static inline void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem, | |||
159 | { | 146 | { |
160 | } | 147 | } |
161 | 148 | ||
162 | static inline long mem_cgroup_calc_reclaim_active(struct mem_cgroup *mem, | 149 | static inline long mem_cgroup_calc_reclaim(struct mem_cgroup *mem, |
163 | struct zone *zone, int priority) | 150 | struct zone *zone, int priority, |
164 | { | 151 | enum lru_list lru) |
165 | return 0; | ||
166 | } | ||
167 | |||
168 | static inline long mem_cgroup_calc_reclaim_inactive(struct mem_cgroup *mem, | ||
169 | struct zone *zone, int priority) | ||
170 | { | 152 | { |
171 | return 0; | 153 | return 0; |
172 | } | 154 | } |
diff --git a/include/linux/mfd/da903x.h b/include/linux/mfd/da903x.h new file mode 100644 index 000000000000..cad314c12439 --- /dev/null +++ b/include/linux/mfd/da903x.h | |||
@@ -0,0 +1,201 @@ | |||
1 | #ifndef __LINUX_PMIC_DA903X_H | ||
2 | #define __LINUX_PMIC_DA903X_H | ||
3 | |||
4 | /* Unified sub device IDs for DA9030/DA9034 */ | ||
5 | enum { | ||
6 | DA9030_ID_LED_1, | ||
7 | DA9030_ID_LED_2, | ||
8 | DA9030_ID_LED_3, | ||
9 | DA9030_ID_LED_4, | ||
10 | DA9030_ID_LED_PC, | ||
11 | DA9030_ID_VIBRA, | ||
12 | DA9030_ID_WLED, | ||
13 | DA9030_ID_BUCK1, | ||
14 | DA9030_ID_BUCK2, | ||
15 | DA9030_ID_LDO1, | ||
16 | DA9030_ID_LDO2, | ||
17 | DA9030_ID_LDO3, | ||
18 | DA9030_ID_LDO4, | ||
19 | DA9030_ID_LDO5, | ||
20 | DA9030_ID_LDO6, | ||
21 | DA9030_ID_LDO7, | ||
22 | DA9030_ID_LDO8, | ||
23 | DA9030_ID_LDO9, | ||
24 | DA9030_ID_LDO10, | ||
25 | DA9030_ID_LDO11, | ||
26 | DA9030_ID_LDO12, | ||
27 | DA9030_ID_LDO13, | ||
28 | DA9030_ID_LDO14, | ||
29 | DA9030_ID_LDO15, | ||
30 | DA9030_ID_LDO16, | ||
31 | DA9030_ID_LDO17, | ||
32 | DA9030_ID_LDO18, | ||
33 | DA9030_ID_LDO19, | ||
34 | DA9030_ID_LDO_INT, /* LDO Internal */ | ||
35 | |||
36 | DA9034_ID_LED_1, | ||
37 | DA9034_ID_LED_2, | ||
38 | DA9034_ID_VIBRA, | ||
39 | DA9034_ID_WLED, | ||
40 | DA9034_ID_TOUCH, | ||
41 | |||
42 | DA9034_ID_BUCK1, | ||
43 | DA9034_ID_BUCK2, | ||
44 | DA9034_ID_LDO1, | ||
45 | DA9034_ID_LDO2, | ||
46 | DA9034_ID_LDO3, | ||
47 | DA9034_ID_LDO4, | ||
48 | DA9034_ID_LDO5, | ||
49 | DA9034_ID_LDO6, | ||
50 | DA9034_ID_LDO7, | ||
51 | DA9034_ID_LDO8, | ||
52 | DA9034_ID_LDO9, | ||
53 | DA9034_ID_LDO10, | ||
54 | DA9034_ID_LDO11, | ||
55 | DA9034_ID_LDO12, | ||
56 | DA9034_ID_LDO13, | ||
57 | DA9034_ID_LDO14, | ||
58 | DA9034_ID_LDO15, | ||
59 | }; | ||
60 | |||
61 | /* | ||
62 | * DA9030/DA9034 LEDs sub-devices uses generic "struct led_info" | ||
63 | * as the platform_data | ||
64 | */ | ||
65 | |||
66 | /* DA9030 flags for "struct led_info" | ||
67 | */ | ||
68 | #define DA9030_LED_RATE_ON (0 << 5) | ||
69 | #define DA9030_LED_RATE_052S (1 << 5) | ||
70 | #define DA9030_LED_DUTY_1_16 (0 << 3) | ||
71 | #define DA9030_LED_DUTY_1_8 (1 << 3) | ||
72 | #define DA9030_LED_DUTY_1_4 (2 << 3) | ||
73 | #define DA9030_LED_DUTY_1_2 (3 << 3) | ||
74 | |||
75 | #define DA9030_VIBRA_MODE_1P3V (0 << 1) | ||
76 | #define DA9030_VIBRA_MODE_2P7V (1 << 1) | ||
77 | #define DA9030_VIBRA_FREQ_1HZ (0 << 2) | ||
78 | #define DA9030_VIBRA_FREQ_2HZ (1 << 2) | ||
79 | #define DA9030_VIBRA_FREQ_4HZ (2 << 2) | ||
80 | #define DA9030_VIBRA_FREQ_8HZ (3 << 2) | ||
81 | #define DA9030_VIBRA_DUTY_ON (0 << 4) | ||
82 | #define DA9030_VIBRA_DUTY_75P (1 << 4) | ||
83 | #define DA9030_VIBRA_DUTY_50P (2 << 4) | ||
84 | #define DA9030_VIBRA_DUTY_25P (3 << 4) | ||
85 | |||
86 | /* DA9034 flags for "struct led_info" */ | ||
87 | #define DA9034_LED_RAMP (1 << 7) | ||
88 | |||
89 | /* DA9034 touch screen platform data */ | ||
90 | struct da9034_touch_pdata { | ||
91 | int interval_ms; /* sampling interval while pen down */ | ||
92 | int x_inverted; | ||
93 | int y_inverted; | ||
94 | }; | ||
95 | |||
96 | struct da903x_subdev_info { | ||
97 | int id; | ||
98 | const char *name; | ||
99 | void *platform_data; | ||
100 | }; | ||
101 | |||
102 | struct da903x_platform_data { | ||
103 | int num_subdevs; | ||
104 | struct da903x_subdev_info *subdevs; | ||
105 | }; | ||
106 | |||
107 | /* bit definitions for DA9030 events */ | ||
108 | #define DA9030_EVENT_ONKEY (1 << 0) | ||
109 | #define DA9030_EVENT_PWREN (1 << 1) | ||
110 | #define DA9030_EVENT_EXTON (1 << 2) | ||
111 | #define DA9030_EVENT_CHDET (1 << 3) | ||
112 | #define DA9030_EVENT_TBAT (1 << 4) | ||
113 | #define DA9030_EVENT_VBATMON (1 << 5) | ||
114 | #define DA9030_EVENT_VBATMON_TXON (1 << 6) | ||
115 | #define DA9030_EVENT_CHIOVER (1 << 7) | ||
116 | #define DA9030_EVENT_TCTO (1 << 8) | ||
117 | #define DA9030_EVENT_CCTO (1 << 9) | ||
118 | #define DA9030_EVENT_ADC_READY (1 << 10) | ||
119 | #define DA9030_EVENT_VBUS_4P4 (1 << 11) | ||
120 | #define DA9030_EVENT_VBUS_4P0 (1 << 12) | ||
121 | #define DA9030_EVENT_SESS_VALID (1 << 13) | ||
122 | #define DA9030_EVENT_SRP_DETECT (1 << 14) | ||
123 | #define DA9030_EVENT_WATCHDOG (1 << 15) | ||
124 | #define DA9030_EVENT_LDO15 (1 << 16) | ||
125 | #define DA9030_EVENT_LDO16 (1 << 17) | ||
126 | #define DA9030_EVENT_LDO17 (1 << 18) | ||
127 | #define DA9030_EVENT_LDO18 (1 << 19) | ||
128 | #define DA9030_EVENT_LDO19 (1 << 20) | ||
129 | #define DA9030_EVENT_BUCK2 (1 << 21) | ||
130 | |||
131 | /* bit definitions for DA9034 events */ | ||
132 | #define DA9034_EVENT_ONKEY (1 << 0) | ||
133 | #define DA9034_EVENT_EXTON (1 << 2) | ||
134 | #define DA9034_EVENT_CHDET (1 << 3) | ||
135 | #define DA9034_EVENT_TBAT (1 << 4) | ||
136 | #define DA9034_EVENT_VBATMON (1 << 5) | ||
137 | #define DA9034_EVENT_REV_IOVER (1 << 6) | ||
138 | #define DA9034_EVENT_CH_IOVER (1 << 7) | ||
139 | #define DA9034_EVENT_CH_TCTO (1 << 8) | ||
140 | #define DA9034_EVENT_CH_CCTO (1 << 9) | ||
141 | #define DA9034_EVENT_USB_DEV (1 << 10) | ||
142 | #define DA9034_EVENT_OTGCP_IOVER (1 << 11) | ||
143 | #define DA9034_EVENT_VBUS_4P55 (1 << 12) | ||
144 | #define DA9034_EVENT_VBUS_3P8 (1 << 13) | ||
145 | #define DA9034_EVENT_SESS_1P8 (1 << 14) | ||
146 | #define DA9034_EVENT_SRP_READY (1 << 15) | ||
147 | #define DA9034_EVENT_ADC_MAN (1 << 16) | ||
148 | #define DA9034_EVENT_ADC_AUTO4 (1 << 17) | ||
149 | #define DA9034_EVENT_ADC_AUTO5 (1 << 18) | ||
150 | #define DA9034_EVENT_ADC_AUTO6 (1 << 19) | ||
151 | #define DA9034_EVENT_PEN_DOWN (1 << 20) | ||
152 | #define DA9034_EVENT_TSI_READY (1 << 21) | ||
153 | #define DA9034_EVENT_UART_TX (1 << 22) | ||
154 | #define DA9034_EVENT_UART_RX (1 << 23) | ||
155 | #define DA9034_EVENT_HEADSET (1 << 25) | ||
156 | #define DA9034_EVENT_HOOKSWITCH (1 << 26) | ||
157 | #define DA9034_EVENT_WATCHDOG (1 << 27) | ||
158 | |||
159 | extern int da903x_register_notifier(struct device *dev, | ||
160 | struct notifier_block *nb, unsigned int events); | ||
161 | extern int da903x_unregister_notifier(struct device *dev, | ||
162 | struct notifier_block *nb, unsigned int events); | ||
163 | |||
164 | /* Status Query Interface */ | ||
165 | #define DA9030_STATUS_ONKEY (1 << 0) | ||
166 | #define DA9030_STATUS_PWREN1 (1 << 1) | ||
167 | #define DA9030_STATUS_EXTON (1 << 2) | ||
168 | #define DA9030_STATUS_CHDET (1 << 3) | ||
169 | #define DA9030_STATUS_TBAT (1 << 4) | ||
170 | #define DA9030_STATUS_VBATMON (1 << 5) | ||
171 | #define DA9030_STATUS_VBATMON_TXON (1 << 6) | ||
172 | #define DA9030_STATUS_MCLKDET (1 << 7) | ||
173 | |||
174 | #define DA9034_STATUS_ONKEY (1 << 0) | ||
175 | #define DA9034_STATUS_EXTON (1 << 2) | ||
176 | #define DA9034_STATUS_CHDET (1 << 3) | ||
177 | #define DA9034_STATUS_TBAT (1 << 4) | ||
178 | #define DA9034_STATUS_VBATMON (1 << 5) | ||
179 | #define DA9034_STATUS_PEN_DOWN (1 << 6) | ||
180 | #define DA9034_STATUS_MCLKDET (1 << 7) | ||
181 | #define DA9034_STATUS_USB_DEV (1 << 8) | ||
182 | #define DA9034_STATUS_HEADSET (1 << 9) | ||
183 | #define DA9034_STATUS_HOOKSWITCH (1 << 10) | ||
184 | #define DA9034_STATUS_REMCON (1 << 11) | ||
185 | #define DA9034_STATUS_VBUS_VALID_4P55 (1 << 12) | ||
186 | #define DA9034_STATUS_VBUS_VALID_3P8 (1 << 13) | ||
187 | #define DA9034_STATUS_SESS_VALID_1P8 (1 << 14) | ||
188 | #define DA9034_STATUS_SRP_READY (1 << 15) | ||
189 | |||
190 | extern int da903x_query_status(struct device *dev, unsigned int status); | ||
191 | |||
192 | |||
193 | /* NOTE: the two functions below are not intended for use outside | ||
194 | * of the DA9034 sub-device drivers | ||
195 | */ | ||
196 | extern int da903x_write(struct device *dev, int reg, uint8_t val); | ||
197 | extern int da903x_read(struct device *dev, int reg, uint8_t *val); | ||
198 | extern int da903x_update(struct device *dev, int reg, uint8_t val, uint8_t mask); | ||
199 | extern int da903x_set_bits(struct device *dev, int reg, uint8_t bit_mask); | ||
200 | extern int da903x_clr_bits(struct device *dev, int reg, uint8_t bit_mask); | ||
201 | #endif /* __LINUX_PMIC_DA903X_H */ | ||
diff --git a/include/linux/mfd/t7l66xb.h b/include/linux/mfd/t7l66xb.h index e83c7f2036f9..b4629818aea5 100644 --- a/include/linux/mfd/t7l66xb.h +++ b/include/linux/mfd/t7l66xb.h | |||
@@ -15,8 +15,6 @@ | |||
15 | #include <linux/mfd/tmio.h> | 15 | #include <linux/mfd/tmio.h> |
16 | 16 | ||
17 | struct t7l66xb_platform_data { | 17 | struct t7l66xb_platform_data { |
18 | int (*enable_clk32k)(struct platform_device *dev); | ||
19 | void (*disable_clk32k)(struct platform_device *dev); | ||
20 | int (*enable)(struct platform_device *dev); | 18 | int (*enable)(struct platform_device *dev); |
21 | int (*disable)(struct platform_device *dev); | 19 | int (*disable)(struct platform_device *dev); |
22 | int (*suspend)(struct platform_device *dev); | 20 | int (*suspend)(struct platform_device *dev); |
diff --git a/include/linux/mfd/tc6387xb.h b/include/linux/mfd/tc6387xb.h index fa06e0610b8e..b4888209494a 100644 --- a/include/linux/mfd/tc6387xb.h +++ b/include/linux/mfd/tc6387xb.h | |||
@@ -11,9 +11,6 @@ | |||
11 | #define MFD_TC6387XB_H | 11 | #define MFD_TC6387XB_H |
12 | 12 | ||
13 | struct tc6387xb_platform_data { | 13 | struct tc6387xb_platform_data { |
14 | int (*enable_clk32k)(struct platform_device *dev); | ||
15 | void (*disable_clk32k)(struct platform_device *dev); | ||
16 | |||
17 | int (*enable)(struct platform_device *dev); | 14 | int (*enable)(struct platform_device *dev); |
18 | int (*disable)(struct platform_device *dev); | 15 | int (*disable)(struct platform_device *dev); |
19 | int (*suspend)(struct platform_device *dev); | 16 | int (*suspend)(struct platform_device *dev); |
diff --git a/include/linux/mfd/tc6393xb.h b/include/linux/mfd/tc6393xb.h index fec7b3f7a81f..626e448205c5 100644 --- a/include/linux/mfd/tc6393xb.h +++ b/include/linux/mfd/tc6393xb.h | |||
@@ -17,12 +17,12 @@ | |||
17 | #ifndef MFD_TC6393XB_H | 17 | #ifndef MFD_TC6393XB_H |
18 | #define MFD_TC6393XB_H | 18 | #define MFD_TC6393XB_H |
19 | 19 | ||
20 | #include <linux/fb.h> | ||
21 | |||
20 | /* Also one should provide the CK3P6MI clock */ | 22 | /* Also one should provide the CK3P6MI clock */ |
21 | struct tc6393xb_platform_data { | 23 | struct tc6393xb_platform_data { |
22 | u16 scr_pll2cr; /* PLL2 Control */ | 24 | u16 scr_pll2cr; /* PLL2 Control */ |
23 | u16 scr_gper; /* GP Enable */ | 25 | u16 scr_gper; /* GP Enable */ |
24 | u32 scr_gpo_doecr; /* GPO Data OE Control */ | ||
25 | u32 scr_gpo_dsr; /* GPO Data Set */ | ||
26 | 26 | ||
27 | int (*enable)(struct platform_device *dev); | 27 | int (*enable)(struct platform_device *dev); |
28 | int (*disable)(struct platform_device *dev); | 28 | int (*disable)(struct platform_device *dev); |
@@ -31,15 +31,28 @@ struct tc6393xb_platform_data { | |||
31 | 31 | ||
32 | int irq_base; /* base for subdevice irqs */ | 32 | int irq_base; /* base for subdevice irqs */ |
33 | int gpio_base; | 33 | int gpio_base; |
34 | int (*setup)(struct platform_device *dev); | ||
35 | void (*teardown)(struct platform_device *dev); | ||
34 | 36 | ||
35 | struct tmio_nand_data *nand_data; | 37 | struct tmio_nand_data *nand_data; |
38 | struct tmio_fb_data *fb_data; | ||
39 | |||
40 | unsigned resume_restore : 1; /* make special actions | ||
41 | to preserve the state | ||
42 | on suspend/resume */ | ||
36 | }; | 43 | }; |
37 | 44 | ||
45 | extern int tc6393xb_lcd_mode(struct platform_device *fb, | ||
46 | const struct fb_videomode *mode); | ||
47 | extern int tc6393xb_lcd_set_power(struct platform_device *fb, bool on); | ||
48 | |||
38 | /* | 49 | /* |
39 | * Relative to irq_base | 50 | * Relative to irq_base |
40 | */ | 51 | */ |
41 | #define IRQ_TC6393_NAND 0 | 52 | #define IRQ_TC6393_NAND 0 |
42 | #define IRQ_TC6393_MMC 1 | 53 | #define IRQ_TC6393_MMC 1 |
54 | #define IRQ_TC6393_OHCI 2 | ||
55 | #define IRQ_TC6393_FB 4 | ||
43 | 56 | ||
44 | #define TC6393XB_NR_IRQS 8 | 57 | #define TC6393XB_NR_IRQS 8 |
45 | 58 | ||
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h index ec612e66391c..516d955ab8a1 100644 --- a/include/linux/mfd/tmio.h +++ b/include/linux/mfd/tmio.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef MFD_TMIO_H | 1 | #ifndef MFD_TMIO_H |
2 | #define MFD_TMIO_H | 2 | #define MFD_TMIO_H |
3 | 3 | ||
4 | #include <linux/fb.h> | ||
5 | |||
4 | #define tmio_ioread8(addr) readb(addr) | 6 | #define tmio_ioread8(addr) readb(addr) |
5 | #define tmio_ioread16(addr) readw(addr) | 7 | #define tmio_ioread16(addr) readw(addr) |
6 | #define tmio_ioread16_rep(r, b, l) readsw(r, b, l) | 8 | #define tmio_ioread16_rep(r, b, l) readsw(r, b, l) |
@@ -25,4 +27,21 @@ struct tmio_nand_data { | |||
25 | unsigned int num_partitions; | 27 | unsigned int num_partitions; |
26 | }; | 28 | }; |
27 | 29 | ||
30 | #define FBIO_TMIO_ACC_WRITE 0x7C639300 | ||
31 | #define FBIO_TMIO_ACC_SYNC 0x7C639301 | ||
32 | |||
33 | struct tmio_fb_data { | ||
34 | int (*lcd_set_power)(struct platform_device *fb_dev, | ||
35 | bool on); | ||
36 | int (*lcd_mode)(struct platform_device *fb_dev, | ||
37 | const struct fb_videomode *mode); | ||
38 | int num_modes; | ||
39 | struct fb_videomode *modes; | ||
40 | |||
41 | /* in mm: size of screen */ | ||
42 | int height; | ||
43 | int width; | ||
44 | }; | ||
45 | |||
46 | |||
28 | #endif | 47 | #endif |
diff --git a/include/linux/migrate.h b/include/linux/migrate.h index 03aea612d284..3f34005068d4 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h | |||
@@ -7,7 +7,6 @@ | |||
7 | typedef struct page *new_page_t(struct page *, unsigned long private, int **); | 7 | typedef struct page *new_page_t(struct page *, unsigned long private, int **); |
8 | 8 | ||
9 | #ifdef CONFIG_MIGRATION | 9 | #ifdef CONFIG_MIGRATION |
10 | extern int isolate_lru_page(struct page *p, struct list_head *pagelist); | ||
11 | extern int putback_lru_pages(struct list_head *l); | 10 | extern int putback_lru_pages(struct list_head *l); |
12 | extern int migrate_page(struct address_space *, | 11 | extern int migrate_page(struct address_space *, |
13 | struct page *, struct page *); | 12 | struct page *, struct page *); |
@@ -21,8 +20,6 @@ extern int migrate_vmas(struct mm_struct *mm, | |||
21 | const nodemask_t *from, const nodemask_t *to, | 20 | const nodemask_t *from, const nodemask_t *to, |
22 | unsigned long flags); | 21 | unsigned long flags); |
23 | #else | 22 | #else |
24 | static inline int isolate_lru_page(struct page *p, struct list_head *list) | ||
25 | { return -ENOSYS; } | ||
26 | static inline int putback_lru_pages(struct list_head *l) { return 0; } | 23 | static inline int putback_lru_pages(struct list_head *l) { return 0; } |
27 | static inline int migrate_pages(struct list_head *l, new_page_t x, | 24 | static inline int migrate_pages(struct list_head *l, new_page_t x, |
28 | unsigned long private) { return -ENOSYS; } | 25 | unsigned long private) { return -ENOSYS; } |
diff --git a/include/linux/mm.h b/include/linux/mm.h index c61ba10768ea..ffee2f743418 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -132,6 +132,11 @@ extern unsigned int kobjsize(const void *objp); | |||
132 | #define VM_RandomReadHint(v) ((v)->vm_flags & VM_RAND_READ) | 132 | #define VM_RandomReadHint(v) ((v)->vm_flags & VM_RAND_READ) |
133 | 133 | ||
134 | /* | 134 | /* |
135 | * special vmas that are non-mergable, non-mlock()able | ||
136 | */ | ||
137 | #define VM_SPECIAL (VM_IO | VM_DONTEXPAND | VM_RESERVED | VM_PFNMAP) | ||
138 | |||
139 | /* | ||
135 | * mapping from the currently active vm_flags protection bits (the | 140 | * mapping from the currently active vm_flags protection bits (the |
136 | * low four bits) to a page protection mask.. | 141 | * low four bits) to a page protection mask.. |
137 | */ | 142 | */ |
@@ -700,10 +705,10 @@ static inline int page_mapped(struct page *page) | |||
700 | extern void show_free_areas(void); | 705 | extern void show_free_areas(void); |
701 | 706 | ||
702 | #ifdef CONFIG_SHMEM | 707 | #ifdef CONFIG_SHMEM |
703 | int shmem_lock(struct file *file, int lock, struct user_struct *user); | 708 | extern int shmem_lock(struct file *file, int lock, struct user_struct *user); |
704 | #else | 709 | #else |
705 | static inline int shmem_lock(struct file *file, int lock, | 710 | static inline int shmem_lock(struct file *file, int lock, |
706 | struct user_struct *user) | 711 | struct user_struct *user) |
707 | { | 712 | { |
708 | return 0; | 713 | return 0; |
709 | } | 714 | } |
diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h index 895bc4e93039..c948350c378e 100644 --- a/include/linux/mm_inline.h +++ b/include/linux/mm_inline.h | |||
@@ -1,40 +1,100 @@ | |||
1 | static inline void | 1 | #ifndef LINUX_MM_INLINE_H |
2 | add_page_to_active_list(struct zone *zone, struct page *page) | 2 | #define LINUX_MM_INLINE_H |
3 | { | ||
4 | list_add(&page->lru, &zone->active_list); | ||
5 | __inc_zone_state(zone, NR_ACTIVE); | ||
6 | } | ||
7 | 3 | ||
8 | static inline void | 4 | /** |
9 | add_page_to_inactive_list(struct zone *zone, struct page *page) | 5 | * page_is_file_cache - should the page be on a file LRU or anon LRU? |
6 | * @page: the page to test | ||
7 | * | ||
8 | * Returns LRU_FILE if @page is page cache page backed by a regular filesystem, | ||
9 | * or 0 if @page is anonymous, tmpfs or otherwise ram or swap backed. | ||
10 | * Used by functions that manipulate the LRU lists, to sort a page | ||
11 | * onto the right LRU list. | ||
12 | * | ||
13 | * We would like to get this info without a page flag, but the state | ||
14 | * needs to survive until the page is last deleted from the LRU, which | ||
15 | * could be as far down as __page_cache_release. | ||
16 | */ | ||
17 | static inline int page_is_file_cache(struct page *page) | ||
10 | { | 18 | { |
11 | list_add(&page->lru, &zone->inactive_list); | 19 | if (PageSwapBacked(page)) |
12 | __inc_zone_state(zone, NR_INACTIVE); | 20 | return 0; |
21 | |||
22 | /* The page is page cache backed by a normal filesystem. */ | ||
23 | return LRU_FILE; | ||
13 | } | 24 | } |
14 | 25 | ||
15 | static inline void | 26 | static inline void |
16 | del_page_from_active_list(struct zone *zone, struct page *page) | 27 | add_page_to_lru_list(struct zone *zone, struct page *page, enum lru_list l) |
17 | { | 28 | { |
18 | list_del(&page->lru); | 29 | list_add(&page->lru, &zone->lru[l].list); |
19 | __dec_zone_state(zone, NR_ACTIVE); | 30 | __inc_zone_state(zone, NR_LRU_BASE + l); |
20 | } | 31 | } |
21 | 32 | ||
22 | static inline void | 33 | static inline void |
23 | del_page_from_inactive_list(struct zone *zone, struct page *page) | 34 | del_page_from_lru_list(struct zone *zone, struct page *page, enum lru_list l) |
24 | { | 35 | { |
25 | list_del(&page->lru); | 36 | list_del(&page->lru); |
26 | __dec_zone_state(zone, NR_INACTIVE); | 37 | __dec_zone_state(zone, NR_LRU_BASE + l); |
27 | } | 38 | } |
28 | 39 | ||
29 | static inline void | 40 | static inline void |
30 | del_page_from_lru(struct zone *zone, struct page *page) | 41 | del_page_from_lru(struct zone *zone, struct page *page) |
31 | { | 42 | { |
43 | enum lru_list l = LRU_BASE; | ||
44 | |||
32 | list_del(&page->lru); | 45 | list_del(&page->lru); |
33 | if (PageActive(page)) { | 46 | if (PageUnevictable(page)) { |
34 | __ClearPageActive(page); | 47 | __ClearPageUnevictable(page); |
35 | __dec_zone_state(zone, NR_ACTIVE); | 48 | l = LRU_UNEVICTABLE; |
36 | } else { | 49 | } else { |
37 | __dec_zone_state(zone, NR_INACTIVE); | 50 | if (PageActive(page)) { |
51 | __ClearPageActive(page); | ||
52 | l += LRU_ACTIVE; | ||
53 | } | ||
54 | l += page_is_file_cache(page); | ||
55 | } | ||
56 | __dec_zone_state(zone, NR_LRU_BASE + l); | ||
57 | } | ||
58 | |||
59 | /** | ||
60 | * page_lru - which LRU list should a page be on? | ||
61 | * @page: the page to test | ||
62 | * | ||
63 | * Returns the LRU list a page should be on, as an index | ||
64 | * into the array of LRU lists. | ||
65 | */ | ||
66 | static inline enum lru_list page_lru(struct page *page) | ||
67 | { | ||
68 | enum lru_list lru = LRU_BASE; | ||
69 | |||
70 | if (PageUnevictable(page)) | ||
71 | lru = LRU_UNEVICTABLE; | ||
72 | else { | ||
73 | if (PageActive(page)) | ||
74 | lru += LRU_ACTIVE; | ||
75 | lru += page_is_file_cache(page); | ||
38 | } | 76 | } |
77 | |||
78 | return lru; | ||
39 | } | 79 | } |
40 | 80 | ||
81 | /** | ||
82 | * inactive_anon_is_low - check if anonymous pages need to be deactivated | ||
83 | * @zone: zone to check | ||
84 | * | ||
85 | * Returns true if the zone does not have enough inactive anon pages, | ||
86 | * meaning some active anon pages need to be deactivated. | ||
87 | */ | ||
88 | static inline int inactive_anon_is_low(struct zone *zone) | ||
89 | { | ||
90 | unsigned long active, inactive; | ||
91 | |||
92 | active = zone_page_state(zone, NR_ACTIVE_ANON); | ||
93 | inactive = zone_page_state(zone, NR_INACTIVE_ANON); | ||
94 | |||
95 | if (inactive * zone->inactive_ratio < active) | ||
96 | return 1; | ||
97 | |||
98 | return 0; | ||
99 | } | ||
100 | #endif | ||
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 9d49fa36bbef..fe825471d5aa 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -94,9 +94,6 @@ struct page { | |||
94 | void *virtual; /* Kernel virtual address (NULL if | 94 | void *virtual; /* Kernel virtual address (NULL if |
95 | not kmapped, ie. highmem) */ | 95 | not kmapped, ie. highmem) */ |
96 | #endif /* WANT_PAGE_VIRTUAL */ | 96 | #endif /* WANT_PAGE_VIRTUAL */ |
97 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR | ||
98 | unsigned long page_cgroup; | ||
99 | #endif | ||
100 | }; | 97 | }; |
101 | 98 | ||
102 | /* | 99 | /* |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 428328a05fa1..35a7b5e19465 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -81,21 +81,31 @@ struct zone_padding { | |||
81 | enum zone_stat_item { | 81 | enum zone_stat_item { |
82 | /* First 128 byte cacheline (assuming 64 bit words) */ | 82 | /* First 128 byte cacheline (assuming 64 bit words) */ |
83 | NR_FREE_PAGES, | 83 | NR_FREE_PAGES, |
84 | NR_INACTIVE, | 84 | NR_LRU_BASE, |
85 | NR_ACTIVE, | 85 | NR_INACTIVE_ANON = NR_LRU_BASE, /* must match order of LRU_[IN]ACTIVE */ |
86 | NR_ACTIVE_ANON, /* " " " " " */ | ||
87 | NR_INACTIVE_FILE, /* " " " " " */ | ||
88 | NR_ACTIVE_FILE, /* " " " " " */ | ||
89 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
90 | NR_UNEVICTABLE, /* " " " " " */ | ||
91 | NR_MLOCK, /* mlock()ed pages found and moved off LRU */ | ||
92 | #else | ||
93 | NR_UNEVICTABLE = NR_ACTIVE_FILE, /* avoid compiler errors in dead code */ | ||
94 | NR_MLOCK = NR_ACTIVE_FILE, | ||
95 | #endif | ||
86 | NR_ANON_PAGES, /* Mapped anonymous pages */ | 96 | NR_ANON_PAGES, /* Mapped anonymous pages */ |
87 | NR_FILE_MAPPED, /* pagecache pages mapped into pagetables. | 97 | NR_FILE_MAPPED, /* pagecache pages mapped into pagetables. |
88 | only modified from process context */ | 98 | only modified from process context */ |
89 | NR_FILE_PAGES, | 99 | NR_FILE_PAGES, |
90 | NR_FILE_DIRTY, | 100 | NR_FILE_DIRTY, |
91 | NR_WRITEBACK, | 101 | NR_WRITEBACK, |
92 | /* Second 128 byte cacheline */ | ||
93 | NR_SLAB_RECLAIMABLE, | 102 | NR_SLAB_RECLAIMABLE, |
94 | NR_SLAB_UNRECLAIMABLE, | 103 | NR_SLAB_UNRECLAIMABLE, |
95 | NR_PAGETABLE, /* used for pagetables */ | 104 | NR_PAGETABLE, /* used for pagetables */ |
96 | NR_UNSTABLE_NFS, /* NFS unstable pages */ | 105 | NR_UNSTABLE_NFS, /* NFS unstable pages */ |
97 | NR_BOUNCE, | 106 | NR_BOUNCE, |
98 | NR_VMSCAN_WRITE, | 107 | NR_VMSCAN_WRITE, |
108 | /* Second 128 byte cacheline */ | ||
99 | NR_WRITEBACK_TEMP, /* Writeback using temporary buffers */ | 109 | NR_WRITEBACK_TEMP, /* Writeback using temporary buffers */ |
100 | #ifdef CONFIG_NUMA | 110 | #ifdef CONFIG_NUMA |
101 | NUMA_HIT, /* allocated in intended node */ | 111 | NUMA_HIT, /* allocated in intended node */ |
@@ -107,6 +117,55 @@ enum zone_stat_item { | |||
107 | #endif | 117 | #endif |
108 | NR_VM_ZONE_STAT_ITEMS }; | 118 | NR_VM_ZONE_STAT_ITEMS }; |
109 | 119 | ||
120 | /* | ||
121 | * We do arithmetic on the LRU lists in various places in the code, | ||
122 | * so it is important to keep the active lists LRU_ACTIVE higher in | ||
123 | * the array than the corresponding inactive lists, and to keep | ||
124 | * the *_FILE lists LRU_FILE higher than the corresponding _ANON lists. | ||
125 | * | ||
126 | * This has to be kept in sync with the statistics in zone_stat_item | ||
127 | * above and the descriptions in vmstat_text in mm/vmstat.c | ||
128 | */ | ||
129 | #define LRU_BASE 0 | ||
130 | #define LRU_ACTIVE 1 | ||
131 | #define LRU_FILE 2 | ||
132 | |||
133 | enum lru_list { | ||
134 | LRU_INACTIVE_ANON = LRU_BASE, | ||
135 | LRU_ACTIVE_ANON = LRU_BASE + LRU_ACTIVE, | ||
136 | LRU_INACTIVE_FILE = LRU_BASE + LRU_FILE, | ||
137 | LRU_ACTIVE_FILE = LRU_BASE + LRU_FILE + LRU_ACTIVE, | ||
138 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
139 | LRU_UNEVICTABLE, | ||
140 | #else | ||
141 | LRU_UNEVICTABLE = LRU_ACTIVE_FILE, /* avoid compiler errors in dead code */ | ||
142 | #endif | ||
143 | NR_LRU_LISTS | ||
144 | }; | ||
145 | |||
146 | #define for_each_lru(l) for (l = 0; l < NR_LRU_LISTS; l++) | ||
147 | |||
148 | #define for_each_evictable_lru(l) for (l = 0; l <= LRU_ACTIVE_FILE; l++) | ||
149 | |||
150 | static inline int is_file_lru(enum lru_list l) | ||
151 | { | ||
152 | return (l == LRU_INACTIVE_FILE || l == LRU_ACTIVE_FILE); | ||
153 | } | ||
154 | |||
155 | static inline int is_active_lru(enum lru_list l) | ||
156 | { | ||
157 | return (l == LRU_ACTIVE_ANON || l == LRU_ACTIVE_FILE); | ||
158 | } | ||
159 | |||
160 | static inline int is_unevictable_lru(enum lru_list l) | ||
161 | { | ||
162 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
163 | return (l == LRU_UNEVICTABLE); | ||
164 | #else | ||
165 | return 0; | ||
166 | #endif | ||
167 | } | ||
168 | |||
110 | struct per_cpu_pages { | 169 | struct per_cpu_pages { |
111 | int count; /* number of pages in the list */ | 170 | int count; /* number of pages in the list */ |
112 | int high; /* high watermark, emptying needed */ | 171 | int high; /* high watermark, emptying needed */ |
@@ -251,10 +310,22 @@ struct zone { | |||
251 | 310 | ||
252 | /* Fields commonly accessed by the page reclaim scanner */ | 311 | /* Fields commonly accessed by the page reclaim scanner */ |
253 | spinlock_t lru_lock; | 312 | spinlock_t lru_lock; |
254 | struct list_head active_list; | 313 | struct { |
255 | struct list_head inactive_list; | 314 | struct list_head list; |
256 | unsigned long nr_scan_active; | 315 | unsigned long nr_scan; |
257 | unsigned long nr_scan_inactive; | 316 | } lru[NR_LRU_LISTS]; |
317 | |||
318 | /* | ||
319 | * The pageout code in vmscan.c keeps track of how many of the | ||
320 | * mem/swap backed and file backed pages are refeferenced. | ||
321 | * The higher the rotated/scanned ratio, the more valuable | ||
322 | * that cache is. | ||
323 | * | ||
324 | * The anon LRU stats live in [0], file LRU stats in [1] | ||
325 | */ | ||
326 | unsigned long recent_rotated[2]; | ||
327 | unsigned long recent_scanned[2]; | ||
328 | |||
258 | unsigned long pages_scanned; /* since last reclaim */ | 329 | unsigned long pages_scanned; /* since last reclaim */ |
259 | unsigned long flags; /* zone flags, see below */ | 330 | unsigned long flags; /* zone flags, see below */ |
260 | 331 | ||
@@ -276,6 +347,12 @@ struct zone { | |||
276 | */ | 347 | */ |
277 | int prev_priority; | 348 | int prev_priority; |
278 | 349 | ||
350 | /* | ||
351 | * The target ratio of ACTIVE_ANON to INACTIVE_ANON pages on | ||
352 | * this zone's LRU. Maintained by the pageout code. | ||
353 | */ | ||
354 | unsigned int inactive_ratio; | ||
355 | |||
279 | 356 | ||
280 | ZONE_PADDING(_pad2_) | 357 | ZONE_PADDING(_pad2_) |
281 | /* Rarely used or read-mostly fields */ | 358 | /* Rarely used or read-mostly fields */ |
@@ -524,8 +601,11 @@ typedef struct pglist_data { | |||
524 | struct zone node_zones[MAX_NR_ZONES]; | 601 | struct zone node_zones[MAX_NR_ZONES]; |
525 | struct zonelist node_zonelists[MAX_ZONELISTS]; | 602 | struct zonelist node_zonelists[MAX_ZONELISTS]; |
526 | int nr_zones; | 603 | int nr_zones; |
527 | #ifdef CONFIG_FLAT_NODE_MEM_MAP | 604 | #ifdef CONFIG_FLAT_NODE_MEM_MAP /* means !SPARSEMEM */ |
528 | struct page *node_mem_map; | 605 | struct page *node_mem_map; |
606 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR | ||
607 | struct page_cgroup *node_page_cgroup; | ||
608 | #endif | ||
529 | #endif | 609 | #endif |
530 | struct bootmem_data *bdata; | 610 | struct bootmem_data *bdata; |
531 | #ifdef CONFIG_MEMORY_HOTPLUG | 611 | #ifdef CONFIG_MEMORY_HOTPLUG |
@@ -854,6 +934,7 @@ static inline unsigned long early_pfn_to_nid(unsigned long pfn) | |||
854 | #endif | 934 | #endif |
855 | 935 | ||
856 | struct page; | 936 | struct page; |
937 | struct page_cgroup; | ||
857 | struct mem_section { | 938 | struct mem_section { |
858 | /* | 939 | /* |
859 | * This is, logically, a pointer to an array of struct | 940 | * This is, logically, a pointer to an array of struct |
@@ -871,6 +952,14 @@ struct mem_section { | |||
871 | 952 | ||
872 | /* See declaration of similar field in struct zone */ | 953 | /* See declaration of similar field in struct zone */ |
873 | unsigned long *pageblock_flags; | 954 | unsigned long *pageblock_flags; |
955 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR | ||
956 | /* | ||
957 | * If !SPARSEMEM, pgdat doesn't have page_cgroup pointer. We use | ||
958 | * section. (see memcontrol.h/page_cgroup.h about this.) | ||
959 | */ | ||
960 | struct page_cgroup *page_cgroup; | ||
961 | unsigned long pad; | ||
962 | #endif | ||
874 | }; | 963 | }; |
875 | 964 | ||
876 | #ifdef CONFIG_SPARSEMEM_EXTREME | 965 | #ifdef CONFIG_SPARSEMEM_EXTREME |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index d6a3f47e95cb..eb71b45fdf5a 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
@@ -284,7 +284,7 @@ struct pcmcia_device_id { | |||
284 | /* Input */ | 284 | /* Input */ |
285 | #define INPUT_DEVICE_ID_EV_MAX 0x1f | 285 | #define INPUT_DEVICE_ID_EV_MAX 0x1f |
286 | #define INPUT_DEVICE_ID_KEY_MIN_INTERESTING 0x71 | 286 | #define INPUT_DEVICE_ID_KEY_MIN_INTERESTING 0x71 |
287 | #define INPUT_DEVICE_ID_KEY_MAX 0x1ff | 287 | #define INPUT_DEVICE_ID_KEY_MAX 0x2ff |
288 | #define INPUT_DEVICE_ID_REL_MAX 0x0f | 288 | #define INPUT_DEVICE_ID_REL_MAX 0x0f |
289 | #define INPUT_DEVICE_ID_ABS_MAX 0x3f | 289 | #define INPUT_DEVICE_ID_ABS_MAX 0x3f |
290 | #define INPUT_DEVICE_ID_MSC_MAX 0x07 | 290 | #define INPUT_DEVICE_ID_MSC_MAX 0x07 |
diff --git a/include/linux/module.h b/include/linux/module.h index 68e09557c951..a41555cbe00a 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -345,7 +345,6 @@ struct module | |||
345 | /* Reference counts */ | 345 | /* Reference counts */ |
346 | struct module_ref ref[NR_CPUS]; | 346 | struct module_ref ref[NR_CPUS]; |
347 | #endif | 347 | #endif |
348 | |||
349 | }; | 348 | }; |
350 | #ifndef MODULE_ARCH_INIT | 349 | #ifndef MODULE_ARCH_INIT |
351 | #define MODULE_ARCH_INIT {} | 350 | #define MODULE_ARCH_INIT {} |
diff --git a/include/linux/mount.h b/include/linux/mount.h index 30a1d63b6fb5..cab2a85e2ee8 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h | |||
@@ -5,8 +5,6 @@ | |||
5 | * | 5 | * |
6 | * Author: Marco van Wieringen <mvw@planets.elm.net> | 6 | * Author: Marco van Wieringen <mvw@planets.elm.net> |
7 | * | 7 | * |
8 | * Version: $Id: mount.h,v 2.0 1996/11/17 16:48:14 mvw Exp mvw $ | ||
9 | * | ||
10 | */ | 8 | */ |
11 | #ifndef _LINUX_MOUNT_H | 9 | #ifndef _LINUX_MOUNT_H |
12 | #define _LINUX_MOUNT_H | 10 | #define _LINUX_MOUNT_H |
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h index d6fb115f5a07..ee5124ec319e 100644 --- a/include/linux/mtd/cfi.h +++ b/include/linux/mtd/cfi.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/mtd/flashchip.h> | 12 | #include <linux/mtd/flashchip.h> |
13 | #include <linux/mtd/map.h> | 13 | #include <linux/mtd/map.h> |
14 | #include <linux/mtd/cfi_endian.h> | 14 | #include <linux/mtd/cfi_endian.h> |
15 | #include <linux/mtd/xip.h> | ||
15 | 16 | ||
16 | #ifdef CONFIG_MTD_CFI_I1 | 17 | #ifdef CONFIG_MTD_CFI_I1 |
17 | #define cfi_interleave(cfi) 1 | 18 | #define cfi_interleave(cfi) 1 |
@@ -430,7 +431,6 @@ static inline uint32_t cfi_send_gen_cmd(u_char cmd, uint32_t cmd_addr, uint32_t | |||
430 | { | 431 | { |
431 | map_word val; | 432 | map_word val; |
432 | uint32_t addr = base + cfi_build_cmd_addr(cmd_addr, cfi_interleave(cfi), type); | 433 | uint32_t addr = base + cfi_build_cmd_addr(cmd_addr, cfi_interleave(cfi), type); |
433 | |||
434 | val = cfi_build_cmd(cmd, map, cfi); | 434 | val = cfi_build_cmd(cmd, map, cfi); |
435 | 435 | ||
436 | if (prev_val) | 436 | if (prev_val) |
@@ -483,6 +483,13 @@ static inline void cfi_udelay(int us) | |||
483 | } | 483 | } |
484 | } | 484 | } |
485 | 485 | ||
486 | int __xipram cfi_qry_present(struct map_info *map, __u32 base, | ||
487 | struct cfi_private *cfi); | ||
488 | int __xipram cfi_qry_mode_on(uint32_t base, struct map_info *map, | ||
489 | struct cfi_private *cfi); | ||
490 | void __xipram cfi_qry_mode_off(uint32_t base, struct map_info *map, | ||
491 | struct cfi_private *cfi); | ||
492 | |||
486 | struct cfi_extquery *cfi_read_pri(struct map_info *map, uint16_t adr, uint16_t size, | 493 | struct cfi_extquery *cfi_read_pri(struct map_info *map, uint16_t adr, uint16_t size, |
487 | const char* name); | 494 | const char* name); |
488 | struct cfi_fixup { | 495 | struct cfi_fixup { |
diff --git a/include/linux/mtd/flashchip.h b/include/linux/mtd/flashchip.h index 08dd131301c1..d4f38c5fd44e 100644 --- a/include/linux/mtd/flashchip.h +++ b/include/linux/mtd/flashchip.h | |||
@@ -73,6 +73,10 @@ struct flchip { | |||
73 | int buffer_write_time; | 73 | int buffer_write_time; |
74 | int erase_time; | 74 | int erase_time; |
75 | 75 | ||
76 | int word_write_time_max; | ||
77 | int buffer_write_time_max; | ||
78 | int erase_time_max; | ||
79 | |||
76 | void *priv; | 80 | void *priv; |
77 | }; | 81 | }; |
78 | 82 | ||
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 922636548558..eae26bb6430a 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
@@ -25,8 +25,10 @@ | |||
25 | #define MTD_ERASE_DONE 0x08 | 25 | #define MTD_ERASE_DONE 0x08 |
26 | #define MTD_ERASE_FAILED 0x10 | 26 | #define MTD_ERASE_FAILED 0x10 |
27 | 27 | ||
28 | #define MTD_FAIL_ADDR_UNKNOWN 0xffffffff | ||
29 | |||
28 | /* If the erase fails, fail_addr might indicate exactly which block failed. If | 30 | /* If the erase fails, fail_addr might indicate exactly which block failed. If |
29 | fail_addr = 0xffffffff, the failure was not at the device level or was not | 31 | fail_addr = MTD_FAIL_ADDR_UNKNOWN, the failure was not at the device level or was not |
30 | specific to any particular block. */ | 32 | specific to any particular block. */ |
31 | struct erase_info { | 33 | struct erase_info { |
32 | struct mtd_info *mtd; | 34 | struct mtd_info *mtd; |
diff --git a/include/linux/mtd/nand-gpio.h b/include/linux/mtd/nand-gpio.h new file mode 100644 index 000000000000..51534e50f7fc --- /dev/null +++ b/include/linux/mtd/nand-gpio.h | |||
@@ -0,0 +1,19 @@ | |||
1 | #ifndef __LINUX_MTD_NAND_GPIO_H | ||
2 | #define __LINUX_MTD_NAND_GPIO_H | ||
3 | |||
4 | #include <linux/mtd/nand.h> | ||
5 | |||
6 | struct gpio_nand_platdata { | ||
7 | int gpio_nce; | ||
8 | int gpio_nwp; | ||
9 | int gpio_cle; | ||
10 | int gpio_ale; | ||
11 | int gpio_rdy; | ||
12 | void (*adjust_parts)(struct gpio_nand_platdata *, size_t); | ||
13 | struct mtd_partition *parts; | ||
14 | unsigned int num_parts; | ||
15 | unsigned int options; | ||
16 | int chip_delay; | ||
17 | }; | ||
18 | |||
19 | #endif | ||
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 81774e5facf4..733d3f3b4eb8 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -248,6 +248,7 @@ struct nand_hw_control { | |||
248 | * @read_page_raw: function to read a raw page without ECC | 248 | * @read_page_raw: function to read a raw page without ECC |
249 | * @write_page_raw: function to write a raw page without ECC | 249 | * @write_page_raw: function to write a raw page without ECC |
250 | * @read_page: function to read a page according to the ecc generator requirements | 250 | * @read_page: function to read a page according to the ecc generator requirements |
251 | * @read_subpage: function to read parts of the page covered by ECC. | ||
251 | * @write_page: function to write a page according to the ecc generator requirements | 252 | * @write_page: function to write a page according to the ecc generator requirements |
252 | * @read_oob: function to read chip OOB data | 253 | * @read_oob: function to read chip OOB data |
253 | * @write_oob: function to write chip OOB data | 254 | * @write_oob: function to write chip OOB data |
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h index d1b310c92eb4..0c6bbe28f38c 100644 --- a/include/linux/mtd/onenand_regs.h +++ b/include/linux/mtd/onenand_regs.h | |||
@@ -152,6 +152,8 @@ | |||
152 | #define ONENAND_SYS_CFG1_INT (1 << 6) | 152 | #define ONENAND_SYS_CFG1_INT (1 << 6) |
153 | #define ONENAND_SYS_CFG1_IOBE (1 << 5) | 153 | #define ONENAND_SYS_CFG1_IOBE (1 << 5) |
154 | #define ONENAND_SYS_CFG1_RDY_CONF (1 << 4) | 154 | #define ONENAND_SYS_CFG1_RDY_CONF (1 << 4) |
155 | #define ONENAND_SYS_CFG1_HF (1 << 2) | ||
156 | #define ONENAND_SYS_CFG1_SYNC_WRITE (1 << 1) | ||
155 | 157 | ||
156 | /* | 158 | /* |
157 | * Controller Status Register F240h (R) | 159 | * Controller Status Register F240h (R) |
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h index 5014f7a9f5df..c92b4d439609 100644 --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h | |||
@@ -73,7 +73,6 @@ struct device; | |||
73 | struct device_node; | 73 | struct device_node; |
74 | 74 | ||
75 | int __devinit of_mtd_parse_partitions(struct device *dev, | 75 | int __devinit of_mtd_parse_partitions(struct device *dev, |
76 | struct mtd_info *mtd, | ||
77 | struct device_node *node, | 76 | struct device_node *node, |
78 | struct mtd_partition **pparts); | 77 | struct mtd_partition **pparts); |
79 | 78 | ||
diff --git a/include/linux/mtd/sh_flctl.h b/include/linux/mtd/sh_flctl.h new file mode 100644 index 000000000000..e77c1cea404d --- /dev/null +++ b/include/linux/mtd/sh_flctl.h | |||
@@ -0,0 +1,125 @@ | |||
1 | /* | ||
2 | * SuperH FLCTL nand controller | ||
3 | * | ||
4 | * Copyright © 2008 Renesas Solutions Corp. | ||
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 as published by | ||
8 | * the Free Software Foundation; version 2 of the License. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
18 | */ | ||
19 | |||
20 | #ifndef __SH_FLCTL_H__ | ||
21 | #define __SH_FLCTL_H__ | ||
22 | |||
23 | #include <linux/mtd/mtd.h> | ||
24 | #include <linux/mtd/nand.h> | ||
25 | #include <linux/mtd/partitions.h> | ||
26 | |||
27 | /* FLCTL registers */ | ||
28 | #define FLCMNCR(f) (f->reg + 0x0) | ||
29 | #define FLCMDCR(f) (f->reg + 0x4) | ||
30 | #define FLCMCDR(f) (f->reg + 0x8) | ||
31 | #define FLADR(f) (f->reg + 0xC) | ||
32 | #define FLADR2(f) (f->reg + 0x3C) | ||
33 | #define FLDATAR(f) (f->reg + 0x10) | ||
34 | #define FLDTCNTR(f) (f->reg + 0x14) | ||
35 | #define FLINTDMACR(f) (f->reg + 0x18) | ||
36 | #define FLBSYTMR(f) (f->reg + 0x1C) | ||
37 | #define FLBSYCNT(f) (f->reg + 0x20) | ||
38 | #define FLDTFIFO(f) (f->reg + 0x24) | ||
39 | #define FLECFIFO(f) (f->reg + 0x28) | ||
40 | #define FLTRCR(f) (f->reg + 0x2C) | ||
41 | #define FL4ECCRESULT0(f) (f->reg + 0x80) | ||
42 | #define FL4ECCRESULT1(f) (f->reg + 0x84) | ||
43 | #define FL4ECCRESULT2(f) (f->reg + 0x88) | ||
44 | #define FL4ECCRESULT3(f) (f->reg + 0x8C) | ||
45 | #define FL4ECCCR(f) (f->reg + 0x90) | ||
46 | #define FL4ECCCNT(f) (f->reg + 0x94) | ||
47 | #define FLERRADR(f) (f->reg + 0x98) | ||
48 | |||
49 | /* FLCMNCR control bits */ | ||
50 | #define ECCPOS2 (0x1 << 25) | ||
51 | #define _4ECCCNTEN (0x1 << 24) | ||
52 | #define _4ECCEN (0x1 << 23) | ||
53 | #define _4ECCCORRECT (0x1 << 22) | ||
54 | #define SNAND_E (0x1 << 18) /* SNAND (0=512 1=2048)*/ | ||
55 | #define QTSEL_E (0x1 << 17) | ||
56 | #define ENDIAN (0x1 << 16) /* 1 = little endian */ | ||
57 | #define FCKSEL_E (0x1 << 15) | ||
58 | #define ECCPOS_00 (0x00 << 12) | ||
59 | #define ECCPOS_01 (0x01 << 12) | ||
60 | #define ECCPOS_02 (0x02 << 12) | ||
61 | #define ACM_SACCES_MODE (0x01 << 10) | ||
62 | #define NANWF_E (0x1 << 9) | ||
63 | #define SE_D (0x1 << 8) /* Spare area disable */ | ||
64 | #define CE1_ENABLE (0x1 << 4) /* Chip Enable 1 */ | ||
65 | #define CE0_ENABLE (0x1 << 3) /* Chip Enable 0 */ | ||
66 | #define TYPESEL_SET (0x1 << 0) | ||
67 | |||
68 | /* FLCMDCR control bits */ | ||
69 | #define ADRCNT2_E (0x1 << 31) /* 5byte address enable */ | ||
70 | #define ADRMD_E (0x1 << 26) /* Sector address access */ | ||
71 | #define CDSRC_E (0x1 << 25) /* Data buffer selection */ | ||
72 | #define DOSR_E (0x1 << 24) /* Status read check */ | ||
73 | #define SELRW (0x1 << 21) /* 0:read 1:write */ | ||
74 | #define DOADR_E (0x1 << 20) /* Address stage execute */ | ||
75 | #define ADRCNT_1 (0x00 << 18) /* Address data bytes: 1byte */ | ||
76 | #define ADRCNT_2 (0x01 << 18) /* Address data bytes: 2byte */ | ||
77 | #define ADRCNT_3 (0x02 << 18) /* Address data bytes: 3byte */ | ||
78 | #define ADRCNT_4 (0x03 << 18) /* Address data bytes: 4byte */ | ||
79 | #define DOCMD2_E (0x1 << 17) /* 2nd cmd stage execute */ | ||
80 | #define DOCMD1_E (0x1 << 16) /* 1st cmd stage execute */ | ||
81 | |||
82 | /* FLTRCR control bits */ | ||
83 | #define TRSTRT (0x1 << 0) /* translation start */ | ||
84 | #define TREND (0x1 << 1) /* translation end */ | ||
85 | |||
86 | /* FL4ECCCR control bits */ | ||
87 | #define _4ECCFA (0x1 << 2) /* 4 symbols correct fault */ | ||
88 | #define _4ECCEND (0x1 << 1) /* 4 symbols end */ | ||
89 | #define _4ECCEXST (0x1 << 0) /* 4 symbols exist */ | ||
90 | |||
91 | #define INIT_FL4ECCRESULT_VAL 0x03FF03FF | ||
92 | #define LOOP_TIMEOUT_MAX 0x00010000 | ||
93 | |||
94 | #define mtd_to_flctl(mtd) container_of(mtd, struct sh_flctl, mtd) | ||
95 | |||
96 | struct sh_flctl { | ||
97 | struct mtd_info mtd; | ||
98 | struct nand_chip chip; | ||
99 | void __iomem *reg; | ||
100 | |||
101 | uint8_t done_buff[2048 + 64]; /* max size 2048 + 64 */ | ||
102 | int read_bytes; | ||
103 | int index; | ||
104 | int seqin_column; /* column in SEQIN cmd */ | ||
105 | int seqin_page_addr; /* page_addr in SEQIN cmd */ | ||
106 | uint32_t seqin_read_cmd; /* read cmd in SEQIN cmd */ | ||
107 | int erase1_page_addr; /* page_addr in ERASE1 cmd */ | ||
108 | uint32_t erase_ADRCNT; /* bits of FLCMDCR in ERASE1 cmd */ | ||
109 | uint32_t rw_ADRCNT; /* bits of FLCMDCR in READ WRITE cmd */ | ||
110 | |||
111 | int hwecc_cant_correct[4]; | ||
112 | |||
113 | unsigned page_size:1; /* NAND page size (0 = 512, 1 = 2048) */ | ||
114 | unsigned hwecc:1; /* Hardware ECC (0 = disabled, 1 = enabled) */ | ||
115 | }; | ||
116 | |||
117 | struct sh_flctl_platform_data { | ||
118 | struct mtd_partition *parts; | ||
119 | int nr_parts; | ||
120 | unsigned long flcmncr_val; | ||
121 | |||
122 | unsigned has_hwecc:1; | ||
123 | }; | ||
124 | |||
125 | #endif /* __SH_FLCTL_H__ */ | ||
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index 0d8424f76899..7d8e0455ccac 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h | |||
@@ -78,6 +78,9 @@ extern int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, | |||
78 | int echo); | 78 | int echo); |
79 | extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags); | 79 | extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags); |
80 | 80 | ||
81 | extern void nfnl_lock(void); | ||
82 | extern void nfnl_unlock(void); | ||
83 | |||
81 | #define MODULE_ALIAS_NFNL_SUBSYS(subsys) \ | 84 | #define MODULE_ALIAS_NFNL_SUBSYS(subsys) \ |
82 | MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys)) | 85 | MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys)) |
83 | 86 | ||
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 78a5922a2f11..4eaa8347a0d9 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -137,7 +137,7 @@ struct nfs_inode { | |||
137 | unsigned long attrtimeo_timestamp; | 137 | unsigned long attrtimeo_timestamp; |
138 | __u64 change_attr; /* v4 only */ | 138 | __u64 change_attr; /* v4 only */ |
139 | 139 | ||
140 | unsigned long last_updated; | 140 | unsigned long attr_gencount; |
141 | /* "Generation counter" for the attribute cache. This is | 141 | /* "Generation counter" for the attribute cache. This is |
142 | * bumped whenever we update the metadata on the | 142 | * bumped whenever we update the metadata on the |
143 | * server. | 143 | * server. |
@@ -200,11 +200,10 @@ struct nfs_inode { | |||
200 | /* | 200 | /* |
201 | * Bit offsets in flags field | 201 | * Bit offsets in flags field |
202 | */ | 202 | */ |
203 | #define NFS_INO_REVALIDATING (0) /* revalidating attrs */ | 203 | #define NFS_INO_ADVISE_RDPLUS (0) /* advise readdirplus */ |
204 | #define NFS_INO_ADVISE_RDPLUS (1) /* advise readdirplus */ | 204 | #define NFS_INO_STALE (1) /* possible stale inode */ |
205 | #define NFS_INO_STALE (2) /* possible stale inode */ | 205 | #define NFS_INO_ACL_LRU_SET (2) /* Inode is on the LRU list */ |
206 | #define NFS_INO_ACL_LRU_SET (3) /* Inode is on the LRU list */ | 206 | #define NFS_INO_MOUNTPOINT (3) /* inode is remote mountpoint */ |
207 | #define NFS_INO_MOUNTPOINT (4) /* inode is remote mountpoint */ | ||
208 | 207 | ||
209 | static inline struct nfs_inode *NFS_I(const struct inode *inode) | 208 | static inline struct nfs_inode *NFS_I(const struct inode *inode) |
210 | { | 209 | { |
@@ -345,15 +344,11 @@ extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ct | |||
345 | extern void put_nfs_open_context(struct nfs_open_context *ctx); | 344 | extern void put_nfs_open_context(struct nfs_open_context *ctx); |
346 | extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, int mode); | 345 | extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, int mode); |
347 | extern u64 nfs_compat_user_ino64(u64 fileid); | 346 | extern u64 nfs_compat_user_ino64(u64 fileid); |
347 | extern void nfs_fattr_init(struct nfs_fattr *fattr); | ||
348 | 348 | ||
349 | /* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ | 349 | /* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ |
350 | extern __be32 root_nfs_parse_addr(char *name); /*__init*/ | 350 | extern __be32 root_nfs_parse_addr(char *name); /*__init*/ |
351 | 351 | extern unsigned long nfs_inc_attr_generation_counter(void); | |
352 | static inline void nfs_fattr_init(struct nfs_fattr *fattr) | ||
353 | { | ||
354 | fattr->valid = 0; | ||
355 | fattr->time_start = jiffies; | ||
356 | } | ||
357 | 352 | ||
358 | /* | 353 | /* |
359 | * linux/fs/nfs/file.c | 354 | * linux/fs/nfs/file.c |
@@ -372,8 +367,12 @@ static inline struct nfs_open_context *nfs_file_open_context(struct file *filp) | |||
372 | 367 | ||
373 | static inline struct rpc_cred *nfs_file_cred(struct file *file) | 368 | static inline struct rpc_cred *nfs_file_cred(struct file *file) |
374 | { | 369 | { |
375 | if (file != NULL) | 370 | if (file != NULL) { |
376 | return nfs_file_open_context(file)->cred; | 371 | struct nfs_open_context *ctx = |
372 | nfs_file_open_context(file); | ||
373 | if (ctx) | ||
374 | return ctx->cred; | ||
375 | } | ||
377 | return NULL; | 376 | return NULL; |
378 | } | 377 | } |
379 | 378 | ||
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index c9beacd16c00..4e477ae58699 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
@@ -119,7 +119,6 @@ struct nfs_server { | |||
119 | void (*destroy)(struct nfs_server *); | 119 | void (*destroy)(struct nfs_server *); |
120 | 120 | ||
121 | atomic_t active; /* Keep trace of any activity to this server */ | 121 | atomic_t active; /* Keep trace of any activity to this server */ |
122 | wait_queue_head_t active_wq; /* Wait for any activity to stop */ | ||
123 | 122 | ||
124 | /* mountd-related mount options */ | 123 | /* mountd-related mount options */ |
125 | struct sockaddr_storage mountd_address; | 124 | struct sockaddr_storage mountd_address; |
diff --git a/include/linux/nfs_mount.h b/include/linux/nfs_mount.h index df7c6b7a7ebb..6549a06ac16e 100644 --- a/include/linux/nfs_mount.h +++ b/include/linux/nfs_mount.h | |||
@@ -65,4 +65,8 @@ struct nfs_mount_data { | |||
65 | #define NFS_MOUNT_UNSHARED 0x8000 /* 5 */ | 65 | #define NFS_MOUNT_UNSHARED 0x8000 /* 5 */ |
66 | #define NFS_MOUNT_FLAGMASK 0xFFFF | 66 | #define NFS_MOUNT_FLAGMASK 0xFFFF |
67 | 67 | ||
68 | /* The following are for internal use only */ | ||
69 | #define NFS_MOUNT_LOOKUP_CACHE_NONEG 0x10000 | ||
70 | #define NFS_MOUNT_LOOKUP_CACHE_NONE 0x20000 | ||
71 | |||
68 | #endif | 72 | #endif |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 8c77c11224d1..c1c31acb8a2b 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -36,6 +36,7 @@ struct nfs_fattr { | |||
36 | __u32 nlink; | 36 | __u32 nlink; |
37 | __u32 uid; | 37 | __u32 uid; |
38 | __u32 gid; | 38 | __u32 gid; |
39 | dev_t rdev; | ||
39 | __u64 size; | 40 | __u64 size; |
40 | union { | 41 | union { |
41 | struct { | 42 | struct { |
@@ -46,7 +47,6 @@ struct nfs_fattr { | |||
46 | __u64 used; | 47 | __u64 used; |
47 | } nfs3; | 48 | } nfs3; |
48 | } du; | 49 | } du; |
49 | dev_t rdev; | ||
50 | struct nfs_fsid fsid; | 50 | struct nfs_fsid fsid; |
51 | __u64 fileid; | 51 | __u64 fileid; |
52 | struct timespec atime; | 52 | struct timespec atime; |
@@ -56,6 +56,7 @@ struct nfs_fattr { | |||
56 | __u64 change_attr; /* NFSv4 change attribute */ | 56 | __u64 change_attr; /* NFSv4 change attribute */ |
57 | __u64 pre_change_attr;/* pre-op NFSv4 change attribute */ | 57 | __u64 pre_change_attr;/* pre-op NFSv4 change attribute */ |
58 | unsigned long time_start; | 58 | unsigned long time_start; |
59 | unsigned long gencount; | ||
59 | }; | 60 | }; |
60 | 61 | ||
61 | #define NFS_ATTR_WCC 0x0001 /* pre-op WCC data */ | 62 | #define NFS_ATTR_WCC 0x0001 /* pre-op WCC data */ |
@@ -672,16 +673,16 @@ struct nfs4_rename_res { | |||
672 | struct nfs_fattr * new_fattr; | 673 | struct nfs_fattr * new_fattr; |
673 | }; | 674 | }; |
674 | 675 | ||
675 | #define NFS4_SETCLIENTID_NAMELEN (56) | 676 | #define NFS4_SETCLIENTID_NAMELEN (127) |
676 | struct nfs4_setclientid { | 677 | struct nfs4_setclientid { |
677 | const nfs4_verifier * sc_verifier; | 678 | const nfs4_verifier * sc_verifier; |
678 | unsigned int sc_name_len; | 679 | unsigned int sc_name_len; |
679 | char sc_name[NFS4_SETCLIENTID_NAMELEN]; | 680 | char sc_name[NFS4_SETCLIENTID_NAMELEN + 1]; |
680 | u32 sc_prog; | 681 | u32 sc_prog; |
681 | unsigned int sc_netid_len; | 682 | unsigned int sc_netid_len; |
682 | char sc_netid[RPCBIND_MAXNETIDLEN]; | 683 | char sc_netid[RPCBIND_MAXNETIDLEN + 1]; |
683 | unsigned int sc_uaddr_len; | 684 | unsigned int sc_uaddr_len; |
684 | char sc_uaddr[RPCBIND_MAXUADDRLEN]; | 685 | char sc_uaddr[RPCBIND_MAXUADDRLEN + 1]; |
685 | u32 sc_cb_ident; | 686 | u32 sc_cb_ident; |
686 | }; | 687 | }; |
687 | 688 | ||
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index c74d3e875314..b12f93a3c345 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -93,6 +93,11 @@ enum pageflags { | |||
93 | PG_mappedtodisk, /* Has blocks allocated on-disk */ | 93 | PG_mappedtodisk, /* Has blocks allocated on-disk */ |
94 | PG_reclaim, /* To be reclaimed asap */ | 94 | PG_reclaim, /* To be reclaimed asap */ |
95 | PG_buddy, /* Page is free, on buddy lists */ | 95 | PG_buddy, /* Page is free, on buddy lists */ |
96 | PG_swapbacked, /* Page is backed by RAM/swap */ | ||
97 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
98 | PG_unevictable, /* Page is "unevictable" */ | ||
99 | PG_mlocked, /* Page is vma mlocked */ | ||
100 | #endif | ||
96 | #ifdef CONFIG_IA64_UNCACHED_ALLOCATOR | 101 | #ifdef CONFIG_IA64_UNCACHED_ALLOCATOR |
97 | PG_uncached, /* Page has been mapped as uncached */ | 102 | PG_uncached, /* Page has been mapped as uncached */ |
98 | #endif | 103 | #endif |
@@ -161,6 +166,18 @@ static inline int Page##uname(struct page *page) \ | |||
161 | #define TESTSCFLAG(uname, lname) \ | 166 | #define TESTSCFLAG(uname, lname) \ |
162 | TESTSETFLAG(uname, lname) TESTCLEARFLAG(uname, lname) | 167 | TESTSETFLAG(uname, lname) TESTCLEARFLAG(uname, lname) |
163 | 168 | ||
169 | #define SETPAGEFLAG_NOOP(uname) \ | ||
170 | static inline void SetPage##uname(struct page *page) { } | ||
171 | |||
172 | #define CLEARPAGEFLAG_NOOP(uname) \ | ||
173 | static inline void ClearPage##uname(struct page *page) { } | ||
174 | |||
175 | #define __CLEARPAGEFLAG_NOOP(uname) \ | ||
176 | static inline void __ClearPage##uname(struct page *page) { } | ||
177 | |||
178 | #define TESTCLEARFLAG_FALSE(uname) \ | ||
179 | static inline int TestClearPage##uname(struct page *page) { return 0; } | ||
180 | |||
164 | struct page; /* forward declaration */ | 181 | struct page; /* forward declaration */ |
165 | 182 | ||
166 | TESTPAGEFLAG(Locked, locked) | 183 | TESTPAGEFLAG(Locked, locked) |
@@ -169,6 +186,7 @@ PAGEFLAG(Referenced, referenced) TESTCLEARFLAG(Referenced, referenced) | |||
169 | PAGEFLAG(Dirty, dirty) TESTSCFLAG(Dirty, dirty) __CLEARPAGEFLAG(Dirty, dirty) | 186 | PAGEFLAG(Dirty, dirty) TESTSCFLAG(Dirty, dirty) __CLEARPAGEFLAG(Dirty, dirty) |
170 | PAGEFLAG(LRU, lru) __CLEARPAGEFLAG(LRU, lru) | 187 | PAGEFLAG(LRU, lru) __CLEARPAGEFLAG(LRU, lru) |
171 | PAGEFLAG(Active, active) __CLEARPAGEFLAG(Active, active) | 188 | PAGEFLAG(Active, active) __CLEARPAGEFLAG(Active, active) |
189 | TESTCLEARFLAG(Active, active) | ||
172 | __PAGEFLAG(Slab, slab) | 190 | __PAGEFLAG(Slab, slab) |
173 | PAGEFLAG(Checked, checked) /* Used by some filesystems */ | 191 | PAGEFLAG(Checked, checked) /* Used by some filesystems */ |
174 | PAGEFLAG(Pinned, pinned) TESTSCFLAG(Pinned, pinned) /* Xen */ | 192 | PAGEFLAG(Pinned, pinned) TESTSCFLAG(Pinned, pinned) /* Xen */ |
@@ -176,6 +194,7 @@ PAGEFLAG(SavePinned, savepinned); /* Xen */ | |||
176 | PAGEFLAG(Reserved, reserved) __CLEARPAGEFLAG(Reserved, reserved) | 194 | PAGEFLAG(Reserved, reserved) __CLEARPAGEFLAG(Reserved, reserved) |
177 | PAGEFLAG(Private, private) __CLEARPAGEFLAG(Private, private) | 195 | PAGEFLAG(Private, private) __CLEARPAGEFLAG(Private, private) |
178 | __SETPAGEFLAG(Private, private) | 196 | __SETPAGEFLAG(Private, private) |
197 | PAGEFLAG(SwapBacked, swapbacked) __CLEARPAGEFLAG(SwapBacked, swapbacked) | ||
179 | 198 | ||
180 | __PAGEFLAG(SlobPage, slob_page) | 199 | __PAGEFLAG(SlobPage, slob_page) |
181 | __PAGEFLAG(SlobFree, slob_free) | 200 | __PAGEFLAG(SlobFree, slob_free) |
@@ -211,6 +230,25 @@ PAGEFLAG(SwapCache, swapcache) | |||
211 | PAGEFLAG_FALSE(SwapCache) | 230 | PAGEFLAG_FALSE(SwapCache) |
212 | #endif | 231 | #endif |
213 | 232 | ||
233 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
234 | PAGEFLAG(Unevictable, unevictable) __CLEARPAGEFLAG(Unevictable, unevictable) | ||
235 | TESTCLEARFLAG(Unevictable, unevictable) | ||
236 | |||
237 | #define MLOCK_PAGES 1 | ||
238 | PAGEFLAG(Mlocked, mlocked) __CLEARPAGEFLAG(Mlocked, mlocked) | ||
239 | TESTSCFLAG(Mlocked, mlocked) | ||
240 | |||
241 | #else | ||
242 | |||
243 | #define MLOCK_PAGES 0 | ||
244 | PAGEFLAG_FALSE(Mlocked) | ||
245 | SETPAGEFLAG_NOOP(Mlocked) TESTCLEARFLAG_FALSE(Mlocked) | ||
246 | |||
247 | PAGEFLAG_FALSE(Unevictable) TESTCLEARFLAG_FALSE(Unevictable) | ||
248 | SETPAGEFLAG_NOOP(Unevictable) CLEARPAGEFLAG_NOOP(Unevictable) | ||
249 | __CLEARPAGEFLAG_NOOP(Unevictable) | ||
250 | #endif | ||
251 | |||
214 | #ifdef CONFIG_IA64_UNCACHED_ALLOCATOR | 252 | #ifdef CONFIG_IA64_UNCACHED_ALLOCATOR |
215 | PAGEFLAG(Uncached, uncached) | 253 | PAGEFLAG(Uncached, uncached) |
216 | #else | 254 | #else |
@@ -326,15 +364,25 @@ static inline void __ClearPageTail(struct page *page) | |||
326 | 364 | ||
327 | #endif /* !PAGEFLAGS_EXTENDED */ | 365 | #endif /* !PAGEFLAGS_EXTENDED */ |
328 | 366 | ||
367 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
368 | #define __PG_UNEVICTABLE (1 << PG_unevictable) | ||
369 | #define __PG_MLOCKED (1 << PG_mlocked) | ||
370 | #else | ||
371 | #define __PG_UNEVICTABLE 0 | ||
372 | #define __PG_MLOCKED 0 | ||
373 | #endif | ||
374 | |||
329 | #define PAGE_FLAGS (1 << PG_lru | 1 << PG_private | 1 << PG_locked | \ | 375 | #define PAGE_FLAGS (1 << PG_lru | 1 << PG_private | 1 << PG_locked | \ |
330 | 1 << PG_buddy | 1 << PG_writeback | \ | 376 | 1 << PG_buddy | 1 << PG_writeback | \ |
331 | 1 << PG_slab | 1 << PG_swapcache | 1 << PG_active) | 377 | 1 << PG_slab | 1 << PG_swapcache | 1 << PG_active | \ |
378 | __PG_UNEVICTABLE | __PG_MLOCKED) | ||
332 | 379 | ||
333 | /* | 380 | /* |
334 | * Flags checked in bad_page(). Pages on the free list should not have | 381 | * Flags checked in bad_page(). Pages on the free list should not have |
335 | * these flags set. It they are, there is a problem. | 382 | * these flags set. It they are, there is a problem. |
336 | */ | 383 | */ |
337 | #define PAGE_FLAGS_CLEAR_WHEN_BAD (PAGE_FLAGS | 1 << PG_reclaim | 1 << PG_dirty) | 384 | #define PAGE_FLAGS_CLEAR_WHEN_BAD (PAGE_FLAGS | \ |
385 | 1 << PG_reclaim | 1 << PG_dirty | 1 << PG_swapbacked) | ||
338 | 386 | ||
339 | /* | 387 | /* |
340 | * Flags checked when a page is freed. Pages being freed should not have | 388 | * Flags checked when a page is freed. Pages being freed should not have |
@@ -347,7 +395,8 @@ static inline void __ClearPageTail(struct page *page) | |||
347 | * Pages being prepped should not have these flags set. It they are, there | 395 | * Pages being prepped should not have these flags set. It they are, there |
348 | * is a problem. | 396 | * is a problem. |
349 | */ | 397 | */ |
350 | #define PAGE_FLAGS_CHECK_AT_PREP (PAGE_FLAGS | 1 << PG_reserved | 1 << PG_dirty) | 398 | #define PAGE_FLAGS_CHECK_AT_PREP (PAGE_FLAGS | \ |
399 | 1 << PG_reserved | 1 << PG_dirty | 1 << PG_swapbacked) | ||
351 | 400 | ||
352 | #endif /* !__GENERATING_BOUNDS_H */ | 401 | #endif /* !__GENERATING_BOUNDS_H */ |
353 | #endif /* PAGE_FLAGS_H */ | 402 | #endif /* PAGE_FLAGS_H */ |
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h new file mode 100644 index 000000000000..0fd39f2231ec --- /dev/null +++ b/include/linux/page_cgroup.h | |||
@@ -0,0 +1,103 @@ | |||
1 | #ifndef __LINUX_PAGE_CGROUP_H | ||
2 | #define __LINUX_PAGE_CGROUP_H | ||
3 | |||
4 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR | ||
5 | #include <linux/bit_spinlock.h> | ||
6 | /* | ||
7 | * Page Cgroup can be considered as an extended mem_map. | ||
8 | * A page_cgroup page is associated with every page descriptor. The | ||
9 | * page_cgroup helps us identify information about the cgroup | ||
10 | * All page cgroups are allocated at boot or memory hotplug event, | ||
11 | * then the page cgroup for pfn always exists. | ||
12 | */ | ||
13 | struct page_cgroup { | ||
14 | unsigned long flags; | ||
15 | struct mem_cgroup *mem_cgroup; | ||
16 | struct page *page; | ||
17 | struct list_head lru; /* per cgroup LRU list */ | ||
18 | }; | ||
19 | |||
20 | void __init pgdat_page_cgroup_init(struct pglist_data *pgdat); | ||
21 | void __init page_cgroup_init(void); | ||
22 | struct page_cgroup *lookup_page_cgroup(struct page *page); | ||
23 | |||
24 | enum { | ||
25 | /* flags for mem_cgroup */ | ||
26 | PCG_LOCK, /* page cgroup is locked */ | ||
27 | PCG_CACHE, /* charged as cache */ | ||
28 | PCG_USED, /* this object is in use. */ | ||
29 | /* flags for LRU placement */ | ||
30 | PCG_ACTIVE, /* page is active in this cgroup */ | ||
31 | PCG_FILE, /* page is file system backed */ | ||
32 | PCG_UNEVICTABLE, /* page is unevictableable */ | ||
33 | }; | ||
34 | |||
35 | #define TESTPCGFLAG(uname, lname) \ | ||
36 | static inline int PageCgroup##uname(struct page_cgroup *pc) \ | ||
37 | { return test_bit(PCG_##lname, &pc->flags); } | ||
38 | |||
39 | #define SETPCGFLAG(uname, lname) \ | ||
40 | static inline void SetPageCgroup##uname(struct page_cgroup *pc)\ | ||
41 | { set_bit(PCG_##lname, &pc->flags); } | ||
42 | |||
43 | #define CLEARPCGFLAG(uname, lname) \ | ||
44 | static inline void ClearPageCgroup##uname(struct page_cgroup *pc) \ | ||
45 | { clear_bit(PCG_##lname, &pc->flags); } | ||
46 | |||
47 | /* Cache flag is set only once (at allocation) */ | ||
48 | TESTPCGFLAG(Cache, CACHE) | ||
49 | |||
50 | TESTPCGFLAG(Used, USED) | ||
51 | CLEARPCGFLAG(Used, USED) | ||
52 | |||
53 | /* LRU management flags (from global-lru definition) */ | ||
54 | TESTPCGFLAG(File, FILE) | ||
55 | SETPCGFLAG(File, FILE) | ||
56 | CLEARPCGFLAG(File, FILE) | ||
57 | |||
58 | TESTPCGFLAG(Active, ACTIVE) | ||
59 | SETPCGFLAG(Active, ACTIVE) | ||
60 | CLEARPCGFLAG(Active, ACTIVE) | ||
61 | |||
62 | TESTPCGFLAG(Unevictable, UNEVICTABLE) | ||
63 | SETPCGFLAG(Unevictable, UNEVICTABLE) | ||
64 | CLEARPCGFLAG(Unevictable, UNEVICTABLE) | ||
65 | |||
66 | static inline int page_cgroup_nid(struct page_cgroup *pc) | ||
67 | { | ||
68 | return page_to_nid(pc->page); | ||
69 | } | ||
70 | |||
71 | static inline enum zone_type page_cgroup_zid(struct page_cgroup *pc) | ||
72 | { | ||
73 | return page_zonenum(pc->page); | ||
74 | } | ||
75 | |||
76 | static inline void lock_page_cgroup(struct page_cgroup *pc) | ||
77 | { | ||
78 | bit_spin_lock(PCG_LOCK, &pc->flags); | ||
79 | } | ||
80 | |||
81 | static inline int trylock_page_cgroup(struct page_cgroup *pc) | ||
82 | { | ||
83 | return bit_spin_trylock(PCG_LOCK, &pc->flags); | ||
84 | } | ||
85 | |||
86 | static inline void unlock_page_cgroup(struct page_cgroup *pc) | ||
87 | { | ||
88 | bit_spin_unlock(PCG_LOCK, &pc->flags); | ||
89 | } | ||
90 | |||
91 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ | ||
92 | struct page_cgroup; | ||
93 | |||
94 | static inline void pgdat_page_cgroup_init(struct pglist_data *pgdat) | ||
95 | { | ||
96 | } | ||
97 | |||
98 | static inline struct page_cgroup *lookup_page_cgroup(struct page *page) | ||
99 | { | ||
100 | return NULL; | ||
101 | } | ||
102 | #endif | ||
103 | #endif | ||
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 5da31c12101c..709742be02f0 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -32,6 +32,34 @@ static inline void mapping_set_error(struct address_space *mapping, int error) | |||
32 | } | 32 | } |
33 | } | 33 | } |
34 | 34 | ||
35 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
36 | #define AS_UNEVICTABLE (__GFP_BITS_SHIFT + 2) /* e.g., ramdisk, SHM_LOCK */ | ||
37 | |||
38 | static inline void mapping_set_unevictable(struct address_space *mapping) | ||
39 | { | ||
40 | set_bit(AS_UNEVICTABLE, &mapping->flags); | ||
41 | } | ||
42 | |||
43 | static inline void mapping_clear_unevictable(struct address_space *mapping) | ||
44 | { | ||
45 | clear_bit(AS_UNEVICTABLE, &mapping->flags); | ||
46 | } | ||
47 | |||
48 | static inline int mapping_unevictable(struct address_space *mapping) | ||
49 | { | ||
50 | if (likely(mapping)) | ||
51 | return test_bit(AS_UNEVICTABLE, &mapping->flags); | ||
52 | return !!mapping; | ||
53 | } | ||
54 | #else | ||
55 | static inline void mapping_set_unevictable(struct address_space *mapping) { } | ||
56 | static inline void mapping_clear_unevictable(struct address_space *mapping) { } | ||
57 | static inline int mapping_unevictable(struct address_space *mapping) | ||
58 | { | ||
59 | return 0; | ||
60 | } | ||
61 | #endif | ||
62 | |||
35 | static inline gfp_t mapping_gfp_mask(struct address_space * mapping) | 63 | static inline gfp_t mapping_gfp_mask(struct address_space * mapping) |
36 | { | 64 | { |
37 | return (__force gfp_t)mapping->flags & __GFP_BITS_MASK; | 65 | return (__force gfp_t)mapping->flags & __GFP_BITS_MASK; |
@@ -271,19 +299,19 @@ extern int __lock_page_killable(struct page *page); | |||
271 | extern void __lock_page_nosync(struct page *page); | 299 | extern void __lock_page_nosync(struct page *page); |
272 | extern void unlock_page(struct page *page); | 300 | extern void unlock_page(struct page *page); |
273 | 301 | ||
274 | static inline void set_page_locked(struct page *page) | 302 | static inline void __set_page_locked(struct page *page) |
275 | { | 303 | { |
276 | set_bit(PG_locked, &page->flags); | 304 | __set_bit(PG_locked, &page->flags); |
277 | } | 305 | } |
278 | 306 | ||
279 | static inline void clear_page_locked(struct page *page) | 307 | static inline void __clear_page_locked(struct page *page) |
280 | { | 308 | { |
281 | clear_bit(PG_locked, &page->flags); | 309 | __clear_bit(PG_locked, &page->flags); |
282 | } | 310 | } |
283 | 311 | ||
284 | static inline int trylock_page(struct page *page) | 312 | static inline int trylock_page(struct page *page) |
285 | { | 313 | { |
286 | return !test_and_set_bit(PG_locked, &page->flags); | 314 | return (likely(!test_and_set_bit_lock(PG_locked, &page->flags))); |
287 | } | 315 | } |
288 | 316 | ||
289 | /* | 317 | /* |
@@ -410,17 +438,17 @@ extern void __remove_from_page_cache(struct page *page); | |||
410 | 438 | ||
411 | /* | 439 | /* |
412 | * Like add_to_page_cache_locked, but used to add newly allocated pages: | 440 | * Like add_to_page_cache_locked, but used to add newly allocated pages: |
413 | * the page is new, so we can just run set_page_locked() against it. | 441 | * the page is new, so we can just run __set_page_locked() against it. |
414 | */ | 442 | */ |
415 | static inline int add_to_page_cache(struct page *page, | 443 | static inline int add_to_page_cache(struct page *page, |
416 | struct address_space *mapping, pgoff_t offset, gfp_t gfp_mask) | 444 | struct address_space *mapping, pgoff_t offset, gfp_t gfp_mask) |
417 | { | 445 | { |
418 | int error; | 446 | int error; |
419 | 447 | ||
420 | set_page_locked(page); | 448 | __set_page_locked(page); |
421 | error = add_to_page_cache_locked(page, mapping, offset, gfp_mask); | 449 | error = add_to_page_cache_locked(page, mapping, offset, gfp_mask); |
422 | if (unlikely(error)) | 450 | if (unlikely(error)) |
423 | clear_page_locked(page); | 451 | __clear_page_locked(page); |
424 | return error; | 452 | return error; |
425 | } | 453 | } |
426 | 454 | ||
diff --git a/include/linux/pagevec.h b/include/linux/pagevec.h index 8eb7fa76c1d0..e90a2cb02915 100644 --- a/include/linux/pagevec.h +++ b/include/linux/pagevec.h | |||
@@ -23,9 +23,9 @@ struct pagevec { | |||
23 | void __pagevec_release(struct pagevec *pvec); | 23 | void __pagevec_release(struct pagevec *pvec); |
24 | void __pagevec_release_nonlru(struct pagevec *pvec); | 24 | void __pagevec_release_nonlru(struct pagevec *pvec); |
25 | void __pagevec_free(struct pagevec *pvec); | 25 | void __pagevec_free(struct pagevec *pvec); |
26 | void __pagevec_lru_add(struct pagevec *pvec); | 26 | void ____pagevec_lru_add(struct pagevec *pvec, enum lru_list lru); |
27 | void __pagevec_lru_add_active(struct pagevec *pvec); | ||
28 | void pagevec_strip(struct pagevec *pvec); | 27 | void pagevec_strip(struct pagevec *pvec); |
28 | void pagevec_swap_free(struct pagevec *pvec); | ||
29 | unsigned pagevec_lookup(struct pagevec *pvec, struct address_space *mapping, | 29 | unsigned pagevec_lookup(struct pagevec *pvec, struct address_space *mapping, |
30 | pgoff_t start, unsigned nr_pages); | 30 | pgoff_t start, unsigned nr_pages); |
31 | unsigned pagevec_lookup_tag(struct pagevec *pvec, | 31 | unsigned pagevec_lookup_tag(struct pagevec *pvec, |
@@ -81,10 +81,36 @@ static inline void pagevec_free(struct pagevec *pvec) | |||
81 | __pagevec_free(pvec); | 81 | __pagevec_free(pvec); |
82 | } | 82 | } |
83 | 83 | ||
84 | static inline void pagevec_lru_add(struct pagevec *pvec) | 84 | static inline void __pagevec_lru_add_anon(struct pagevec *pvec) |
85 | { | ||
86 | ____pagevec_lru_add(pvec, LRU_INACTIVE_ANON); | ||
87 | } | ||
88 | |||
89 | static inline void __pagevec_lru_add_active_anon(struct pagevec *pvec) | ||
90 | { | ||
91 | ____pagevec_lru_add(pvec, LRU_ACTIVE_ANON); | ||
92 | } | ||
93 | |||
94 | static inline void __pagevec_lru_add_file(struct pagevec *pvec) | ||
95 | { | ||
96 | ____pagevec_lru_add(pvec, LRU_INACTIVE_FILE); | ||
97 | } | ||
98 | |||
99 | static inline void __pagevec_lru_add_active_file(struct pagevec *pvec) | ||
100 | { | ||
101 | ____pagevec_lru_add(pvec, LRU_ACTIVE_FILE); | ||
102 | } | ||
103 | |||
104 | static inline void pagevec_lru_add_file(struct pagevec *pvec) | ||
105 | { | ||
106 | if (pagevec_count(pvec)) | ||
107 | __pagevec_lru_add_file(pvec); | ||
108 | } | ||
109 | |||
110 | static inline void pagevec_lru_add_anon(struct pagevec *pvec) | ||
85 | { | 111 | { |
86 | if (pagevec_count(pvec)) | 112 | if (pagevec_count(pvec)) |
87 | __pagevec_lru_add(pvec); | 113 | __pagevec_lru_add_anon(pvec); |
88 | } | 114 | } |
89 | 115 | ||
90 | #endif /* _LINUX_PAGEVEC_H */ | 116 | #endif /* _LINUX_PAGEVEC_H */ |
diff --git a/include/linux/parport.h b/include/linux/parport.h index 6a0d7cdb5774..e1f83c5065c5 100644 --- a/include/linux/parport.h +++ b/include/linux/parport.h | |||
@@ -1,5 +1,3 @@ | |||
1 | /* $Id: parport.h,v 1.1 1998/05/17 10:57:52 andrea Exp andrea $ */ | ||
2 | |||
3 | /* | 1 | /* |
4 | * Any part of this program may be used in documents licensed under | 2 | * Any part of this program may be used in documents licensed under |
5 | * the GNU Free Documentation License, Version 1.1 or any later version | 3 | * the GNU Free Documentation License, Version 1.1 or any later version |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 98dc6243a706..acf8f24037cd 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -631,6 +631,8 @@ int __must_check pci_assign_resource(struct pci_dev *dev, int i); | |||
631 | int pci_select_bars(struct pci_dev *dev, unsigned long flags); | 631 | int pci_select_bars(struct pci_dev *dev, unsigned long flags); |
632 | 632 | ||
633 | /* ROM control related routines */ | 633 | /* ROM control related routines */ |
634 | int pci_enable_rom(struct pci_dev *pdev); | ||
635 | void pci_disable_rom(struct pci_dev *pdev); | ||
634 | void __iomem __must_check *pci_map_rom(struct pci_dev *pdev, size_t *size); | 636 | void __iomem __must_check *pci_map_rom(struct pci_dev *pdev, size_t *size); |
635 | void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom); | 637 | void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom); |
636 | size_t pci_get_rom_size(void __iomem *rom, size_t size); | 638 | size_t pci_get_rom_size(void __iomem *rom, size_t size); |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 1176f1f177e2..8edddc240e4f 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -587,6 +587,7 @@ | |||
587 | #define PCI_DEVICE_ID_MATROX_G200_PCI 0x0520 | 587 | #define PCI_DEVICE_ID_MATROX_G200_PCI 0x0520 |
588 | #define PCI_DEVICE_ID_MATROX_G200_AGP 0x0521 | 588 | #define PCI_DEVICE_ID_MATROX_G200_AGP 0x0521 |
589 | #define PCI_DEVICE_ID_MATROX_G400 0x0525 | 589 | #define PCI_DEVICE_ID_MATROX_G400 0x0525 |
590 | #define PCI_DEVICE_ID_MATROX_G200EV_PCI 0x0530 | ||
590 | #define PCI_DEVICE_ID_MATROX_G550 0x2527 | 591 | #define PCI_DEVICE_ID_MATROX_G550 0x2527 |
591 | #define PCI_DEVICE_ID_MATROX_VIA 0x4536 | 592 | #define PCI_DEVICE_ID_MATROX_VIA 0x4536 |
592 | 593 | ||
diff --git a/include/linux/pfn.h b/include/linux/pfn.h index bb01f8b92b56..7646637221f3 100644 --- a/include/linux/pfn.h +++ b/include/linux/pfn.h | |||
@@ -1,9 +1,13 @@ | |||
1 | #ifndef _LINUX_PFN_H_ | 1 | #ifndef _LINUX_PFN_H_ |
2 | #define _LINUX_PFN_H_ | 2 | #define _LINUX_PFN_H_ |
3 | 3 | ||
4 | #ifndef __ASSEMBLY__ | ||
5 | #include <linux/types.h> | ||
6 | #endif | ||
7 | |||
4 | #define PFN_ALIGN(x) (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK) | 8 | #define PFN_ALIGN(x) (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK) |
5 | #define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) | 9 | #define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) |
6 | #define PFN_DOWN(x) ((x) >> PAGE_SHIFT) | 10 | #define PFN_DOWN(x) ((x) >> PAGE_SHIFT) |
7 | #define PFN_PHYS(x) ((x) << PAGE_SHIFT) | 11 | #define PFN_PHYS(x) ((phys_addr_t)(x) << PAGE_SHIFT) |
8 | 12 | ||
9 | #endif | 13 | #endif |
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h index 1af82c4e17d4..d82fe825d62f 100644 --- a/include/linux/pid_namespace.h +++ b/include/linux/pid_namespace.h | |||
@@ -84,12 +84,6 @@ static inline struct pid_namespace *task_active_pid_ns(struct task_struct *tsk) | |||
84 | return tsk->nsproxy->pid_ns; | 84 | return tsk->nsproxy->pid_ns; |
85 | } | 85 | } |
86 | 86 | ||
87 | static inline struct task_struct *task_child_reaper(struct task_struct *tsk) | ||
88 | { | ||
89 | BUG_ON(tsk != current); | ||
90 | return tsk->nsproxy->pid_ns->child_reaper; | ||
91 | } | ||
92 | |||
93 | void pidhash_init(void); | 87 | void pidhash_init(void); |
94 | void pidmap_init(void); | 88 | void pidmap_init(void); |
95 | 89 | ||
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 95ac21ab3a09..4b8cc6a32479 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
@@ -37,6 +37,8 @@ extern int platform_add_devices(struct platform_device **, int); | |||
37 | 37 | ||
38 | extern struct platform_device *platform_device_register_simple(const char *, int id, | 38 | extern struct platform_device *platform_device_register_simple(const char *, int id, |
39 | struct resource *, unsigned int); | 39 | struct resource *, unsigned int); |
40 | extern struct platform_device *platform_device_register_data(struct device *, | ||
41 | const char *, int, const void *, size_t); | ||
40 | 42 | ||
41 | extern struct platform_device *platform_device_alloc(const char *name, int id); | 43 | extern struct platform_device *platform_device_alloc(const char *name, int id); |
42 | extern int platform_device_add_resources(struct platform_device *pdev, struct resource *res, unsigned int num); | 44 | extern int platform_device_add_resources(struct platform_device *pdev, struct resource *res, unsigned int num); |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 4dcce54b6d76..42de4003c4ee 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -419,7 +419,7 @@ extern void __suspend_report_result(const char *function, void *fn, int ret); | |||
419 | 419 | ||
420 | #define suspend_report_result(fn, ret) \ | 420 | #define suspend_report_result(fn, ret) \ |
421 | do { \ | 421 | do { \ |
422 | __suspend_report_result(__FUNCTION__, fn, ret); \ | 422 | __suspend_report_result(__func__, fn, ret); \ |
423 | } while (0) | 423 | } while (0) |
424 | 424 | ||
425 | #else /* !CONFIG_PM_SLEEP */ | 425 | #else /* !CONFIG_PM_SLEEP */ |
diff --git a/include/linux/pnp.h b/include/linux/pnp.h index be764e514e35..53b70fd1d9a5 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h | |||
@@ -22,9 +22,11 @@ struct pnp_dev; | |||
22 | * Resource Management | 22 | * Resource Management |
23 | */ | 23 | */ |
24 | #ifdef CONFIG_PNP | 24 | #ifdef CONFIG_PNP |
25 | struct resource *pnp_get_resource(struct pnp_dev *, unsigned int, unsigned int); | 25 | struct resource *pnp_get_resource(struct pnp_dev *dev, unsigned long type, |
26 | unsigned int num); | ||
26 | #else | 27 | #else |
27 | static inline struct resource *pnp_get_resource(struct pnp_dev *dev, unsigned int type, unsigned int num) | 28 | static inline struct resource *pnp_get_resource(struct pnp_dev *dev, |
29 | unsigned long type, unsigned int num) | ||
28 | { | 30 | { |
29 | return NULL; | 31 | return NULL; |
30 | } | 32 | } |
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index ea96ead1d39d..f9348cba6dc1 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h | |||
@@ -165,6 +165,12 @@ struct power_supply_info { | |||
165 | extern void power_supply_changed(struct power_supply *psy); | 165 | extern void power_supply_changed(struct power_supply *psy); |
166 | extern int power_supply_am_i_supplied(struct power_supply *psy); | 166 | extern int power_supply_am_i_supplied(struct power_supply *psy); |
167 | 167 | ||
168 | #if defined(CONFIG_POWER_SUPPLY) || defined(CONFIG_POWER_SUPPLY_MODULE) | ||
169 | extern int power_supply_is_system_supplied(void); | ||
170 | #else | ||
171 | static inline int power_supply_is_system_supplied(void) { return -ENOSYS; } | ||
172 | #endif | ||
173 | |||
168 | extern int power_supply_register(struct device *parent, | 174 | extern int power_supply_register(struct device *parent, |
169 | struct power_supply *psy); | 175 | struct power_supply *psy); |
170 | extern void power_supply_unregister(struct power_supply *psy); | 176 | extern void power_supply_unregister(struct power_supply *psy); |
diff --git a/include/linux/profile.h b/include/linux/profile.h index 7e7087239af5..570045053ce9 100644 --- a/include/linux/profile.h +++ b/include/linux/profile.h | |||
@@ -35,7 +35,9 @@ enum profile_type { | |||
35 | extern int prof_on __read_mostly; | 35 | extern int prof_on __read_mostly; |
36 | 36 | ||
37 | /* init basic kernel profiler */ | 37 | /* init basic kernel profiler */ |
38 | void __init profile_init(void); | 38 | int profile_init(void); |
39 | int profile_setup(char *str); | ||
40 | int create_proc_profile(void); | ||
39 | void profile_tick(int type); | 41 | void profile_tick(int type); |
40 | 42 | ||
41 | /* | 43 | /* |
@@ -84,9 +86,9 @@ struct pt_regs; | |||
84 | 86 | ||
85 | #define prof_on 0 | 87 | #define prof_on 0 |
86 | 88 | ||
87 | static inline void profile_init(void) | 89 | static inline int profile_init(void) |
88 | { | 90 | { |
89 | return; | 91 | return 0; |
90 | } | 92 | } |
91 | 93 | ||
92 | static inline void profile_tick(int type) | 94 | static inline void profile_tick(int type) |
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index ea7416c901d1..22641d5d45df 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
@@ -94,7 +94,6 @@ extern void ptrace_notify(int exit_code); | |||
94 | extern void __ptrace_link(struct task_struct *child, | 94 | extern void __ptrace_link(struct task_struct *child, |
95 | struct task_struct *new_parent); | 95 | struct task_struct *new_parent); |
96 | extern void __ptrace_unlink(struct task_struct *child); | 96 | extern void __ptrace_unlink(struct task_struct *child); |
97 | extern void ptrace_untrace(struct task_struct *child); | ||
98 | #define PTRACE_MODE_READ 1 | 97 | #define PTRACE_MODE_READ 1 |
99 | #define PTRACE_MODE_ATTACH 2 | 98 | #define PTRACE_MODE_ATTACH 2 |
100 | /* Returns 0 on success, -errno on denial. */ | 99 | /* Returns 0 on success, -errno on denial. */ |
diff --git a/include/linux/quota.h b/include/linux/quota.h index 376a05048bc5..40401b554484 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
@@ -28,8 +28,6 @@ | |||
28 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 28 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
29 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 29 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
30 | * SUCH DAMAGE. | 30 | * SUCH DAMAGE. |
31 | * | ||
32 | * Version: $Id: quota.h,v 2.0 1996/11/17 16:48:14 mvw Exp mvw $ | ||
33 | */ | 31 | */ |
34 | 32 | ||
35 | #ifndef _LINUX_QUOTA_ | 33 | #ifndef _LINUX_QUOTA_ |
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index ca6b9b5c8d52..a558a4c1d35a 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h | |||
@@ -3,9 +3,6 @@ | |||
3 | * macros expand to the right source-code. | 3 | * macros expand to the right source-code. |
4 | * | 4 | * |
5 | * Author: Marco van Wieringen <mvw@planets.elm.net> | 5 | * Author: Marco van Wieringen <mvw@planets.elm.net> |
6 | * | ||
7 | * Version: $Id: quotaops.h,v 1.2 1998/01/15 16:22:26 ecd Exp $ | ||
8 | * | ||
9 | */ | 6 | */ |
10 | #ifndef _LINUX_QUOTAOPS_ | 7 | #ifndef _LINUX_QUOTAOPS_ |
11 | #define _LINUX_QUOTAOPS_ | 8 | #define _LINUX_QUOTAOPS_ |
diff --git a/include/linux/raid/linear.h b/include/linux/raid/linear.h index 7e375111d007..f38b9c586afb 100644 --- a/include/linux/raid/linear.h +++ b/include/linux/raid/linear.h | |||
@@ -5,8 +5,8 @@ | |||
5 | 5 | ||
6 | struct dev_info { | 6 | struct dev_info { |
7 | mdk_rdev_t *rdev; | 7 | mdk_rdev_t *rdev; |
8 | sector_t size; | 8 | sector_t num_sectors; |
9 | sector_t offset; | 9 | sector_t start_sector; |
10 | }; | 10 | }; |
11 | 11 | ||
12 | typedef struct dev_info dev_info_t; | 12 | typedef struct dev_info dev_info_t; |
@@ -15,9 +15,11 @@ struct linear_private_data | |||
15 | { | 15 | { |
16 | struct linear_private_data *prev; /* earlier version */ | 16 | struct linear_private_data *prev; /* earlier version */ |
17 | dev_info_t **hash_table; | 17 | dev_info_t **hash_table; |
18 | sector_t hash_spacing; | 18 | sector_t spacing; |
19 | sector_t array_sectors; | 19 | sector_t array_sectors; |
20 | int preshift; /* shift before dividing by hash_spacing */ | 20 | int sector_shift; /* shift before dividing |
21 | * by spacing | ||
22 | */ | ||
21 | dev_info_t disks[0]; | 23 | dev_info_t disks[0]; |
22 | }; | 24 | }; |
23 | 25 | ||
diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h index dc0e3fcb9f28..82bea14cae1a 100644 --- a/include/linux/raid/md.h +++ b/include/linux/raid/md.h | |||
@@ -19,27 +19,7 @@ | |||
19 | #define _MD_H | 19 | #define _MD_H |
20 | 20 | ||
21 | #include <linux/blkdev.h> | 21 | #include <linux/blkdev.h> |
22 | #include <linux/major.h> | ||
23 | #include <linux/ioctl.h> | ||
24 | #include <linux/types.h> | ||
25 | #include <linux/bitops.h> | ||
26 | #include <linux/module.h> | ||
27 | #include <linux/hdreg.h> | ||
28 | #include <linux/proc_fs.h> | ||
29 | #include <linux/seq_file.h> | 22 | #include <linux/seq_file.h> |
30 | #include <linux/smp_lock.h> | ||
31 | #include <linux/delay.h> | ||
32 | #include <net/checksum.h> | ||
33 | #include <linux/random.h> | ||
34 | #include <linux/kernel_stat.h> | ||
35 | #include <asm/io.h> | ||
36 | #include <linux/completion.h> | ||
37 | #include <linux/mempool.h> | ||
38 | #include <linux/list.h> | ||
39 | #include <linux/reboot.h> | ||
40 | #include <linux/vmalloc.h> | ||
41 | #include <linux/blkpg.h> | ||
42 | #include <linux/bio.h> | ||
43 | 23 | ||
44 | /* | 24 | /* |
45 | * 'md_p.h' holds the 'physical' layout of RAID devices | 25 | * 'md_p.h' holds the 'physical' layout of RAID devices |
@@ -74,19 +54,17 @@ | |||
74 | 54 | ||
75 | extern int mdp_major; | 55 | extern int mdp_major; |
76 | 56 | ||
77 | extern int register_md_personality (struct mdk_personality *p); | 57 | extern int register_md_personality(struct mdk_personality *p); |
78 | extern int unregister_md_personality (struct mdk_personality *p); | 58 | extern int unregister_md_personality(struct mdk_personality *p); |
79 | extern mdk_thread_t * md_register_thread (void (*run) (mddev_t *mddev), | 59 | extern mdk_thread_t * md_register_thread(void (*run) (mddev_t *mddev), |
80 | mddev_t *mddev, const char *name); | 60 | mddev_t *mddev, const char *name); |
81 | extern void md_unregister_thread (mdk_thread_t *thread); | 61 | extern void md_unregister_thread(mdk_thread_t *thread); |
82 | extern void md_wakeup_thread(mdk_thread_t *thread); | 62 | extern void md_wakeup_thread(mdk_thread_t *thread); |
83 | extern void md_check_recovery(mddev_t *mddev); | 63 | extern void md_check_recovery(mddev_t *mddev); |
84 | extern void md_write_start(mddev_t *mddev, struct bio *bi); | 64 | extern void md_write_start(mddev_t *mddev, struct bio *bi); |
85 | extern void md_write_end(mddev_t *mddev); | 65 | extern void md_write_end(mddev_t *mddev); |
86 | extern void md_handle_safemode(mddev_t *mddev); | ||
87 | extern void md_done_sync(mddev_t *mddev, int blocks, int ok); | 66 | extern void md_done_sync(mddev_t *mddev, int blocks, int ok); |
88 | extern void md_error (mddev_t *mddev, mdk_rdev_t *rdev); | 67 | extern void md_error(mddev_t *mddev, mdk_rdev_t *rdev); |
89 | extern void md_unplug_mddev(mddev_t *mddev); | ||
90 | 68 | ||
91 | extern void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev, | 69 | extern void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev, |
92 | sector_t sector, int size, struct page *page); | 70 | sector_t sector, int size, struct page *page); |
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index e9963af16cda..bc5114d35e99 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -87,7 +87,7 @@ void reiserfs_warning(struct super_block *s, const char *fmt, ...); | |||
87 | if( !( cond ) ) \ | 87 | if( !( cond ) ) \ |
88 | reiserfs_panic( NULL, "reiserfs[%i]: assertion " scond " failed at " \ | 88 | reiserfs_panic( NULL, "reiserfs[%i]: assertion " scond " failed at " \ |
89 | __FILE__ ":%i:%s: " format "\n", \ | 89 | __FILE__ ":%i:%s: " format "\n", \ |
90 | in_interrupt() ? -1 : task_pid_nr(current), __LINE__ , __FUNCTION__ , ##args ) | 90 | in_interrupt() ? -1 : task_pid_nr(current), __LINE__ , __func__ , ##args ) |
91 | 91 | ||
92 | #define RASSERT(cond, format, args...) __RASSERT(cond, #cond, format, ##args) | 92 | #define RASSERT(cond, format, args...) __RASSERT(cond, #cond, format, ##args) |
93 | 93 | ||
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index fed6f5e0b411..89f0564b10c8 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -39,18 +39,6 @@ struct anon_vma { | |||
39 | 39 | ||
40 | #ifdef CONFIG_MMU | 40 | #ifdef CONFIG_MMU |
41 | 41 | ||
42 | extern struct kmem_cache *anon_vma_cachep; | ||
43 | |||
44 | static inline struct anon_vma *anon_vma_alloc(void) | ||
45 | { | ||
46 | return kmem_cache_alloc(anon_vma_cachep, GFP_KERNEL); | ||
47 | } | ||
48 | |||
49 | static inline void anon_vma_free(struct anon_vma *anon_vma) | ||
50 | { | ||
51 | kmem_cache_free(anon_vma_cachep, anon_vma); | ||
52 | } | ||
53 | |||
54 | static inline void anon_vma_lock(struct vm_area_struct *vma) | 42 | static inline void anon_vma_lock(struct vm_area_struct *vma) |
55 | { | 43 | { |
56 | struct anon_vma *anon_vma = vma->anon_vma; | 44 | struct anon_vma *anon_vma = vma->anon_vma; |
@@ -75,6 +63,9 @@ void anon_vma_unlink(struct vm_area_struct *); | |||
75 | void anon_vma_link(struct vm_area_struct *); | 63 | void anon_vma_link(struct vm_area_struct *); |
76 | void __anon_vma_link(struct vm_area_struct *); | 64 | void __anon_vma_link(struct vm_area_struct *); |
77 | 65 | ||
66 | extern struct anon_vma *page_lock_anon_vma(struct page *page); | ||
67 | extern void page_unlock_anon_vma(struct anon_vma *anon_vma); | ||
68 | |||
78 | /* | 69 | /* |
79 | * rmap interfaces called when adding or removing pte of page | 70 | * rmap interfaces called when adding or removing pte of page |
80 | */ | 71 | */ |
@@ -117,6 +108,19 @@ unsigned long page_address_in_vma(struct page *, struct vm_area_struct *); | |||
117 | */ | 108 | */ |
118 | int page_mkclean(struct page *); | 109 | int page_mkclean(struct page *); |
119 | 110 | ||
111 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
112 | /* | ||
113 | * called in munlock()/munmap() path to check for other vmas holding | ||
114 | * the page mlocked. | ||
115 | */ | ||
116 | int try_to_munlock(struct page *); | ||
117 | #else | ||
118 | static inline int try_to_munlock(struct page *page) | ||
119 | { | ||
120 | return 0; /* a.k.a. SWAP_SUCCESS */ | ||
121 | } | ||
122 | #endif | ||
123 | |||
120 | #else /* !CONFIG_MMU */ | 124 | #else /* !CONFIG_MMU */ |
121 | 125 | ||
122 | #define anon_vma_init() do {} while (0) | 126 | #define anon_vma_init() do {} while (0) |
@@ -140,5 +144,6 @@ static inline int page_mkclean(struct page *page) | |||
140 | #define SWAP_SUCCESS 0 | 144 | #define SWAP_SUCCESS 0 |
141 | #define SWAP_AGAIN 1 | 145 | #define SWAP_AGAIN 1 |
142 | #define SWAP_FAIL 2 | 146 | #define SWAP_FAIL 2 |
147 | #define SWAP_MLOCK 3 | ||
143 | 148 | ||
144 | #endif /* _LINUX_RMAP_H */ | 149 | #endif /* _LINUX_RMAP_H */ |
diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h index 382bb7951166..f19b00b7d530 100644 --- a/include/linux/rtmutex.h +++ b/include/linux/rtmutex.h | |||
@@ -54,7 +54,7 @@ struct hrtimer_sleeper; | |||
54 | #ifdef CONFIG_DEBUG_RT_MUTEXES | 54 | #ifdef CONFIG_DEBUG_RT_MUTEXES |
55 | # define __DEBUG_RT_MUTEX_INITIALIZER(mutexname) \ | 55 | # define __DEBUG_RT_MUTEX_INITIALIZER(mutexname) \ |
56 | , .name = #mutexname, .file = __FILE__, .line = __LINE__ | 56 | , .name = #mutexname, .file = __FILE__, .line = __LINE__ |
57 | # define rt_mutex_init(mutex) __rt_mutex_init(mutex, __FUNCTION__) | 57 | # define rt_mutex_init(mutex) __rt_mutex_init(mutex, __func__) |
58 | extern void rt_mutex_debug_task_free(struct task_struct *tsk); | 58 | extern void rt_mutex_debug_task_free(struct task_struct *tsk); |
59 | #else | 59 | #else |
60 | # define __DEBUG_RT_MUTEX_INITIALIZER(mutexname) | 60 | # define __DEBUG_RT_MUTEX_INITIALIZER(mutexname) |
diff --git a/include/linux/sched.h b/include/linux/sched.h index c226c7b82946..f52dbd3587a7 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -403,12 +403,21 @@ extern int get_dumpable(struct mm_struct *mm); | |||
403 | #define MMF_DUMP_MAPPED_PRIVATE 4 | 403 | #define MMF_DUMP_MAPPED_PRIVATE 4 |
404 | #define MMF_DUMP_MAPPED_SHARED 5 | 404 | #define MMF_DUMP_MAPPED_SHARED 5 |
405 | #define MMF_DUMP_ELF_HEADERS 6 | 405 | #define MMF_DUMP_ELF_HEADERS 6 |
406 | #define MMF_DUMP_HUGETLB_PRIVATE 7 | ||
407 | #define MMF_DUMP_HUGETLB_SHARED 8 | ||
406 | #define MMF_DUMP_FILTER_SHIFT MMF_DUMPABLE_BITS | 408 | #define MMF_DUMP_FILTER_SHIFT MMF_DUMPABLE_BITS |
407 | #define MMF_DUMP_FILTER_BITS 5 | 409 | #define MMF_DUMP_FILTER_BITS 7 |
408 | #define MMF_DUMP_FILTER_MASK \ | 410 | #define MMF_DUMP_FILTER_MASK \ |
409 | (((1 << MMF_DUMP_FILTER_BITS) - 1) << MMF_DUMP_FILTER_SHIFT) | 411 | (((1 << MMF_DUMP_FILTER_BITS) - 1) << MMF_DUMP_FILTER_SHIFT) |
410 | #define MMF_DUMP_FILTER_DEFAULT \ | 412 | #define MMF_DUMP_FILTER_DEFAULT \ |
411 | ((1 << MMF_DUMP_ANON_PRIVATE) | (1 << MMF_DUMP_ANON_SHARED)) | 413 | ((1 << MMF_DUMP_ANON_PRIVATE) | (1 << MMF_DUMP_ANON_SHARED) |\ |
414 | (1 << MMF_DUMP_HUGETLB_PRIVATE) | MMF_DUMP_MASK_DEFAULT_ELF) | ||
415 | |||
416 | #ifdef CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS | ||
417 | # define MMF_DUMP_MASK_DEFAULT_ELF (1 << MMF_DUMP_ELF_HEADERS) | ||
418 | #else | ||
419 | # define MMF_DUMP_MASK_DEFAULT_ELF 0 | ||
420 | #endif | ||
412 | 421 | ||
413 | struct sighand_struct { | 422 | struct sighand_struct { |
414 | atomic_t count; | 423 | atomic_t count; |
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index a1783b229ef4..dc50bcc282a8 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h | |||
@@ -60,6 +60,19 @@ static inline int seq_nodemask(struct seq_file *m, nodemask_t *mask) | |||
60 | return seq_bitmap(m, mask->bits, MAX_NUMNODES); | 60 | return seq_bitmap(m, mask->bits, MAX_NUMNODES); |
61 | } | 61 | } |
62 | 62 | ||
63 | int seq_bitmap_list(struct seq_file *m, unsigned long *bits, | ||
64 | unsigned int nr_bits); | ||
65 | |||
66 | static inline int seq_cpumask_list(struct seq_file *m, cpumask_t *mask) | ||
67 | { | ||
68 | return seq_bitmap_list(m, mask->bits, NR_CPUS); | ||
69 | } | ||
70 | |||
71 | static inline int seq_nodemask_list(struct seq_file *m, nodemask_t *mask) | ||
72 | { | ||
73 | return seq_bitmap_list(m, mask->bits, MAX_NUMNODES); | ||
74 | } | ||
75 | |||
63 | int single_open(struct file *, int (*)(struct seq_file *, void *), void *); | 76 | int single_open(struct file *, int (*)(struct seq_file *, void *), void *); |
64 | int single_release(struct inode *, struct file *); | 77 | int single_release(struct inode *, struct file *); |
65 | void *__seq_open_private(struct file *, const struct seq_operations *, int); | 78 | void *__seq_open_private(struct file *, const struct seq_operations *, int); |
diff --git a/include/linux/sh_intc.h b/include/linux/sh_intc.h new file mode 100644 index 000000000000..68e212ff9dde --- /dev/null +++ b/include/linux/sh_intc.h | |||
@@ -0,0 +1,91 @@ | |||
1 | #ifndef __SH_INTC_H | ||
2 | #define __SH_INTC_H | ||
3 | |||
4 | typedef unsigned char intc_enum; | ||
5 | |||
6 | struct intc_vect { | ||
7 | intc_enum enum_id; | ||
8 | unsigned short vect; | ||
9 | }; | ||
10 | |||
11 | #define INTC_VECT(enum_id, vect) { enum_id, vect } | ||
12 | #define INTC_IRQ(enum_id, irq) INTC_VECT(enum_id, irq2evt(irq)) | ||
13 | |||
14 | struct intc_group { | ||
15 | intc_enum enum_id; | ||
16 | intc_enum enum_ids[32]; | ||
17 | }; | ||
18 | |||
19 | #define INTC_GROUP(enum_id, ids...) { enum_id, { ids } } | ||
20 | |||
21 | struct intc_mask_reg { | ||
22 | unsigned long set_reg, clr_reg, reg_width; | ||
23 | intc_enum enum_ids[32]; | ||
24 | #ifdef CONFIG_SMP | ||
25 | unsigned long smp; | ||
26 | #endif | ||
27 | }; | ||
28 | |||
29 | struct intc_prio_reg { | ||
30 | unsigned long set_reg, clr_reg, reg_width, field_width; | ||
31 | intc_enum enum_ids[16]; | ||
32 | #ifdef CONFIG_SMP | ||
33 | unsigned long smp; | ||
34 | #endif | ||
35 | }; | ||
36 | |||
37 | struct intc_sense_reg { | ||
38 | unsigned long reg, reg_width, field_width; | ||
39 | intc_enum enum_ids[16]; | ||
40 | }; | ||
41 | |||
42 | #ifdef CONFIG_SMP | ||
43 | #define INTC_SMP(stride, nr) .smp = (stride) | ((nr) << 8) | ||
44 | #else | ||
45 | #define INTC_SMP(stride, nr) | ||
46 | #endif | ||
47 | |||
48 | struct intc_desc { | ||
49 | struct intc_vect *vectors; | ||
50 | unsigned int nr_vectors; | ||
51 | struct intc_group *groups; | ||
52 | unsigned int nr_groups; | ||
53 | struct intc_mask_reg *mask_regs; | ||
54 | unsigned int nr_mask_regs; | ||
55 | struct intc_prio_reg *prio_regs; | ||
56 | unsigned int nr_prio_regs; | ||
57 | struct intc_sense_reg *sense_regs; | ||
58 | unsigned int nr_sense_regs; | ||
59 | char *name; | ||
60 | #if defined(CONFIG_CPU_SH3) || defined(CONFIG_CPU_SH4A) | ||
61 | struct intc_mask_reg *ack_regs; | ||
62 | unsigned int nr_ack_regs; | ||
63 | #endif | ||
64 | }; | ||
65 | |||
66 | #define _INTC_ARRAY(a) a, sizeof(a)/sizeof(*a) | ||
67 | #define DECLARE_INTC_DESC(symbol, chipname, vectors, groups, \ | ||
68 | mask_regs, prio_regs, sense_regs) \ | ||
69 | struct intc_desc symbol __initdata = { \ | ||
70 | _INTC_ARRAY(vectors), _INTC_ARRAY(groups), \ | ||
71 | _INTC_ARRAY(mask_regs), _INTC_ARRAY(prio_regs), \ | ||
72 | _INTC_ARRAY(sense_regs), \ | ||
73 | chipname, \ | ||
74 | } | ||
75 | |||
76 | #if defined(CONFIG_CPU_SH3) || defined(CONFIG_CPU_SH4A) | ||
77 | #define DECLARE_INTC_DESC_ACK(symbol, chipname, vectors, groups, \ | ||
78 | mask_regs, prio_regs, sense_regs, ack_regs) \ | ||
79 | struct intc_desc symbol __initdata = { \ | ||
80 | _INTC_ARRAY(vectors), _INTC_ARRAY(groups), \ | ||
81 | _INTC_ARRAY(mask_regs), _INTC_ARRAY(prio_regs), \ | ||
82 | _INTC_ARRAY(sense_regs), \ | ||
83 | chipname, \ | ||
84 | _INTC_ARRAY(ack_regs), \ | ||
85 | } | ||
86 | #endif | ||
87 | |||
88 | void __init register_intc_controller(struct intc_desc *desc); | ||
89 | int intc_set_priority(unsigned int irq, unsigned int prio); | ||
90 | |||
91 | #endif /* __SH_INTC_H */ | ||
diff --git a/include/linux/smp.h b/include/linux/smp.h index 66484d4a8459..2e4d58b26c06 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -7,6 +7,7 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <linux/errno.h> | 9 | #include <linux/errno.h> |
10 | #include <linux/types.h> | ||
10 | #include <linux/list.h> | 11 | #include <linux/list.h> |
11 | #include <linux/cpumask.h> | 12 | #include <linux/cpumask.h> |
12 | 13 | ||
@@ -16,7 +17,8 @@ struct call_single_data { | |||
16 | struct list_head list; | 17 | struct list_head list; |
17 | void (*func) (void *info); | 18 | void (*func) (void *info); |
18 | void *info; | 19 | void *info; |
19 | unsigned int flags; | 20 | u16 flags; |
21 | u16 priv; | ||
20 | }; | 22 | }; |
21 | 23 | ||
22 | #ifdef CONFIG_SMP | 24 | #ifdef CONFIG_SMP |
diff --git a/include/linux/spi/orion_spi.h b/include/linux/spi/orion_spi.h index b4d9fa6f797c..decf6d8c77b7 100644 --- a/include/linux/spi/orion_spi.h +++ b/include/linux/spi/orion_spi.h | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | struct orion_spi_info { | 12 | struct orion_spi_info { |
13 | u32 tclk; /* no <linux/clk.h> support yet */ | 13 | u32 tclk; /* no <linux/clk.h> support yet */ |
14 | u32 enable_clock_fix; | ||
14 | }; | 15 | }; |
15 | 16 | ||
16 | 17 | ||
diff --git a/include/linux/sunrpc/xprtrdma.h b/include/linux/sunrpc/xprtrdma.h index 4de56b1d372b..54a379c9e8eb 100644 --- a/include/linux/sunrpc/xprtrdma.h +++ b/include/linux/sunrpc/xprtrdma.h | |||
@@ -66,9 +66,6 @@ | |||
66 | 66 | ||
67 | #define RPCRDMA_INLINE_PAD_THRESH (512)/* payload threshold to pad (bytes) */ | 67 | #define RPCRDMA_INLINE_PAD_THRESH (512)/* payload threshold to pad (bytes) */ |
68 | 68 | ||
69 | #define RDMA_RESOLVE_TIMEOUT (5*HZ) /* TBD 5 seconds */ | ||
70 | #define RDMA_CONNECT_RETRY_MAX (2) /* retries if no listener backlog */ | ||
71 | |||
72 | /* memory registration strategies */ | 69 | /* memory registration strategies */ |
73 | #define RPCRDMA_PERSISTENT_REGISTRATION (1) | 70 | #define RPCRDMA_PERSISTENT_REGISTRATION (1) |
74 | 71 | ||
@@ -78,6 +75,7 @@ enum rpcrdma_memreg { | |||
78 | RPCRDMA_MEMWINDOWS, | 75 | RPCRDMA_MEMWINDOWS, |
79 | RPCRDMA_MEMWINDOWS_ASYNC, | 76 | RPCRDMA_MEMWINDOWS_ASYNC, |
80 | RPCRDMA_MTHCAFMR, | 77 | RPCRDMA_MTHCAFMR, |
78 | RPCRDMA_FRMR, | ||
81 | RPCRDMA_ALLPHYSICAL, | 79 | RPCRDMA_ALLPHYSICAL, |
82 | RPCRDMA_LAST | 80 | RPCRDMA_LAST |
83 | }; | 81 | }; |
diff --git a/include/linux/swab.h b/include/linux/swab.h index 270d5c208a89..bbed279f3b32 100644 --- a/include/linux/swab.h +++ b/include/linux/swab.h | |||
@@ -47,8 +47,6 @@ static inline __attribute_const__ __u16 ___swab16(__u16 val) | |||
47 | { | 47 | { |
48 | #ifdef __arch_swab16 | 48 | #ifdef __arch_swab16 |
49 | return __arch_swab16(val); | 49 | return __arch_swab16(val); |
50 | #elif defined(__arch_swab16p) | ||
51 | return __arch_swab16p(&val); | ||
52 | #else | 50 | #else |
53 | return __const_swab16(val); | 51 | return __const_swab16(val); |
54 | #endif | 52 | #endif |
@@ -58,8 +56,6 @@ static inline __attribute_const__ __u32 ___swab32(__u32 val) | |||
58 | { | 56 | { |
59 | #ifdef __arch_swab32 | 57 | #ifdef __arch_swab32 |
60 | return __arch_swab32(val); | 58 | return __arch_swab32(val); |
61 | #elif defined(__arch_swab32p) | ||
62 | return __arch_swab32p(&val); | ||
63 | #else | 59 | #else |
64 | return __const_swab32(val); | 60 | return __const_swab32(val); |
65 | #endif | 61 | #endif |
@@ -69,8 +65,6 @@ static inline __attribute_const__ __u64 ___swab64(__u64 val) | |||
69 | { | 65 | { |
70 | #ifdef __arch_swab64 | 66 | #ifdef __arch_swab64 |
71 | return __arch_swab64(val); | 67 | return __arch_swab64(val); |
72 | #elif defined(__arch_swab64p) | ||
73 | return __arch_swab64p(&val); | ||
74 | #elif defined(__SWAB_64_THRU_32__) | 68 | #elif defined(__SWAB_64_THRU_32__) |
75 | __u32 h = val >> 32; | 69 | __u32 h = val >> 32; |
76 | __u32 l = val & ((1ULL << 32) - 1); | 70 | __u32 l = val & ((1ULL << 32) - 1); |
@@ -84,8 +78,6 @@ static inline __attribute_const__ __u32 ___swahw32(__u32 val) | |||
84 | { | 78 | { |
85 | #ifdef __arch_swahw32 | 79 | #ifdef __arch_swahw32 |
86 | return __arch_swahw32(val); | 80 | return __arch_swahw32(val); |
87 | #elif defined(__arch_swahw32p) | ||
88 | return __arch_swahw32p(&val); | ||
89 | #else | 81 | #else |
90 | return __const_swahw32(val); | 82 | return __const_swahw32(val); |
91 | #endif | 83 | #endif |
@@ -95,8 +87,6 @@ static inline __attribute_const__ __u32 ___swahb32(__u32 val) | |||
95 | { | 87 | { |
96 | #ifdef __arch_swahb32 | 88 | #ifdef __arch_swahb32 |
97 | return __arch_swahb32(val); | 89 | return __arch_swahb32(val); |
98 | #elif defined(__arch_swahb32p) | ||
99 | return __arch_swahb32p(&val); | ||
100 | #else | 90 | #else |
101 | return __const_swahb32(val); | 91 | return __const_swahb32(val); |
102 | #endif | 92 | #endif |
diff --git a/include/linux/swap.h b/include/linux/swap.h index de40f169a4e4..a3af95b2cb6d 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/list.h> | 7 | #include <linux/list.h> |
8 | #include <linux/memcontrol.h> | 8 | #include <linux/memcontrol.h> |
9 | #include <linux/sched.h> | 9 | #include <linux/sched.h> |
10 | #include <linux/node.h> | ||
10 | 11 | ||
11 | #include <asm/atomic.h> | 12 | #include <asm/atomic.h> |
12 | #include <asm/page.h> | 13 | #include <asm/page.h> |
@@ -171,8 +172,10 @@ extern unsigned int nr_free_pagecache_pages(void); | |||
171 | 172 | ||
172 | 173 | ||
173 | /* linux/mm/swap.c */ | 174 | /* linux/mm/swap.c */ |
174 | extern void lru_cache_add(struct page *); | 175 | extern void __lru_cache_add(struct page *, enum lru_list lru); |
175 | extern void lru_cache_add_active(struct page *); | 176 | extern void lru_cache_add_lru(struct page *, enum lru_list lru); |
177 | extern void lru_cache_add_active_or_unevictable(struct page *, | ||
178 | struct vm_area_struct *); | ||
176 | extern void activate_page(struct page *); | 179 | extern void activate_page(struct page *); |
177 | extern void mark_page_accessed(struct page *); | 180 | extern void mark_page_accessed(struct page *); |
178 | extern void lru_add_drain(void); | 181 | extern void lru_add_drain(void); |
@@ -180,12 +183,38 @@ extern int lru_add_drain_all(void); | |||
180 | extern void rotate_reclaimable_page(struct page *page); | 183 | extern void rotate_reclaimable_page(struct page *page); |
181 | extern void swap_setup(void); | 184 | extern void swap_setup(void); |
182 | 185 | ||
186 | extern void add_page_to_unevictable_list(struct page *page); | ||
187 | |||
188 | /** | ||
189 | * lru_cache_add: add a page to the page lists | ||
190 | * @page: the page to add | ||
191 | */ | ||
192 | static inline void lru_cache_add_anon(struct page *page) | ||
193 | { | ||
194 | __lru_cache_add(page, LRU_INACTIVE_ANON); | ||
195 | } | ||
196 | |||
197 | static inline void lru_cache_add_active_anon(struct page *page) | ||
198 | { | ||
199 | __lru_cache_add(page, LRU_ACTIVE_ANON); | ||
200 | } | ||
201 | |||
202 | static inline void lru_cache_add_file(struct page *page) | ||
203 | { | ||
204 | __lru_cache_add(page, LRU_INACTIVE_FILE); | ||
205 | } | ||
206 | |||
207 | static inline void lru_cache_add_active_file(struct page *page) | ||
208 | { | ||
209 | __lru_cache_add(page, LRU_ACTIVE_FILE); | ||
210 | } | ||
211 | |||
183 | /* linux/mm/vmscan.c */ | 212 | /* linux/mm/vmscan.c */ |
184 | extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order, | 213 | extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order, |
185 | gfp_t gfp_mask); | 214 | gfp_t gfp_mask); |
186 | extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem, | 215 | extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem, |
187 | gfp_t gfp_mask); | 216 | gfp_t gfp_mask); |
188 | extern int __isolate_lru_page(struct page *page, int mode); | 217 | extern int __isolate_lru_page(struct page *page, int mode, int file); |
189 | extern unsigned long shrink_all_memory(unsigned long nr_pages); | 218 | extern unsigned long shrink_all_memory(unsigned long nr_pages); |
190 | extern int vm_swappiness; | 219 | extern int vm_swappiness; |
191 | extern int remove_mapping(struct address_space *mapping, struct page *page); | 220 | extern int remove_mapping(struct address_space *mapping, struct page *page); |
@@ -204,6 +233,34 @@ static inline int zone_reclaim(struct zone *z, gfp_t mask, unsigned int order) | |||
204 | } | 233 | } |
205 | #endif | 234 | #endif |
206 | 235 | ||
236 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
237 | extern int page_evictable(struct page *page, struct vm_area_struct *vma); | ||
238 | extern void scan_mapping_unevictable_pages(struct address_space *); | ||
239 | |||
240 | extern unsigned long scan_unevictable_pages; | ||
241 | extern int scan_unevictable_handler(struct ctl_table *, int, struct file *, | ||
242 | void __user *, size_t *, loff_t *); | ||
243 | extern int scan_unevictable_register_node(struct node *node); | ||
244 | extern void scan_unevictable_unregister_node(struct node *node); | ||
245 | #else | ||
246 | static inline int page_evictable(struct page *page, | ||
247 | struct vm_area_struct *vma) | ||
248 | { | ||
249 | return 1; | ||
250 | } | ||
251 | |||
252 | static inline void scan_mapping_unevictable_pages(struct address_space *mapping) | ||
253 | { | ||
254 | } | ||
255 | |||
256 | static inline int scan_unevictable_register_node(struct node *node) | ||
257 | { | ||
258 | return 0; | ||
259 | } | ||
260 | |||
261 | static inline void scan_unevictable_unregister_node(struct node *node) { } | ||
262 | #endif | ||
263 | |||
207 | extern int kswapd_run(int nid); | 264 | extern int kswapd_run(int nid); |
208 | 265 | ||
209 | #ifdef CONFIG_MMU | 266 | #ifdef CONFIG_MMU |
@@ -251,6 +308,7 @@ extern sector_t swapdev_block(int, pgoff_t); | |||
251 | extern struct swap_info_struct *get_swap_info_struct(unsigned); | 308 | extern struct swap_info_struct *get_swap_info_struct(unsigned); |
252 | extern int can_share_swap_page(struct page *); | 309 | extern int can_share_swap_page(struct page *); |
253 | extern int remove_exclusive_swap_page(struct page *); | 310 | extern int remove_exclusive_swap_page(struct page *); |
311 | extern int remove_exclusive_swap_page_ref(struct page *); | ||
254 | struct backing_dev_info; | 312 | struct backing_dev_info; |
255 | 313 | ||
256 | /* linux/mm/thrash.c */ | 314 | /* linux/mm/thrash.c */ |
@@ -339,6 +397,11 @@ static inline int remove_exclusive_swap_page(struct page *p) | |||
339 | return 0; | 397 | return 0; |
340 | } | 398 | } |
341 | 399 | ||
400 | static inline int remove_exclusive_swap_page_ref(struct page *page) | ||
401 | { | ||
402 | return 0; | ||
403 | } | ||
404 | |||
342 | static inline swp_entry_t get_swap_page(void) | 405 | static inline swp_entry_t get_swap_page(void) |
343 | { | 406 | { |
344 | swp_entry_t entry; | 407 | swp_entry_t entry; |
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h new file mode 100644 index 000000000000..b18ec5533e8c --- /dev/null +++ b/include/linux/swiotlb.h | |||
@@ -0,0 +1,83 @@ | |||
1 | #ifndef __LINUX_SWIOTLB_H | ||
2 | #define __LINUX_SWIOTLB_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | struct device; | ||
7 | struct dma_attrs; | ||
8 | struct scatterlist; | ||
9 | |||
10 | extern void | ||
11 | swiotlb_init(void); | ||
12 | |||
13 | extern void | ||
14 | *swiotlb_alloc_coherent(struct device *hwdev, size_t size, | ||
15 | dma_addr_t *dma_handle, gfp_t flags); | ||
16 | |||
17 | extern void | ||
18 | swiotlb_free_coherent(struct device *hwdev, size_t size, | ||
19 | void *vaddr, dma_addr_t dma_handle); | ||
20 | |||
21 | extern dma_addr_t | ||
22 | swiotlb_map_single(struct device *hwdev, void *ptr, size_t size, int dir); | ||
23 | |||
24 | extern void | ||
25 | swiotlb_unmap_single(struct device *hwdev, dma_addr_t dev_addr, | ||
26 | size_t size, int dir); | ||
27 | |||
28 | extern dma_addr_t | ||
29 | swiotlb_map_single_attrs(struct device *hwdev, void *ptr, size_t size, | ||
30 | int dir, struct dma_attrs *attrs); | ||
31 | |||
32 | extern void | ||
33 | swiotlb_unmap_single_attrs(struct device *hwdev, dma_addr_t dev_addr, | ||
34 | size_t size, int dir, struct dma_attrs *attrs); | ||
35 | |||
36 | extern int | ||
37 | swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, int nents, | ||
38 | int direction); | ||
39 | |||
40 | extern void | ||
41 | swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents, | ||
42 | int direction); | ||
43 | |||
44 | extern int | ||
45 | swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, int nelems, | ||
46 | int dir, struct dma_attrs *attrs); | ||
47 | |||
48 | extern void | ||
49 | swiotlb_unmap_sg_attrs(struct device *hwdev, struct scatterlist *sgl, | ||
50 | int nelems, int dir, struct dma_attrs *attrs); | ||
51 | |||
52 | extern void | ||
53 | swiotlb_sync_single_for_cpu(struct device *hwdev, dma_addr_t dev_addr, | ||
54 | size_t size, int dir); | ||
55 | |||
56 | extern void | ||
57 | swiotlb_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg, | ||
58 | int nelems, int dir); | ||
59 | |||
60 | extern void | ||
61 | swiotlb_sync_single_for_device(struct device *hwdev, dma_addr_t dev_addr, | ||
62 | size_t size, int dir); | ||
63 | |||
64 | extern void | ||
65 | swiotlb_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg, | ||
66 | int nelems, int dir); | ||
67 | |||
68 | extern void | ||
69 | swiotlb_sync_single_range_for_cpu(struct device *hwdev, dma_addr_t dev_addr, | ||
70 | unsigned long offset, size_t size, int dir); | ||
71 | |||
72 | extern void | ||
73 | swiotlb_sync_single_range_for_device(struct device *hwdev, dma_addr_t dev_addr, | ||
74 | unsigned long offset, size_t size, | ||
75 | int dir); | ||
76 | |||
77 | extern int | ||
78 | swiotlb_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr); | ||
79 | |||
80 | extern int | ||
81 | swiotlb_dma_supported(struct device *hwdev, u64 mask); | ||
82 | |||
83 | #endif /* __LINUX_SWIOTLB_H */ | ||
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index d0437f36921f..39d471d1163b 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -972,7 +972,7 @@ extern int sysctl_perm(struct ctl_table_root *root, | |||
972 | 972 | ||
973 | typedef struct ctl_table ctl_table; | 973 | typedef struct ctl_table ctl_table; |
974 | 974 | ||
975 | typedef int ctl_handler (struct ctl_table *table, int __user *name, int nlen, | 975 | typedef int ctl_handler (struct ctl_table *table, |
976 | void __user *oldval, size_t __user *oldlenp, | 976 | void __user *oldval, size_t __user *oldlenp, |
977 | void __user *newval, size_t newlen); | 977 | void __user *newval, size_t newlen); |
978 | 978 | ||
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 37fa24152bd8..9d68fed50f11 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -21,8 +21,9 @@ struct kobject; | |||
21 | struct module; | 21 | struct module; |
22 | 22 | ||
23 | /* FIXME | 23 | /* FIXME |
24 | * The *owner field is no longer used, but leave around | 24 | * The *owner field is no longer used. |
25 | * until the tree gets cleaned up fully. | 25 | * x86 tree has been cleaned up. The owner |
26 | * attribute is still left for other arches. | ||
26 | */ | 27 | */ |
27 | struct attribute { | 28 | struct attribute { |
28 | const char *name; | 29 | const char *name; |
@@ -78,6 +79,8 @@ struct sysfs_ops { | |||
78 | ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); | 79 | ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); |
79 | }; | 80 | }; |
80 | 81 | ||
82 | struct sysfs_dirent; | ||
83 | |||
81 | #ifdef CONFIG_SYSFS | 84 | #ifdef CONFIG_SYSFS |
82 | 85 | ||
83 | int sysfs_schedule_callback(struct kobject *kobj, void (*func)(void *), | 86 | int sysfs_schedule_callback(struct kobject *kobj, void (*func)(void *), |
@@ -117,9 +120,14 @@ int sysfs_add_file_to_group(struct kobject *kobj, | |||
117 | void sysfs_remove_file_from_group(struct kobject *kobj, | 120 | void sysfs_remove_file_from_group(struct kobject *kobj, |
118 | const struct attribute *attr, const char *group); | 121 | const struct attribute *attr, const char *group); |
119 | 122 | ||
120 | void sysfs_notify(struct kobject *kobj, char *dir, char *attr); | 123 | void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); |
121 | 124 | void sysfs_notify_dirent(struct sysfs_dirent *sd); | |
122 | extern int __must_check sysfs_init(void); | 125 | struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd, |
126 | const unsigned char *name); | ||
127 | struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd); | ||
128 | void sysfs_put(struct sysfs_dirent *sd); | ||
129 | void sysfs_printk_last_file(void); | ||
130 | int __must_check sysfs_init(void); | ||
123 | 131 | ||
124 | #else /* CONFIG_SYSFS */ | 132 | #else /* CONFIG_SYSFS */ |
125 | 133 | ||
@@ -222,7 +230,24 @@ static inline void sysfs_remove_file_from_group(struct kobject *kobj, | |||
222 | { | 230 | { |
223 | } | 231 | } |
224 | 232 | ||
225 | static inline void sysfs_notify(struct kobject *kobj, char *dir, char *attr) | 233 | static inline void sysfs_notify(struct kobject *kobj, const char *dir, |
234 | const char *attr) | ||
235 | { | ||
236 | } | ||
237 | static inline void sysfs_notify_dirent(struct sysfs_dirent *sd) | ||
238 | { | ||
239 | } | ||
240 | static inline | ||
241 | struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd, | ||
242 | const unsigned char *name) | ||
243 | { | ||
244 | return NULL; | ||
245 | } | ||
246 | static inline struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd) | ||
247 | { | ||
248 | return NULL; | ||
249 | } | ||
250 | static inline void sysfs_put(struct sysfs_dirent *sd) | ||
226 | { | 251 | { |
227 | } | 252 | } |
228 | 253 | ||
@@ -231,6 +256,10 @@ static inline int __must_check sysfs_init(void) | |||
231 | return 0; | 256 | return 0; |
232 | } | 257 | } |
233 | 258 | ||
259 | static inline void sysfs_printk_last_file(void) | ||
260 | { | ||
261 | } | ||
262 | |||
234 | #endif /* CONFIG_SYSFS */ | 263 | #endif /* CONFIG_SYSFS */ |
235 | 264 | ||
236 | #endif /* _SYSFS_H_ */ | 265 | #endif /* _SYSFS_H_ */ |
diff --git a/include/linux/task_io_accounting.h b/include/linux/task_io_accounting.h index 5e88afc9a2fb..bdf855c2856f 100644 --- a/include/linux/task_io_accounting.h +++ b/include/linux/task_io_accounting.h | |||
@@ -5,7 +5,7 @@ | |||
5 | * Don't include this header file directly - it is designed to be dragged in via | 5 | * Don't include this header file directly - it is designed to be dragged in via |
6 | * sched.h. | 6 | * sched.h. |
7 | * | 7 | * |
8 | * Blame akpm@osdl.org for all this. | 8 | * Blame Andrew Morton for all this. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | struct task_io_accounting { | 11 | struct task_io_accounting { |
diff --git a/include/linux/telephony.h b/include/linux/telephony.h index 0d0cf2a1e7bc..5b2b6261f193 100644 --- a/include/linux/telephony.h +++ b/include/linux/telephony.h | |||
@@ -28,10 +28,6 @@ | |||
28 | * ON AN "AS IS" BASIS, AND QUICKNET TECHNOLOGIES, INC. HAS NO OBLIGATION | 28 | * ON AN "AS IS" BASIS, AND QUICKNET TECHNOLOGIES, INC. HAS NO OBLIGATION |
29 | * TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 29 | * TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
30 | * | 30 | * |
31 | * Version: $Revision: 4.2 $ | ||
32 | * | ||
33 | * $Id: telephony.h,v 4.2 2001/08/06 07:09:43 craigs Exp $ | ||
34 | * | ||
35 | *****************************************************************************/ | 31 | *****************************************************************************/ |
36 | 32 | ||
37 | #ifndef TELEPHONY_H | 33 | #ifndef TELEPHONY_H |
diff --git a/include/linux/time.h b/include/linux/time.h index e15206a7e82e..51e883df0fa5 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -29,6 +29,8 @@ struct timezone { | |||
29 | 29 | ||
30 | #ifdef __KERNEL__ | 30 | #ifdef __KERNEL__ |
31 | 31 | ||
32 | extern struct timezone sys_tz; | ||
33 | |||
32 | /* Parameters used to convert the timespec values: */ | 34 | /* Parameters used to convert the timespec values: */ |
33 | #define MSEC_PER_SEC 1000L | 35 | #define MSEC_PER_SEC 1000L |
34 | #define USEC_PER_MSEC 1000L | 36 | #define USEC_PER_MSEC 1000L |
diff --git a/include/linux/types.h b/include/linux/types.h index d4a9ce6e2760..f24f7beb47df 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
@@ -191,12 +191,14 @@ typedef __u32 __bitwise __wsum; | |||
191 | #ifdef __KERNEL__ | 191 | #ifdef __KERNEL__ |
192 | typedef unsigned __bitwise__ gfp_t; | 192 | typedef unsigned __bitwise__ gfp_t; |
193 | 193 | ||
194 | #ifdef CONFIG_RESOURCES_64BIT | 194 | #ifdef CONFIG_PHYS_ADDR_T_64BIT |
195 | typedef u64 resource_size_t; | 195 | typedef u64 phys_addr_t; |
196 | #else | 196 | #else |
197 | typedef u32 resource_size_t; | 197 | typedef u32 phys_addr_t; |
198 | #endif | 198 | #endif |
199 | 199 | ||
200 | typedef phys_addr_t resource_size_t; | ||
201 | |||
200 | struct ustat { | 202 | struct ustat { |
201 | __kernel_daddr_t f_tfree; | 203 | __kernel_daddr_t f_tfree; |
202 | __kernel_ino_t f_tinode; | 204 | __kernel_ino_t f_tinode; |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 94ac74aba6b6..8fa973bede5e 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -1135,6 +1135,7 @@ struct usb_anchor { | |||
1135 | struct list_head urb_list; | 1135 | struct list_head urb_list; |
1136 | wait_queue_head_t wait; | 1136 | wait_queue_head_t wait; |
1137 | spinlock_t lock; | 1137 | spinlock_t lock; |
1138 | unsigned int poisoned:1; | ||
1138 | }; | 1139 | }; |
1139 | 1140 | ||
1140 | static inline void init_usb_anchor(struct usb_anchor *anchor) | 1141 | static inline void init_usb_anchor(struct usb_anchor *anchor) |
@@ -1459,12 +1460,18 @@ extern struct urb *usb_get_urb(struct urb *urb); | |||
1459 | extern int usb_submit_urb(struct urb *urb, gfp_t mem_flags); | 1460 | extern int usb_submit_urb(struct urb *urb, gfp_t mem_flags); |
1460 | extern int usb_unlink_urb(struct urb *urb); | 1461 | extern int usb_unlink_urb(struct urb *urb); |
1461 | extern void usb_kill_urb(struct urb *urb); | 1462 | extern void usb_kill_urb(struct urb *urb); |
1463 | extern void usb_poison_urb(struct urb *urb); | ||
1464 | extern void usb_unpoison_urb(struct urb *urb); | ||
1462 | extern void usb_kill_anchored_urbs(struct usb_anchor *anchor); | 1465 | extern void usb_kill_anchored_urbs(struct usb_anchor *anchor); |
1466 | extern void usb_poison_anchored_urbs(struct usb_anchor *anchor); | ||
1463 | extern void usb_unlink_anchored_urbs(struct usb_anchor *anchor); | 1467 | extern void usb_unlink_anchored_urbs(struct usb_anchor *anchor); |
1464 | extern void usb_anchor_urb(struct urb *urb, struct usb_anchor *anchor); | 1468 | extern void usb_anchor_urb(struct urb *urb, struct usb_anchor *anchor); |
1465 | extern void usb_unanchor_urb(struct urb *urb); | 1469 | extern void usb_unanchor_urb(struct urb *urb); |
1466 | extern int usb_wait_anchor_empty_timeout(struct usb_anchor *anchor, | 1470 | extern int usb_wait_anchor_empty_timeout(struct usb_anchor *anchor, |
1467 | unsigned int timeout); | 1471 | unsigned int timeout); |
1472 | extern struct urb *usb_get_from_anchor(struct usb_anchor *anchor); | ||
1473 | extern void usb_scuttle_anchored_urbs(struct usb_anchor *anchor); | ||
1474 | extern int usb_anchor_empty(struct usb_anchor *anchor); | ||
1468 | 1475 | ||
1469 | /** | 1476 | /** |
1470 | * usb_urb_dir_in - check if an URB describes an IN transfer | 1477 | * usb_urb_dir_in - check if an URB describes an IN transfer |
diff --git a/include/linux/usb/Kbuild b/include/linux/usb/Kbuild index 42e84fc315e3..54c446309a2a 100644 --- a/include/linux/usb/Kbuild +++ b/include/linux/usb/Kbuild | |||
@@ -4,4 +4,5 @@ header-y += ch9.h | |||
4 | header-y += gadgetfs.h | 4 | header-y += gadgetfs.h |
5 | header-y += midi.h | 5 | header-y += midi.h |
6 | header-y += g_printer.h | 6 | header-y += g_printer.h |
7 | 7 | header-y += tmc.h | |
8 | header-y += vstusb.h | ||
diff --git a/include/linux/usb/cdc.h b/include/linux/usb/cdc.h index ca228bb94218..18a729343ffa 100644 --- a/include/linux/usb/cdc.h +++ b/include/linux/usb/cdc.h | |||
@@ -160,6 +160,15 @@ struct usb_cdc_mdlm_detail_desc { | |||
160 | __u8 bDetailData[0]; | 160 | __u8 bDetailData[0]; |
161 | } __attribute__ ((packed)); | 161 | } __attribute__ ((packed)); |
162 | 162 | ||
163 | /* "OBEX Control Model Functional Descriptor" */ | ||
164 | struct usb_cdc_obex_desc { | ||
165 | __u8 bLength; | ||
166 | __u8 bDescriptorType; | ||
167 | __u8 bDescriptorSubType; | ||
168 | |||
169 | __le16 bcdVersion; | ||
170 | } __attribute__ ((packed)); | ||
171 | |||
163 | /*-------------------------------------------------------------------------*/ | 172 | /*-------------------------------------------------------------------------*/ |
164 | 173 | ||
165 | /* | 174 | /* |
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index c932390c6da0..935c380ffe47 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
@@ -130,6 +130,9 @@ struct usb_function { | |||
130 | 130 | ||
131 | int usb_add_function(struct usb_configuration *, struct usb_function *); | 131 | int usb_add_function(struct usb_configuration *, struct usb_function *); |
132 | 132 | ||
133 | int usb_function_deactivate(struct usb_function *); | ||
134 | int usb_function_activate(struct usb_function *); | ||
135 | |||
133 | int usb_interface_id(struct usb_configuration *, struct usb_function *); | 136 | int usb_interface_id(struct usb_configuration *, struct usb_function *); |
134 | 137 | ||
135 | /** | 138 | /** |
@@ -316,9 +319,13 @@ struct usb_composite_dev { | |||
316 | struct usb_composite_driver *driver; | 319 | struct usb_composite_driver *driver; |
317 | u8 next_string_id; | 320 | u8 next_string_id; |
318 | 321 | ||
319 | spinlock_t lock; | 322 | /* the gadget driver won't enable the data pullup |
323 | * while the deactivation count is nonzero. | ||
324 | */ | ||
325 | unsigned deactivations; | ||
320 | 326 | ||
321 | /* REVISIT use and existence of lock ... */ | 327 | /* protects at least deactivation count */ |
328 | spinlock_t lock; | ||
322 | }; | 329 | }; |
323 | 330 | ||
324 | extern int usb_string_id(struct usb_composite_dev *c); | 331 | extern int usb_string_id(struct usb_composite_dev *c); |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 655341d0f534..0b8617a9176d 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -192,7 +192,7 @@ static inline void usb_set_serial_data(struct usb_serial *serial, void *data) | |||
192 | * The driver.owner field should be set to the module owner of this driver. | 192 | * The driver.owner field should be set to the module owner of this driver. |
193 | * The driver.name field should be set to the name of this driver (remember | 193 | * The driver.name field should be set to the name of this driver (remember |
194 | * it will show up in sysfs, so it needs to be short and to the point. | 194 | * it will show up in sysfs, so it needs to be short and to the point. |
195 | * Useing the module name is a good idea.) | 195 | * Using the module name is a good idea.) |
196 | */ | 196 | */ |
197 | struct usb_serial_driver { | 197 | struct usb_serial_driver { |
198 | const char *description; | 198 | const char *description; |
diff --git a/include/linux/usb/tmc.h b/include/linux/usb/tmc.h new file mode 100644 index 000000000000..c045ae12556c --- /dev/null +++ b/include/linux/usb/tmc.h | |||
@@ -0,0 +1,43 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007 Stefan Kopp, Gechingen, Germany | ||
3 | * Copyright (C) 2008 Novell, Inc. | ||
4 | * Copyright (C) 2008 Greg Kroah-Hartman <gregkh@suse.de> | ||
5 | * | ||
6 | * This file holds USB constants defined by the USB Device Class | ||
7 | * Definition for Test and Measurement devices published by the USB-IF. | ||
8 | * | ||
9 | * It also has the ioctl definitions for the usbtmc kernel driver that | ||
10 | * userspace needs to know about. | ||
11 | */ | ||
12 | |||
13 | #ifndef __LINUX_USB_TMC_H | ||
14 | #define __LINUX_USB_TMC_H | ||
15 | |||
16 | /* USB TMC status values */ | ||
17 | #define USBTMC_STATUS_SUCCESS 0x01 | ||
18 | #define USBTMC_STATUS_PENDING 0x02 | ||
19 | #define USBTMC_STATUS_FAILED 0x80 | ||
20 | #define USBTMC_STATUS_TRANSFER_NOT_IN_PROGRESS 0x81 | ||
21 | #define USBTMC_STATUS_SPLIT_NOT_IN_PROGRESS 0x82 | ||
22 | #define USBTMC_STATUS_SPLIT_IN_PROGRESS 0x83 | ||
23 | |||
24 | /* USB TMC requests values */ | ||
25 | #define USBTMC_REQUEST_INITIATE_ABORT_BULK_OUT 1 | ||
26 | #define USBTMC_REQUEST_CHECK_ABORT_BULK_OUT_STATUS 2 | ||
27 | #define USBTMC_REQUEST_INITIATE_ABORT_BULK_IN 3 | ||
28 | #define USBTMC_REQUEST_CHECK_ABORT_BULK_IN_STATUS 4 | ||
29 | #define USBTMC_REQUEST_INITIATE_CLEAR 5 | ||
30 | #define USBTMC_REQUEST_CHECK_CLEAR_STATUS 6 | ||
31 | #define USBTMC_REQUEST_GET_CAPABILITIES 7 | ||
32 | #define USBTMC_REQUEST_INDICATOR_PULSE 64 | ||
33 | |||
34 | /* Request values for USBTMC driver's ioctl entry point */ | ||
35 | #define USBTMC_IOC_NR 91 | ||
36 | #define USBTMC_IOCTL_INDICATOR_PULSE _IO(USBTMC_IOC_NR, 1) | ||
37 | #define USBTMC_IOCTL_CLEAR _IO(USBTMC_IOC_NR, 2) | ||
38 | #define USBTMC_IOCTL_ABORT_BULK_OUT _IO(USBTMC_IOC_NR, 3) | ||
39 | #define USBTMC_IOCTL_ABORT_BULK_IN _IO(USBTMC_IOC_NR, 4) | ||
40 | #define USBTMC_IOCTL_CLEAR_OUT_HALT _IO(USBTMC_IOC_NR, 6) | ||
41 | #define USBTMC_IOCTL_CLEAR_IN_HALT _IO(USBTMC_IOC_NR, 7) | ||
42 | |||
43 | #endif | ||
diff --git a/include/linux/usb/vstusb.h b/include/linux/usb/vstusb.h new file mode 100644 index 000000000000..1cfac67191ff --- /dev/null +++ b/include/linux/usb/vstusb.h | |||
@@ -0,0 +1,71 @@ | |||
1 | /***************************************************************************** | ||
2 | * File: drivers/usb/misc/vstusb.h | ||
3 | * | ||
4 | * Purpose: Support for the bulk USB Vernier Spectrophotometers | ||
5 | * | ||
6 | * Author: EQware Engineering, Inc. | ||
7 | * Oregon City, OR, USA 97045 | ||
8 | * | ||
9 | * Copyright: 2007, 2008 | ||
10 | * Vernier Software & Technology | ||
11 | * Beaverton, OR, USA 97005 | ||
12 | * | ||
13 | * Web: www.vernier.com | ||
14 | * | ||
15 | * This program is free software; you can redistribute it and/or modify | ||
16 | * it under the terms of the GNU General Public License version 2 as | ||
17 | * published by the Free Software Foundation. | ||
18 | * | ||
19 | *****************************************************************************/ | ||
20 | /***************************************************************************** | ||
21 | * | ||
22 | * The vstusb module is a standard usb 'client' driver running on top of the | ||
23 | * standard usb host controller stack. | ||
24 | * | ||
25 | * In general, vstusb supports standard bulk usb pipes. It supports multiple | ||
26 | * devices and multiple pipes per device. | ||
27 | * | ||
28 | * The vstusb driver supports two interfaces: | ||
29 | * 1 - ioctl SEND_PIPE/RECV_PIPE - a general bulk write/read msg | ||
30 | * interface to any pipe with timeout support; | ||
31 | * 2 - standard read/write with ioctl config - offers standard read/write | ||
32 | * interface with ioctl configured pipes and timeouts. | ||
33 | * | ||
34 | * Both interfaces can be signal from other process and will abort its i/o | ||
35 | * operation. | ||
36 | * | ||
37 | * A timeout of 0 means NO timeout. The user can still terminate the read via | ||
38 | * signal. | ||
39 | * | ||
40 | * If using multiple threads with this driver, the user should ensure that | ||
41 | * any reads, writes, or ioctls are complete before closing the device. | ||
42 | * Changing read/write timeouts or pipes takes effect on next read/write. | ||
43 | * | ||
44 | *****************************************************************************/ | ||
45 | |||
46 | struct vstusb_args { | ||
47 | union { | ||
48 | /* this struct is used for IOCTL_VSTUSB_SEND_PIPE, * | ||
49 | * IOCTL_VSTUSB_RECV_PIPE, and read()/write() fops */ | ||
50 | struct { | ||
51 | void __user *buffer; | ||
52 | size_t count; | ||
53 | unsigned int timeout_ms; | ||
54 | int pipe; | ||
55 | }; | ||
56 | |||
57 | /* this one is used for IOCTL_VSTUSB_CONFIG_RW */ | ||
58 | struct { | ||
59 | int rd_pipe; | ||
60 | int rd_timeout_ms; | ||
61 | int wr_pipe; | ||
62 | int wr_timeout_ms; | ||
63 | }; | ||
64 | }; | ||
65 | }; | ||
66 | |||
67 | #define VST_IOC_MAGIC 'L' | ||
68 | #define VST_IOC_FIRST 0x20 | ||
69 | #define IOCTL_VSTUSB_SEND_PIPE _IO(VST_IOC_MAGIC, VST_IOC_FIRST) | ||
70 | #define IOCTL_VSTUSB_RECV_PIPE _IO(VST_IOC_MAGIC, VST_IOC_FIRST + 1) | ||
71 | #define IOCTL_VSTUSB_CONFIG_RW _IO(VST_IOC_MAGIC, VST_IOC_FIRST + 2) | ||
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 328eb4022727..4c28c4d564e2 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _LINUX_VMALLOC_H | 2 | #define _LINUX_VMALLOC_H |
3 | 3 | ||
4 | #include <linux/spinlock.h> | 4 | #include <linux/spinlock.h> |
5 | #include <linux/init.h> | ||
5 | #include <asm/page.h> /* pgprot_t */ | 6 | #include <asm/page.h> /* pgprot_t */ |
6 | 7 | ||
7 | struct vm_area_struct; /* vma defining user mapping in mm_types.h */ | 8 | struct vm_area_struct; /* vma defining user mapping in mm_types.h */ |
@@ -23,7 +24,6 @@ struct vm_area_struct; /* vma defining user mapping in mm_types.h */ | |||
23 | #endif | 24 | #endif |
24 | 25 | ||
25 | struct vm_struct { | 26 | struct vm_struct { |
26 | /* keep next,addr,size together to speedup lookups */ | ||
27 | struct vm_struct *next; | 27 | struct vm_struct *next; |
28 | void *addr; | 28 | void *addr; |
29 | unsigned long size; | 29 | unsigned long size; |
@@ -37,6 +37,19 @@ struct vm_struct { | |||
37 | /* | 37 | /* |
38 | * Highlevel APIs for driver use | 38 | * Highlevel APIs for driver use |
39 | */ | 39 | */ |
40 | extern void vm_unmap_ram(const void *mem, unsigned int count); | ||
41 | extern void *vm_map_ram(struct page **pages, unsigned int count, | ||
42 | int node, pgprot_t prot); | ||
43 | extern void vm_unmap_aliases(void); | ||
44 | |||
45 | #ifdef CONFIG_MMU | ||
46 | extern void __init vmalloc_init(void); | ||
47 | #else | ||
48 | static inline void vmalloc_init(void) | ||
49 | { | ||
50 | } | ||
51 | #endif | ||
52 | |||
40 | extern void *vmalloc(unsigned long size); | 53 | extern void *vmalloc(unsigned long size); |
41 | extern void *vmalloc_user(unsigned long size); | 54 | extern void *vmalloc_user(unsigned long size); |
42 | extern void *vmalloc_node(unsigned long size, int node); | 55 | extern void *vmalloc_node(unsigned long size, int node); |
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index 58334d439516..9cd3ab0f554d 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
@@ -41,6 +41,16 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, | |||
41 | #ifdef CONFIG_HUGETLB_PAGE | 41 | #ifdef CONFIG_HUGETLB_PAGE |
42 | HTLB_BUDDY_PGALLOC, HTLB_BUDDY_PGALLOC_FAIL, | 42 | HTLB_BUDDY_PGALLOC, HTLB_BUDDY_PGALLOC_FAIL, |
43 | #endif | 43 | #endif |
44 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
45 | UNEVICTABLE_PGCULLED, /* culled to noreclaim list */ | ||
46 | UNEVICTABLE_PGSCANNED, /* scanned for reclaimability */ | ||
47 | UNEVICTABLE_PGRESCUED, /* rescued from noreclaim list */ | ||
48 | UNEVICTABLE_PGMLOCKED, | ||
49 | UNEVICTABLE_PGMUNLOCKED, | ||
50 | UNEVICTABLE_PGCLEARED, /* on COW, page truncate */ | ||
51 | UNEVICTABLE_PGSTRANDED, /* unable to isolate on unlock */ | ||
52 | UNEVICTABLE_MLOCKFREED, | ||
53 | #endif | ||
44 | NR_VM_EVENT_ITEMS | 54 | NR_VM_EVENT_ITEMS |
45 | }; | 55 | }; |
46 | 56 | ||
@@ -159,6 +169,16 @@ static inline unsigned long zone_page_state(struct zone *zone, | |||
159 | return x; | 169 | return x; |
160 | } | 170 | } |
161 | 171 | ||
172 | extern unsigned long global_lru_pages(void); | ||
173 | |||
174 | static inline unsigned long zone_lru_pages(struct zone *zone) | ||
175 | { | ||
176 | return (zone_page_state(zone, NR_ACTIVE_ANON) | ||
177 | + zone_page_state(zone, NR_ACTIVE_FILE) | ||
178 | + zone_page_state(zone, NR_INACTIVE_ANON) | ||
179 | + zone_page_state(zone, NR_INACTIVE_FILE)); | ||
180 | } | ||
181 | |||
162 | #ifdef CONFIG_NUMA | 182 | #ifdef CONFIG_NUMA |
163 | /* | 183 | /* |
164 | * Determine the per node value of a stat item. This function | 184 | * Determine the per node value of a stat item. This function |
diff --git a/include/linux/wait.h b/include/linux/wait.h index 0081147a9fe8..ef609f842fac 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
@@ -108,15 +108,6 @@ static inline int waitqueue_active(wait_queue_head_t *q) | |||
108 | return !list_empty(&q->task_list); | 108 | return !list_empty(&q->task_list); |
109 | } | 109 | } |
110 | 110 | ||
111 | /* | ||
112 | * Used to distinguish between sync and async io wait context: | ||
113 | * sync i/o typically specifies a NULL wait queue entry or a wait | ||
114 | * queue entry bound to a task (current task) to wake up. | ||
115 | * aio specifies a wait queue entry with an async notification | ||
116 | * callback routine, not associated with any task. | ||
117 | */ | ||
118 | #define is_sync_wait(wait) (!(wait) || ((wait)->private)) | ||
119 | |||
120 | extern void add_wait_queue(wait_queue_head_t *q, wait_queue_t *wait); | 111 | extern void add_wait_queue(wait_queue_head_t *q, wait_queue_t *wait); |
121 | extern void add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t *wait); | 112 | extern void add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t *wait); |
122 | extern void remove_wait_queue(wait_queue_head_t *q, wait_queue_t *wait); | 113 | extern void remove_wait_queue(wait_queue_head_t *q, wait_queue_t *wait); |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 12b15c561a1f..e585657e9831 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -63,7 +63,15 @@ struct writeback_control { | |||
63 | unsigned for_writepages:1; /* This is a writepages() call */ | 63 | unsigned for_writepages:1; /* This is a writepages() call */ |
64 | unsigned range_cyclic:1; /* range_start is cyclic */ | 64 | unsigned range_cyclic:1; /* range_start is cyclic */ |
65 | unsigned more_io:1; /* more io to be dispatched */ | 65 | unsigned more_io:1; /* more io to be dispatched */ |
66 | unsigned range_cont:1; | 66 | /* |
67 | * write_cache_pages() won't update wbc->nr_to_write and | ||
68 | * mapping->writeback_index if no_nrwrite_index_update | ||
69 | * is set. write_cache_pages() may write more than we | ||
70 | * requested and we want to make sure nr_to_write and | ||
71 | * writeback_index are updated in a consistent manner | ||
72 | * so we use a single control to update them | ||
73 | */ | ||
74 | unsigned no_nrwrite_index_update:1; | ||
67 | }; | 75 | }; |
68 | 76 | ||
69 | /* | 77 | /* |