diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/console_struct.h | 5 | ||||
-rw-r--r-- | include/linux/ide.h | 1 | ||||
-rw-r--r-- | include/linux/kernel.h | 12 | ||||
-rw-r--r-- | include/linux/pci_ids.h | 2 | ||||
-rw-r--r-- | include/linux/pipe_fs_i.h | 30 | ||||
-rw-r--r-- | include/linux/sched.h | 1 | ||||
-rw-r--r-- | include/linux/slub_def.h | 25 |
7 files changed, 49 insertions, 27 deletions
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h index a461f76fb004..dc77fed7b285 100644 --- a/include/linux/console_struct.h +++ b/include/linux/console_struct.h | |||
@@ -9,6 +9,9 @@ | |||
9 | * to achieve effects such as fast scrolling by changing the origin. | 9 | * to achieve effects such as fast scrolling by changing the origin. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #ifndef _LINUX_CONSOLE_STRUCT_H | ||
13 | #define _LINUX_CONSOLE_STRUCT_H | ||
14 | |||
12 | #include <linux/wait.h> | 15 | #include <linux/wait.h> |
13 | #include <linux/vt.h> | 16 | #include <linux/vt.h> |
14 | #include <linux/workqueue.h> | 17 | #include <linux/workqueue.h> |
@@ -130,3 +133,5 @@ extern void vc_SAK(struct work_struct *work); | |||
130 | #define CUR_DEFAULT CUR_UNDERLINE | 133 | #define CUR_DEFAULT CUR_UNDERLINE |
131 | 134 | ||
132 | #define CON_IS_VISIBLE(conp) (*conp->vc_display_fg == conp) | 135 | #define CON_IS_VISIBLE(conp) (*conp->vc_display_fg == conp) |
136 | |||
137 | #endif /* _LINUX_CONSOLE_STRUCT_H */ | ||
diff --git a/include/linux/ide.h b/include/linux/ide.h index 07aba87d369d..1e365acdd369 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -1001,6 +1001,7 @@ struct ide_driver_s { | |||
1001 | struct device_driver gen_driver; | 1001 | struct device_driver gen_driver; |
1002 | int (*probe)(ide_drive_t *); | 1002 | int (*probe)(ide_drive_t *); |
1003 | void (*remove)(ide_drive_t *); | 1003 | void (*remove)(ide_drive_t *); |
1004 | void (*resume)(ide_drive_t *); | ||
1004 | void (*shutdown)(ide_drive_t *); | 1005 | void (*shutdown)(ide_drive_t *); |
1005 | #ifdef CONFIG_IDE_PROC_FS | 1006 | #ifdef CONFIG_IDE_PROC_FS |
1006 | ide_proc_entry_t *proc; | 1007 | ide_proc_entry_t *proc; |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 45353d757cd0..7a4852505914 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -218,10 +218,14 @@ enum { | |||
218 | DUMP_PREFIX_ADDRESS, | 218 | DUMP_PREFIX_ADDRESS, |
219 | DUMP_PREFIX_OFFSET | 219 | DUMP_PREFIX_OFFSET |
220 | }; | 220 | }; |
221 | extern void hex_dump_to_buffer(const void *buf, size_t len, char *linebuf, | 221 | extern void hex_dump_to_buffer(const void *buf, size_t len, |
222 | size_t linebuflen); | 222 | int rowsize, int groupsize, |
223 | extern void print_hex_dump(const char *level, int prefix_type, | 223 | char *linebuf, size_t linebuflen, bool ascii); |
224 | void *buf, size_t len); | 224 | extern void print_hex_dump(const char *level, const char *prefix_str, |
225 | int prefix_type, int rowsize, int groupsize, | ||
226 | void *buf, size_t len, bool ascii); | ||
227 | extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | ||
228 | void *buf, size_t len); | ||
225 | #define hex_asc(x) "0123456789abcdef"[x] | 229 | #define hex_asc(x) "0123456789abcdef"[x] |
226 | 230 | ||
227 | #ifdef DEBUG | 231 | #ifdef DEBUG |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 6a115cffea34..9a03b47da603 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1233,6 +1233,8 @@ | |||
1233 | #define PCI_DEVICE_ID_NVIDIA_NVENET_26 0x054E | 1233 | #define PCI_DEVICE_ID_NVIDIA_NVENET_26 0x054E |
1234 | #define PCI_DEVICE_ID_NVIDIA_NVENET_27 0x054F | 1234 | #define PCI_DEVICE_ID_NVIDIA_NVENET_27 0x054F |
1235 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE 0x0560 | 1235 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE 0x0560 |
1236 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_IDE 0x056C | ||
1237 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE 0x0759 | ||
1236 | 1238 | ||
1237 | #define PCI_VENDOR_ID_IMS 0x10e0 | 1239 | #define PCI_VENDOR_ID_IMS 0x10e0 |
1238 | #define PCI_DEVICE_ID_IMS_TT128 0x9128 | 1240 | #define PCI_DEVICE_ID_IMS_TT128 0x9128 |
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h index 8bcbc54e1b48..c8884f971228 100644 --- a/include/linux/pipe_fs_i.h +++ b/include/linux/pipe_fs_i.h | |||
@@ -16,6 +16,21 @@ struct pipe_buffer { | |||
16 | unsigned int flags; | 16 | unsigned int flags; |
17 | }; | 17 | }; |
18 | 18 | ||
19 | struct pipe_inode_info { | ||
20 | wait_queue_head_t wait; | ||
21 | unsigned int nrbufs, curbuf; | ||
22 | struct page *tmp_page; | ||
23 | unsigned int readers; | ||
24 | unsigned int writers; | ||
25 | unsigned int waiting_writers; | ||
26 | unsigned int r_counter; | ||
27 | unsigned int w_counter; | ||
28 | struct fasync_struct *fasync_readers; | ||
29 | struct fasync_struct *fasync_writers; | ||
30 | struct inode *inode; | ||
31 | struct pipe_buffer bufs[PIPE_BUFFERS]; | ||
32 | }; | ||
33 | |||
19 | /* | 34 | /* |
20 | * Note on the nesting of these functions: | 35 | * Note on the nesting of these functions: |
21 | * | 36 | * |
@@ -38,21 +53,6 @@ struct pipe_buf_operations { | |||
38 | void (*get)(struct pipe_inode_info *, struct pipe_buffer *); | 53 | void (*get)(struct pipe_inode_info *, struct pipe_buffer *); |
39 | }; | 54 | }; |
40 | 55 | ||
41 | struct pipe_inode_info { | ||
42 | wait_queue_head_t wait; | ||
43 | unsigned int nrbufs, curbuf; | ||
44 | struct page *tmp_page; | ||
45 | unsigned int readers; | ||
46 | unsigned int writers; | ||
47 | unsigned int waiting_writers; | ||
48 | unsigned int r_counter; | ||
49 | unsigned int w_counter; | ||
50 | struct fasync_struct *fasync_readers; | ||
51 | struct fasync_struct *fasync_writers; | ||
52 | struct inode *inode; | ||
53 | struct pipe_buffer bufs[PIPE_BUFFERS]; | ||
54 | }; | ||
55 | |||
56 | /* Differs from PIPE_BUF in that PIPE_SIZE is the length of the actual | 56 | /* Differs from PIPE_BUF in that PIPE_SIZE is the length of the actual |
57 | memory allocation, whereas PIPE_BUF makes atomicity guarantees. */ | 57 | memory allocation, whereas PIPE_BUF makes atomicity guarantees. */ |
58 | #define PIPE_SIZE PAGE_SIZE | 58 | #define PIPE_SIZE PAGE_SIZE |
diff --git a/include/linux/sched.h b/include/linux/sched.h index d58e74b98367..693f0e6c54d4 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1162,6 +1162,7 @@ static inline void put_task_struct(struct task_struct *t) | |||
1162 | /* Not implemented yet, only for 486*/ | 1162 | /* Not implemented yet, only for 486*/ |
1163 | #define PF_STARTING 0x00000002 /* being created */ | 1163 | #define PF_STARTING 0x00000002 /* being created */ |
1164 | #define PF_EXITING 0x00000004 /* getting shut down */ | 1164 | #define PF_EXITING 0x00000004 /* getting shut down */ |
1165 | #define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */ | ||
1165 | #define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */ | 1166 | #define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */ |
1166 | #define PF_SUPERPRIV 0x00000100 /* used super-user privileges */ | 1167 | #define PF_SUPERPRIV 0x00000100 /* used super-user privileges */ |
1167 | #define PF_DUMPCORE 0x00000200 /* dumped core */ | 1168 | #define PF_DUMPCORE 0x00000200 /* dumped core */ |
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index 0764c829d967..a0ad37463d62 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
@@ -70,11 +70,8 @@ extern struct kmem_cache kmalloc_caches[KMALLOC_SHIFT_HIGH + 1]; | |||
70 | */ | 70 | */ |
71 | static inline int kmalloc_index(size_t size) | 71 | static inline int kmalloc_index(size_t size) |
72 | { | 72 | { |
73 | /* | 73 | if (!size) |
74 | * We should return 0 if size == 0 but we use the smallest object | 74 | return 0; |
75 | * here for SLAB legacy reasons. | ||
76 | */ | ||
77 | WARN_ON_ONCE(size == 0); | ||
78 | 75 | ||
79 | if (size > KMALLOC_MAX_SIZE) | 76 | if (size > KMALLOC_MAX_SIZE) |
80 | return -1; | 77 | return -1; |
@@ -153,13 +150,25 @@ static inline struct kmem_cache *kmalloc_slab(size_t size) | |||
153 | #define SLUB_DMA 0 | 150 | #define SLUB_DMA 0 |
154 | #endif | 151 | #endif |
155 | 152 | ||
153 | |||
154 | /* | ||
155 | * ZERO_SIZE_PTR will be returned for zero sized kmalloc requests. | ||
156 | * | ||
157 | * Dereferencing ZERO_SIZE_PTR will lead to a distinct access fault. | ||
158 | * | ||
159 | * ZERO_SIZE_PTR can be passed to kfree though in the same way that NULL can. | ||
160 | * Both make kfree a no-op. | ||
161 | */ | ||
162 | #define ZERO_SIZE_PTR ((void *)16) | ||
163 | |||
164 | |||
156 | static inline void *kmalloc(size_t size, gfp_t flags) | 165 | static inline void *kmalloc(size_t size, gfp_t flags) |
157 | { | 166 | { |
158 | if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) { | 167 | if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) { |
159 | struct kmem_cache *s = kmalloc_slab(size); | 168 | struct kmem_cache *s = kmalloc_slab(size); |
160 | 169 | ||
161 | if (!s) | 170 | if (!s) |
162 | return NULL; | 171 | return ZERO_SIZE_PTR; |
163 | 172 | ||
164 | return kmem_cache_alloc(s, flags); | 173 | return kmem_cache_alloc(s, flags); |
165 | } else | 174 | } else |
@@ -172,7 +181,7 @@ static inline void *kzalloc(size_t size, gfp_t flags) | |||
172 | struct kmem_cache *s = kmalloc_slab(size); | 181 | struct kmem_cache *s = kmalloc_slab(size); |
173 | 182 | ||
174 | if (!s) | 183 | if (!s) |
175 | return NULL; | 184 | return ZERO_SIZE_PTR; |
176 | 185 | ||
177 | return kmem_cache_zalloc(s, flags); | 186 | return kmem_cache_zalloc(s, flags); |
178 | } else | 187 | } else |
@@ -188,7 +197,7 @@ static inline void *kmalloc_node(size_t size, gfp_t flags, int node) | |||
188 | struct kmem_cache *s = kmalloc_slab(size); | 197 | struct kmem_cache *s = kmalloc_slab(size); |
189 | 198 | ||
190 | if (!s) | 199 | if (!s) |
191 | return NULL; | 200 | return ZERO_SIZE_PTR; |
192 | 201 | ||
193 | return kmem_cache_alloc_node(s, flags, node); | 202 | return kmem_cache_alloc_node(s, flags, node); |
194 | } else | 203 | } else |