diff options
Diffstat (limited to 'include/linux')
30 files changed, 919 insertions, 58 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 93631229fd5c..2ebf068ba504 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -18,7 +18,6 @@ header-y += usb/ | |||
18 | 18 | ||
19 | header-y += affs_hardblocks.h | 19 | header-y += affs_hardblocks.h |
20 | header-y += aio_abi.h | 20 | header-y += aio_abi.h |
21 | header-y += a.out.h | ||
22 | header-y += arcfb.h | 21 | header-y += arcfb.h |
23 | header-y += atmapi.h | 22 | header-y += atmapi.h |
24 | header-y += atmbr2684.h | 23 | header-y += atmbr2684.h |
@@ -60,7 +59,6 @@ header-y += dqblk_v2.h | |||
60 | header-y += dqblk_xfs.h | 59 | header-y += dqblk_xfs.h |
61 | header-y += efs_fs_sb.h | 60 | header-y += efs_fs_sb.h |
62 | header-y += elf-fdpic.h | 61 | header-y += elf-fdpic.h |
63 | header-y += elf.h | ||
64 | header-y += elf-em.h | 62 | header-y += elf-em.h |
65 | header-y += fadvise.h | 63 | header-y += fadvise.h |
66 | header-y += fd.h | 64 | header-y += fd.h |
@@ -190,6 +188,7 @@ unifdef-y += dccp.h | |||
190 | unifdef-y += dirent.h | 188 | unifdef-y += dirent.h |
191 | unifdef-y += dlm.h | 189 | unifdef-y += dlm.h |
192 | unifdef-y += edd.h | 190 | unifdef-y += edd.h |
191 | unifdef-y += elf.h | ||
193 | unifdef-y += elfcore.h | 192 | unifdef-y += elfcore.h |
194 | unifdef-y += errno.h | 193 | unifdef-y += errno.h |
195 | unifdef-y += errqueue.h | 194 | unifdef-y += errqueue.h |
@@ -344,7 +343,6 @@ unifdef-y += uinput.h | |||
344 | unifdef-y += uio.h | 343 | unifdef-y += uio.h |
345 | unifdef-y += unistd.h | 344 | unifdef-y += unistd.h |
346 | unifdef-y += usbdevice_fs.h | 345 | unifdef-y += usbdevice_fs.h |
347 | unifdef-y += user.h | ||
348 | unifdef-y += utsname.h | 346 | unifdef-y += utsname.h |
349 | unifdef-y += videodev2.h | 347 | unifdef-y += videodev2.h |
350 | unifdef-y += videodev.h | 348 | unifdef-y += videodev.h |
diff --git a/include/linux/a.out.h b/include/linux/a.out.h index f913cc3e1b0d..82cd918f2ab7 100644 --- a/include/linux/a.out.h +++ b/include/linux/a.out.h | |||
@@ -128,12 +128,20 @@ enum machine_type { | |||
128 | #endif | 128 | #endif |
129 | 129 | ||
130 | #ifdef linux | 130 | #ifdef linux |
131 | #ifdef __KERNEL__ | ||
131 | #include <asm/page.h> | 132 | #include <asm/page.h> |
133 | #else | ||
134 | #include <unistd.h> | ||
135 | #endif | ||
132 | #if defined(__i386__) || defined(__mc68000__) | 136 | #if defined(__i386__) || defined(__mc68000__) |
133 | #define SEGMENT_SIZE 1024 | 137 | #define SEGMENT_SIZE 1024 |
134 | #else | 138 | #else |
135 | #ifndef SEGMENT_SIZE | 139 | #ifndef SEGMENT_SIZE |
140 | #ifdef __KERNEL__ | ||
136 | #define SEGMENT_SIZE PAGE_SIZE | 141 | #define SEGMENT_SIZE PAGE_SIZE |
142 | #else | ||
143 | #define SEGMENT_SIZE getpagesize() | ||
144 | #endif | ||
137 | #endif | 145 | #endif |
138 | #endif | 146 | #endif |
139 | #endif | 147 | #endif |
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 0365ec9fc0c9..4e4e340592fb 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
@@ -60,8 +60,20 @@ extern void *__alloc_bootmem_core(struct bootmem_data *bdata, | |||
60 | unsigned long goal, | 60 | unsigned long goal, |
61 | unsigned long limit); | 61 | unsigned long limit); |
62 | 62 | ||
63 | /* | ||
64 | * flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, | ||
65 | * the architecture-specific code should honor this) | ||
66 | */ | ||
67 | #define BOOTMEM_DEFAULT 0 | ||
68 | #define BOOTMEM_EXCLUSIVE (1<<0) | ||
69 | |||
63 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE | 70 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE |
64 | extern void reserve_bootmem(unsigned long addr, unsigned long size); | 71 | /* |
72 | * If flags is 0, then the return value is always 0 (success). If | ||
73 | * flags contains BOOTMEM_EXCLUSIVE, then -EBUSY is returned if the | ||
74 | * memory already was reserved. | ||
75 | */ | ||
76 | extern int reserve_bootmem(unsigned long addr, unsigned long size, int flags); | ||
65 | #define alloc_bootmem(x) \ | 77 | #define alloc_bootmem(x) \ |
66 | __alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) | 78 | __alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) |
67 | #define alloc_bootmem_low(x) \ | 79 | #define alloc_bootmem_low(x) \ |
@@ -84,7 +96,8 @@ extern unsigned long init_bootmem_node(pg_data_t *pgdat, | |||
84 | unsigned long endpfn); | 96 | unsigned long endpfn); |
85 | extern void reserve_bootmem_node(pg_data_t *pgdat, | 97 | extern void reserve_bootmem_node(pg_data_t *pgdat, |
86 | unsigned long physaddr, | 98 | unsigned long physaddr, |
87 | unsigned long size); | 99 | unsigned long size, |
100 | int flags); | ||
88 | extern void free_bootmem_node(pg_data_t *pgdat, | 101 | extern void free_bootmem_node(pg_data_t *pgdat, |
89 | unsigned long addr, | 102 | unsigned long addr, |
90 | unsigned long size); | 103 | unsigned long size); |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 87479328d46d..ff9055fc3d2a 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/nodemask.h> | 14 | #include <linux/nodemask.h> |
15 | #include <linux/rcupdate.h> | 15 | #include <linux/rcupdate.h> |
16 | #include <linux/cgroupstats.h> | 16 | #include <linux/cgroupstats.h> |
17 | #include <linux/prio_heap.h> | ||
17 | 18 | ||
18 | #ifdef CONFIG_CGROUPS | 19 | #ifdef CONFIG_CGROUPS |
19 | 20 | ||
@@ -207,6 +208,14 @@ struct cftype { | |||
207 | int (*release) (struct inode *inode, struct file *file); | 208 | int (*release) (struct inode *inode, struct file *file); |
208 | }; | 209 | }; |
209 | 210 | ||
211 | struct cgroup_scanner { | ||
212 | struct cgroup *cg; | ||
213 | int (*test_task)(struct task_struct *p, struct cgroup_scanner *scan); | ||
214 | void (*process_task)(struct task_struct *p, | ||
215 | struct cgroup_scanner *scan); | ||
216 | struct ptr_heap *heap; | ||
217 | }; | ||
218 | |||
210 | /* Add a new file to the given cgroup directory. Should only be | 219 | /* Add a new file to the given cgroup directory. Should only be |
211 | * called by subsystems from within a populate() method */ | 220 | * called by subsystems from within a populate() method */ |
212 | int cgroup_add_file(struct cgroup *cont, struct cgroup_subsys *subsys, | 221 | int cgroup_add_file(struct cgroup *cont, struct cgroup_subsys *subsys, |
@@ -233,6 +242,7 @@ int cgroup_is_descendant(const struct cgroup *cont); | |||
233 | struct cgroup_subsys { | 242 | struct cgroup_subsys { |
234 | struct cgroup_subsys_state *(*create)(struct cgroup_subsys *ss, | 243 | struct cgroup_subsys_state *(*create)(struct cgroup_subsys *ss, |
235 | struct cgroup *cont); | 244 | struct cgroup *cont); |
245 | void (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cont); | ||
236 | void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cont); | 246 | void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cont); |
237 | int (*can_attach)(struct cgroup_subsys *ss, | 247 | int (*can_attach)(struct cgroup_subsys *ss, |
238 | struct cgroup *cont, struct task_struct *tsk); | 248 | struct cgroup *cont, struct task_struct *tsk); |
@@ -298,11 +308,17 @@ struct cgroup_iter { | |||
298 | * returns NULL or until you want to end the iteration | 308 | * returns NULL or until you want to end the iteration |
299 | * | 309 | * |
300 | * 3) call cgroup_iter_end() to destroy the iterator. | 310 | * 3) call cgroup_iter_end() to destroy the iterator. |
311 | * | ||
312 | * Or, call cgroup_scan_tasks() to iterate through every task in a cpuset. | ||
313 | * - cgroup_scan_tasks() holds the css_set_lock when calling the test_task() | ||
314 | * callback, but not while calling the process_task() callback. | ||
301 | */ | 315 | */ |
302 | void cgroup_iter_start(struct cgroup *cont, struct cgroup_iter *it); | 316 | void cgroup_iter_start(struct cgroup *cont, struct cgroup_iter *it); |
303 | struct task_struct *cgroup_iter_next(struct cgroup *cont, | 317 | struct task_struct *cgroup_iter_next(struct cgroup *cont, |
304 | struct cgroup_iter *it); | 318 | struct cgroup_iter *it); |
305 | void cgroup_iter_end(struct cgroup *cont, struct cgroup_iter *it); | 319 | void cgroup_iter_end(struct cgroup *cont, struct cgroup_iter *it); |
320 | int cgroup_scan_tasks(struct cgroup_scanner *scan); | ||
321 | int cgroup_attach_task(struct cgroup *, struct task_struct *); | ||
306 | 322 | ||
307 | #else /* !CONFIG_CGROUPS */ | 323 | #else /* !CONFIG_CGROUPS */ |
308 | 324 | ||
diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h index 9ec43186ba80..228235c5ae53 100644 --- a/include/linux/cgroup_subsys.h +++ b/include/linux/cgroup_subsys.h | |||
@@ -37,3 +37,8 @@ SUBSYS(cpuacct) | |||
37 | 37 | ||
38 | /* */ | 38 | /* */ |
39 | 39 | ||
40 | #ifdef CONFIG_CGROUP_MEM_CONT | ||
41 | SUBSYS(mem_cgroup) | ||
42 | #endif | ||
43 | |||
44 | /* */ | ||
diff --git a/include/linux/ds1wm.h b/include/linux/ds1wm.h index 31f6e3c427fb..d3c65e48a2e7 100644 --- a/include/linux/ds1wm.h +++ b/include/linux/ds1wm.h | |||
@@ -6,6 +6,7 @@ struct ds1wm_platform_data { | |||
6 | * e.g. on h5xxx and h2200 this is 2 | 6 | * e.g. on h5xxx and h2200 this is 2 |
7 | * (registers aligned to 4-byte boundaries), | 7 | * (registers aligned to 4-byte boundaries), |
8 | * while on hx4700 this is 1 */ | 8 | * while on hx4700 this is 1 */ |
9 | int active_high; | ||
9 | void (*enable)(struct platform_device *pdev); | 10 | void (*enable)(struct platform_device *pdev); |
10 | void (*disable)(struct platform_device *pdev); | 11 | void (*disable)(struct platform_device *pdev); |
11 | }; | 12 | }; |
diff --git a/include/linux/efs_fs.h b/include/linux/efs_fs.h index dd57fe523e97..a695d63a07af 100644 --- a/include/linux/efs_fs.h +++ b/include/linux/efs_fs.h | |||
@@ -41,7 +41,7 @@ extern const struct inode_operations efs_dir_inode_operations; | |||
41 | extern const struct file_operations efs_dir_operations; | 41 | extern const struct file_operations efs_dir_operations; |
42 | extern const struct address_space_operations efs_symlink_aops; | 42 | extern const struct address_space_operations efs_symlink_aops; |
43 | 43 | ||
44 | extern void efs_read_inode(struct inode *); | 44 | extern struct inode *efs_iget(struct super_block *, unsigned long); |
45 | extern efs_block_t efs_map_block(struct inode *, efs_block_t); | 45 | extern efs_block_t efs_map_block(struct inode *, efs_block_t); |
46 | extern int efs_get_block(struct inode *, sector_t, struct buffer_head *, int); | 46 | extern int efs_get_block(struct inode *, sector_t, struct buffer_head *, int); |
47 | 47 | ||
diff --git a/include/linux/elf.h b/include/linux/elf.h index 7ceb24d87c1a..bad1b16ec49a 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h | |||
@@ -3,7 +3,9 @@ | |||
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/elf-em.h> | 5 | #include <linux/elf-em.h> |
6 | #ifdef __KERNEL__ | ||
6 | #include <asm/elf.h> | 7 | #include <asm/elf.h> |
8 | #endif | ||
7 | 9 | ||
8 | struct file; | 10 | struct file; |
9 | 11 | ||
@@ -355,6 +357,7 @@ typedef struct elf64_shdr { | |||
355 | #define NT_AUXV 6 | 357 | #define NT_AUXV 6 |
356 | #define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/elf/common.h */ | 358 | #define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/elf/common.h */ |
357 | #define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */ | 359 | #define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */ |
360 | #define NT_PPC_SPE 0x101 /* PowerPC SPE/EVR registers */ | ||
358 | #define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ | 361 | #define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ |
359 | 362 | ||
360 | 363 | ||
diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h index 9631dddae348..5ca54d77079f 100644 --- a/include/linux/elfcore.h +++ b/include/linux/elfcore.h | |||
@@ -4,7 +4,9 @@ | |||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/signal.h> | 5 | #include <linux/signal.h> |
6 | #include <linux/time.h> | 6 | #include <linux/time.h> |
7 | #ifdef __KERNEL__ | ||
7 | #include <linux/user.h> | 8 | #include <linux/user.h> |
9 | #endif | ||
8 | #include <linux/ptrace.h> | 10 | #include <linux/ptrace.h> |
9 | 11 | ||
10 | struct elf_siginfo | 12 | struct elf_siginfo |
@@ -14,7 +16,9 @@ struct elf_siginfo | |||
14 | int si_errno; /* errno */ | 16 | int si_errno; /* errno */ |
15 | }; | 17 | }; |
16 | 18 | ||
19 | #ifdef __KERNEL__ | ||
17 | #include <asm/elf.h> | 20 | #include <asm/elf.h> |
21 | #endif | ||
18 | 22 | ||
19 | #ifndef __KERNEL__ | 23 | #ifndef __KERNEL__ |
20 | typedef elf_greg_t greg_t; | 24 | typedef elf_greg_t greg_t; |
diff --git a/include/linux/err.h b/include/linux/err.h index 1ab1d44f8d3b..ec87f3142bf3 100644 --- a/include/linux/err.h +++ b/include/linux/err.h | |||
@@ -34,6 +34,19 @@ static inline long IS_ERR(const void *ptr) | |||
34 | return IS_ERR_VALUE((unsigned long)ptr); | 34 | return IS_ERR_VALUE((unsigned long)ptr); |
35 | } | 35 | } |
36 | 36 | ||
37 | /** | ||
38 | * ERR_CAST - Explicitly cast an error-valued pointer to another pointer type | ||
39 | * @ptr: The pointer to cast. | ||
40 | * | ||
41 | * Explicitly cast an error-valued pointer to another pointer type in such a | ||
42 | * way as to make it clear that's what's going on. | ||
43 | */ | ||
44 | static inline void *ERR_CAST(const void *ptr) | ||
45 | { | ||
46 | /* cast away the const */ | ||
47 | return (void *) ptr; | ||
48 | } | ||
49 | |||
37 | #endif | 50 | #endif |
38 | 51 | ||
39 | #endif /* _LINUX_ERR_H */ | 52 | #endif /* _LINUX_ERR_H */ |
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 241c01cb92b2..36c540396377 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
@@ -823,7 +823,7 @@ int ext3_get_blocks_handle(handle_t *handle, struct inode *inode, | |||
823 | sector_t iblock, unsigned long maxblocks, struct buffer_head *bh_result, | 823 | sector_t iblock, unsigned long maxblocks, struct buffer_head *bh_result, |
824 | int create, int extend_disksize); | 824 | int create, int extend_disksize); |
825 | 825 | ||
826 | extern void ext3_read_inode (struct inode *); | 826 | extern struct inode *ext3_iget(struct super_block *, unsigned long); |
827 | extern int ext3_write_inode (struct inode *, int); | 827 | extern int ext3_write_inode (struct inode *, int); |
828 | extern int ext3_setattr (struct dentry *, struct iattr *); | 828 | extern int ext3_setattr (struct dentry *, struct iattr *); |
829 | extern void ext3_delete_inode (struct inode *); | 829 | extern void ext3_delete_inode (struct inode *); |
diff --git a/include/linux/ext4_fs.h b/include/linux/ext4_fs.h index 1852313fc7c7..c4f635a4dd25 100644 --- a/include/linux/ext4_fs.h +++ b/include/linux/ext4_fs.h | |||
@@ -1024,7 +1024,7 @@ int ext4_get_blocks_handle(handle_t *handle, struct inode *inode, | |||
1024 | struct buffer_head *bh_result, | 1024 | struct buffer_head *bh_result, |
1025 | int create, int extend_disksize); | 1025 | int create, int extend_disksize); |
1026 | 1026 | ||
1027 | extern void ext4_read_inode (struct inode *); | 1027 | extern struct inode *ext4_iget(struct super_block *, unsigned long); |
1028 | extern int ext4_write_inode (struct inode *, int); | 1028 | extern int ext4_write_inode (struct inode *, int); |
1029 | extern int ext4_setattr (struct dentry *, struct iattr *); | 1029 | extern int ext4_setattr (struct dentry *, struct iattr *); |
1030 | extern void ext4_delete_inode (struct inode *); | 1030 | extern void ext4_delete_inode (struct inode *); |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 109734bf6377..36b7abefacbe 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1241,8 +1241,6 @@ struct super_operations { | |||
1241 | struct inode *(*alloc_inode)(struct super_block *sb); | 1241 | struct inode *(*alloc_inode)(struct super_block *sb); |
1242 | void (*destroy_inode)(struct inode *); | 1242 | void (*destroy_inode)(struct inode *); |
1243 | 1243 | ||
1244 | void (*read_inode) (struct inode *); | ||
1245 | |||
1246 | void (*dirty_inode) (struct inode *); | 1244 | void (*dirty_inode) (struct inode *); |
1247 | int (*write_inode) (struct inode *, int); | 1245 | int (*write_inode) (struct inode *, int); |
1248 | void (*put_inode) (struct inode *); | 1246 | void (*put_inode) (struct inode *); |
@@ -1767,19 +1765,8 @@ extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*te | |||
1767 | extern struct inode * iget_locked(struct super_block *, unsigned long); | 1765 | extern struct inode * iget_locked(struct super_block *, unsigned long); |
1768 | extern void unlock_new_inode(struct inode *); | 1766 | extern void unlock_new_inode(struct inode *); |
1769 | 1767 | ||
1770 | static inline struct inode *iget(struct super_block *sb, unsigned long ino) | ||
1771 | { | ||
1772 | struct inode *inode = iget_locked(sb, ino); | ||
1773 | |||
1774 | if (inode && (inode->i_state & I_NEW)) { | ||
1775 | sb->s_op->read_inode(inode); | ||
1776 | unlock_new_inode(inode); | ||
1777 | } | ||
1778 | |||
1779 | return inode; | ||
1780 | } | ||
1781 | |||
1782 | extern void __iget(struct inode * inode); | 1768 | extern void __iget(struct inode * inode); |
1769 | extern void iget_failed(struct inode *); | ||
1783 | extern void clear_inode(struct inode *); | 1770 | extern void clear_inode(struct inode *); |
1784 | extern void destroy_inode(struct inode *); | 1771 | extern void destroy_inode(struct inode *); |
1785 | extern struct inode *new_inode(struct super_block *); | 1772 | extern struct inode *new_inode(struct super_block *); |
@@ -1941,7 +1928,9 @@ extern int vfs_stat_fd(int dfd, char __user *, struct kstat *); | |||
1941 | extern int vfs_lstat_fd(int dfd, char __user *, struct kstat *); | 1928 | extern int vfs_lstat_fd(int dfd, char __user *, struct kstat *); |
1942 | extern int vfs_fstat(unsigned int, struct kstat *); | 1929 | extern int vfs_fstat(unsigned int, struct kstat *); |
1943 | 1930 | ||
1944 | extern int vfs_ioctl(struct file *, unsigned int, unsigned int, unsigned long); | 1931 | extern long vfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); |
1932 | extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, | ||
1933 | unsigned long arg); | ||
1945 | 1934 | ||
1946 | extern void get_filesystem(struct file_system_type *fs); | 1935 | extern void get_filesystem(struct file_system_type *fs); |
1947 | extern void put_filesystem(struct file_system_type *fs); | 1936 | extern void put_filesystem(struct file_system_type *fs); |
diff --git a/include/linux/hayesesp.h b/include/linux/hayesesp.h index b436be7a7fff..2177ee5b2fe2 100644 --- a/include/linux/hayesesp.h +++ b/include/linux/hayesesp.h | |||
@@ -71,7 +71,6 @@ struct hayes_esp_config { | |||
71 | #define ESP_STAT_NEVER_DMA 0x08 | 71 | #define ESP_STAT_NEVER_DMA 0x08 |
72 | #define ESP_STAT_USE_PIO 0x10 | 72 | #define ESP_STAT_USE_PIO 0x10 |
73 | 73 | ||
74 | #define ESP_EVENT_WRITE_WAKEUP 0 | ||
75 | #define ESP_MAGIC 0x53ee | 74 | #define ESP_MAGIC 0x53ee |
76 | #define ESP_XMIT_SIZE 4096 | 75 | #define ESP_XMIT_SIZE 4096 |
77 | 76 | ||
@@ -92,7 +91,6 @@ struct esp_struct { | |||
92 | unsigned short closing_wait2; | 91 | unsigned short closing_wait2; |
93 | int IER; /* Interrupt Enable Register */ | 92 | int IER; /* Interrupt Enable Register */ |
94 | int MCR; /* Modem control register */ | 93 | int MCR; /* Modem control register */ |
95 | unsigned long event; | ||
96 | unsigned long last_active; | 94 | unsigned long last_active; |
97 | int line; | 95 | int line; |
98 | int count; /* # of fd on device */ | 96 | int count; /* # of fd on device */ |
@@ -101,8 +99,6 @@ struct esp_struct { | |||
101 | int xmit_head; | 99 | int xmit_head; |
102 | int xmit_tail; | 100 | int xmit_tail; |
103 | int xmit_cnt; | 101 | int xmit_cnt; |
104 | struct work_struct tqueue; | ||
105 | struct work_struct tqueue_hangup; | ||
106 | wait_queue_head_t open_wait; | 102 | wait_queue_head_t open_wait; |
107 | wait_queue_head_t close_wait; | 103 | wait_queue_head_t close_wait; |
108 | wait_queue_head_t delta_msr_wait; | 104 | wait_queue_head_t delta_msr_wait; |
diff --git a/include/linux/isicom.h b/include/linux/isicom.h index 45b3d48f0978..8f4c71759d73 100644 --- a/include/linux/isicom.h +++ b/include/linux/isicom.h | |||
@@ -37,8 +37,6 @@ | |||
37 | #define BOARD_COUNT 4 | 37 | #define BOARD_COUNT 4 |
38 | #define PORT_COUNT (BOARD_COUNT*16) | 38 | #define PORT_COUNT (BOARD_COUNT*16) |
39 | 39 | ||
40 | #define SERIAL_TYPE_NORMAL 1 | ||
41 | |||
42 | /* character sizes */ | 40 | /* character sizes */ |
43 | 41 | ||
44 | #define ISICOM_CS5 0x0000 | 42 | #define ISICOM_CS5 0x0000 |
diff --git a/include/linux/istallion.h b/include/linux/istallion.h index 106a5e85e5c4..5a84fe944b74 100644 --- a/include/linux/istallion.h +++ b/include/linux/istallion.h | |||
@@ -71,7 +71,6 @@ struct stliport { | |||
71 | wait_queue_head_t open_wait; | 71 | wait_queue_head_t open_wait; |
72 | wait_queue_head_t close_wait; | 72 | wait_queue_head_t close_wait; |
73 | wait_queue_head_t raw_wait; | 73 | wait_queue_head_t raw_wait; |
74 | struct work_struct tqhangup; | ||
75 | struct asysigs asig; | 74 | struct asysigs asig; |
76 | unsigned long addr; | 75 | unsigned long addr; |
77 | unsigned long rxoffset; | 76 | unsigned long rxoffset; |
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index 2d9c448d8c52..3265968cd2cd 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
@@ -127,17 +127,21 @@ void vmcoreinfo_append_str(const char *fmt, ...) | |||
127 | __attribute__ ((format (printf, 1, 2))); | 127 | __attribute__ ((format (printf, 1, 2))); |
128 | unsigned long paddr_vmcoreinfo_note(void); | 128 | unsigned long paddr_vmcoreinfo_note(void); |
129 | 129 | ||
130 | #define VMCOREINFO_OSRELEASE(name) \ | ||
131 | vmcoreinfo_append_str("OSRELEASE=%s\n", #name) | ||
132 | #define VMCOREINFO_PAGESIZE(value) \ | ||
133 | vmcoreinfo_append_str("PAGESIZE=%ld\n", value) | ||
130 | #define VMCOREINFO_SYMBOL(name) \ | 134 | #define VMCOREINFO_SYMBOL(name) \ |
131 | vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)&name) | 135 | vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)&name) |
132 | #define VMCOREINFO_SIZE(name) \ | 136 | #define VMCOREINFO_SIZE(name) \ |
133 | vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \ | 137 | vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \ |
134 | (unsigned long)sizeof(struct name)) | ||
135 | #define VMCOREINFO_TYPEDEF_SIZE(name) \ | ||
136 | vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \ | ||
137 | (unsigned long)sizeof(name)) | 138 | (unsigned long)sizeof(name)) |
139 | #define VMCOREINFO_STRUCT_SIZE(name) \ | ||
140 | vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \ | ||
141 | (unsigned long)sizeof(struct name)) | ||
138 | #define VMCOREINFO_OFFSET(name, field) \ | 142 | #define VMCOREINFO_OFFSET(name, field) \ |
139 | vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", #name, #field, \ | 143 | vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", #name, #field, \ |
140 | (unsigned long)&(((struct name *)0)->field)) | 144 | (unsigned long)offsetof(struct name, field)) |
141 | #define VMCOREINFO_LENGTH(name, value) \ | 145 | #define VMCOREINFO_LENGTH(name, value) \ |
142 | vmcoreinfo_append_str("LENGTH(%s)=%lu\n", #name, (unsigned long)value) | 146 | vmcoreinfo_append_str("LENGTH(%s)=%lu\n", #name, (unsigned long)value) |
143 | #define VMCOREINFO_NUMBER(name) \ | 147 | #define VMCOREINFO_NUMBER(name) \ |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h new file mode 100644 index 000000000000..9815951ec995 --- /dev/null +++ b/include/linux/memcontrol.h | |||
@@ -0,0 +1,190 @@ | |||
1 | /* memcontrol.h - Memory Controller | ||
2 | * | ||
3 | * Copyright IBM Corporation, 2007 | ||
4 | * Author Balbir Singh <balbir@linux.vnet.ibm.com> | ||
5 | * | ||
6 | * Copyright 2007 OpenVZ SWsoft Inc | ||
7 | * Author: Pavel Emelianov <xemul@openvz.org> | ||
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 | |||
20 | #ifndef _LINUX_MEMCONTROL_H | ||
21 | #define _LINUX_MEMCONTROL_H | ||
22 | |||
23 | #include <linux/rcupdate.h> | ||
24 | #include <linux/mm.h> | ||
25 | |||
26 | struct mem_cgroup; | ||
27 | struct page_cgroup; | ||
28 | struct page; | ||
29 | struct mm_struct; | ||
30 | |||
31 | #ifdef CONFIG_CGROUP_MEM_CONT | ||
32 | |||
33 | extern void mm_init_cgroup(struct mm_struct *mm, struct task_struct *p); | ||
34 | extern void mm_free_cgroup(struct mm_struct *mm); | ||
35 | extern void page_assign_page_cgroup(struct page *page, | ||
36 | struct page_cgroup *pc); | ||
37 | extern struct page_cgroup *page_get_page_cgroup(struct page *page); | ||
38 | extern int mem_cgroup_charge(struct page *page, struct mm_struct *mm, | ||
39 | gfp_t gfp_mask); | ||
40 | extern void mem_cgroup_uncharge(struct page_cgroup *pc); | ||
41 | extern void mem_cgroup_uncharge_page(struct page *page); | ||
42 | extern void mem_cgroup_move_lists(struct page_cgroup *pc, bool active); | ||
43 | extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, | ||
44 | struct list_head *dst, | ||
45 | unsigned long *scanned, int order, | ||
46 | int mode, struct zone *z, | ||
47 | struct mem_cgroup *mem_cont, | ||
48 | int active); | ||
49 | extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); | ||
50 | extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm, | ||
51 | gfp_t gfp_mask); | ||
52 | int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); | ||
53 | |||
54 | static inline struct mem_cgroup *mm_cgroup(const struct mm_struct *mm) | ||
55 | { | ||
56 | return rcu_dereference(mm->mem_cgroup); | ||
57 | } | ||
58 | |||
59 | extern int mem_cgroup_prepare_migration(struct page *page); | ||
60 | extern void mem_cgroup_end_migration(struct page *page); | ||
61 | extern void mem_cgroup_page_migration(struct page *page, struct page *newpage); | ||
62 | |||
63 | /* | ||
64 | * For memory reclaim. | ||
65 | */ | ||
66 | extern int mem_cgroup_calc_mapped_ratio(struct mem_cgroup *mem); | ||
67 | extern long mem_cgroup_reclaim_imbalance(struct mem_cgroup *mem); | ||
68 | |||
69 | extern int mem_cgroup_get_reclaim_priority(struct mem_cgroup *mem); | ||
70 | extern void mem_cgroup_note_reclaim_priority(struct mem_cgroup *mem, | ||
71 | int priority); | ||
72 | extern void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem, | ||
73 | int priority); | ||
74 | |||
75 | extern long mem_cgroup_calc_reclaim_active(struct mem_cgroup *mem, | ||
76 | struct zone *zone, int priority); | ||
77 | extern long mem_cgroup_calc_reclaim_inactive(struct mem_cgroup *mem, | ||
78 | struct zone *zone, int priority); | ||
79 | |||
80 | #else /* CONFIG_CGROUP_MEM_CONT */ | ||
81 | static inline void mm_init_cgroup(struct mm_struct *mm, | ||
82 | struct task_struct *p) | ||
83 | { | ||
84 | } | ||
85 | |||
86 | static inline void mm_free_cgroup(struct mm_struct *mm) | ||
87 | { | ||
88 | } | ||
89 | |||
90 | static inline void page_assign_page_cgroup(struct page *page, | ||
91 | struct page_cgroup *pc) | ||
92 | { | ||
93 | } | ||
94 | |||
95 | static inline struct page_cgroup *page_get_page_cgroup(struct page *page) | ||
96 | { | ||
97 | return NULL; | ||
98 | } | ||
99 | |||
100 | static inline int mem_cgroup_charge(struct page *page, struct mm_struct *mm, | ||
101 | gfp_t gfp_mask) | ||
102 | { | ||
103 | return 0; | ||
104 | } | ||
105 | |||
106 | static inline void mem_cgroup_uncharge(struct page_cgroup *pc) | ||
107 | { | ||
108 | } | ||
109 | |||
110 | static inline void mem_cgroup_uncharge_page(struct page *page) | ||
111 | { | ||
112 | } | ||
113 | |||
114 | static inline void mem_cgroup_move_lists(struct page_cgroup *pc, | ||
115 | bool active) | ||
116 | { | ||
117 | } | ||
118 | |||
119 | static inline int mem_cgroup_cache_charge(struct page *page, | ||
120 | struct mm_struct *mm, | ||
121 | gfp_t gfp_mask) | ||
122 | { | ||
123 | return 0; | ||
124 | } | ||
125 | |||
126 | static inline struct mem_cgroup *mm_cgroup(const struct mm_struct *mm) | ||
127 | { | ||
128 | return NULL; | ||
129 | } | ||
130 | |||
131 | static inline int task_in_mem_cgroup(struct task_struct *task, | ||
132 | const struct mem_cgroup *mem) | ||
133 | { | ||
134 | return 1; | ||
135 | } | ||
136 | |||
137 | static inline int mem_cgroup_prepare_migration(struct page *page) | ||
138 | { | ||
139 | return 0; | ||
140 | } | ||
141 | |||
142 | static inline void mem_cgroup_end_migration(struct page *page) | ||
143 | { | ||
144 | } | ||
145 | |||
146 | static inline void | ||
147 | mem_cgroup_page_migration(struct page *page, struct page *newpage) | ||
148 | { | ||
149 | } | ||
150 | |||
151 | static inline int mem_cgroup_calc_mapped_ratio(struct mem_cgroup *mem) | ||
152 | { | ||
153 | return 0; | ||
154 | } | ||
155 | |||
156 | static inline int mem_cgroup_reclaim_imbalance(struct mem_cgroup *mem) | ||
157 | { | ||
158 | return 0; | ||
159 | } | ||
160 | |||
161 | static inline int mem_cgroup_get_reclaim_priority(struct mem_cgroup *mem) | ||
162 | { | ||
163 | return 0; | ||
164 | } | ||
165 | |||
166 | static inline void mem_cgroup_note_reclaim_priority(struct mem_cgroup *mem, | ||
167 | int priority) | ||
168 | { | ||
169 | } | ||
170 | |||
171 | static inline void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem, | ||
172 | int priority) | ||
173 | { | ||
174 | } | ||
175 | |||
176 | static inline long mem_cgroup_calc_reclaim_active(struct mem_cgroup *mem, | ||
177 | struct zone *zone, int priority) | ||
178 | { | ||
179 | return 0; | ||
180 | } | ||
181 | |||
182 | static inline long mem_cgroup_calc_reclaim_inactive(struct mem_cgroup *mem, | ||
183 | struct zone *zone, int priority) | ||
184 | { | ||
185 | return 0; | ||
186 | } | ||
187 | #endif /* CONFIG_CGROUP_MEM_CONT */ | ||
188 | |||
189 | #endif /* _LINUX_MEMCONTROL_H */ | ||
190 | |||
diff --git a/include/linux/mfd/asic3.h b/include/linux/mfd/asic3.h new file mode 100644 index 000000000000..4ab2162db13b --- /dev/null +++ b/include/linux/mfd/asic3.h | |||
@@ -0,0 +1,497 @@ | |||
1 | /* | ||
2 | * include/linux/mfd/asic3.h | ||
3 | * | ||
4 | * Compaq ASIC3 headers. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * Copyright 2001 Compaq Computer Corporation. | ||
11 | * Copyright 2007 OpendHand. | ||
12 | */ | ||
13 | |||
14 | #ifndef __ASIC3_H__ | ||
15 | #define __ASIC3_H__ | ||
16 | |||
17 | #include <linux/types.h> | ||
18 | |||
19 | struct asic3 { | ||
20 | void __iomem *mapping; | ||
21 | unsigned int bus_shift; | ||
22 | unsigned int irq_nr; | ||
23 | unsigned int irq_base; | ||
24 | spinlock_t lock; | ||
25 | u16 irq_bothedge[4]; | ||
26 | struct device *dev; | ||
27 | }; | ||
28 | |||
29 | struct asic3_platform_data { | ||
30 | struct { | ||
31 | u32 dir; | ||
32 | u32 init; | ||
33 | u32 sleep_mask; | ||
34 | u32 sleep_out; | ||
35 | u32 batt_fault_out; | ||
36 | u32 sleep_conf; | ||
37 | u32 alt_function; | ||
38 | } gpio_a, gpio_b, gpio_c, gpio_d; | ||
39 | |||
40 | unsigned int bus_shift; | ||
41 | |||
42 | unsigned int irq_base; | ||
43 | |||
44 | struct platform_device **children; | ||
45 | unsigned int n_children; | ||
46 | }; | ||
47 | |||
48 | int asic3_gpio_get_value(struct asic3 *asic, unsigned gpio); | ||
49 | void asic3_gpio_set_value(struct asic3 *asic, unsigned gpio, int val); | ||
50 | |||
51 | #define ASIC3_NUM_GPIO_BANKS 4 | ||
52 | #define ASIC3_GPIOS_PER_BANK 16 | ||
53 | #define ASIC3_NUM_GPIOS 64 | ||
54 | #define ASIC3_NR_IRQS ASIC3_NUM_GPIOS + 6 | ||
55 | |||
56 | #define ASIC3_GPIO_BANK_A 0 | ||
57 | #define ASIC3_GPIO_BANK_B 1 | ||
58 | #define ASIC3_GPIO_BANK_C 2 | ||
59 | #define ASIC3_GPIO_BANK_D 3 | ||
60 | |||
61 | #define ASIC3_GPIO(bank, gpio) \ | ||
62 | ((ASIC3_GPIOS_PER_BANK * ASIC3_GPIO_BANK_##bank) + (gpio)) | ||
63 | #define ASIC3_GPIO_bit(gpio) (1 << (gpio & 0xf)) | ||
64 | /* All offsets below are specified with this address bus shift */ | ||
65 | #define ASIC3_DEFAULT_ADDR_SHIFT 2 | ||
66 | |||
67 | #define ASIC3_OFFSET(base, reg) (ASIC3_##base##_Base + ASIC3_##base##_##reg) | ||
68 | #define ASIC3_GPIO_OFFSET(base, reg) \ | ||
69 | (ASIC3_GPIO_##base##_Base + ASIC3_GPIO_##reg) | ||
70 | |||
71 | #define ASIC3_GPIO_A_Base 0x0000 | ||
72 | #define ASIC3_GPIO_B_Base 0x0100 | ||
73 | #define ASIC3_GPIO_C_Base 0x0200 | ||
74 | #define ASIC3_GPIO_D_Base 0x0300 | ||
75 | |||
76 | #define ASIC3_GPIO_Mask 0x00 /* R/W 0:don't mask */ | ||
77 | #define ASIC3_GPIO_Direction 0x04 /* R/W 0:input */ | ||
78 | #define ASIC3_GPIO_Out 0x08 /* R/W 0:output low */ | ||
79 | #define ASIC3_GPIO_TriggerType 0x0c /* R/W 0:level */ | ||
80 | #define ASIC3_GPIO_EdgeTrigger 0x10 /* R/W 0:falling */ | ||
81 | #define ASIC3_GPIO_LevelTrigger 0x14 /* R/W 0:low level detect */ | ||
82 | #define ASIC3_GPIO_SleepMask 0x18 /* R/W 0:don't mask in sleep mode */ | ||
83 | #define ASIC3_GPIO_SleepOut 0x1c /* R/W level 0:low in sleep mode */ | ||
84 | #define ASIC3_GPIO_BattFaultOut 0x20 /* R/W level 0:low in batt_fault */ | ||
85 | #define ASIC3_GPIO_IntStatus 0x24 /* R/W 0:none, 1:detect */ | ||
86 | #define ASIC3_GPIO_AltFunction 0x28 /* R/W 1:LED register control */ | ||
87 | #define ASIC3_GPIO_SleepConf 0x2c /* | ||
88 | * R/W bit 1: autosleep | ||
89 | * 0: disable gposlpout in normal mode, | ||
90 | * enable gposlpout in sleep mode. | ||
91 | */ | ||
92 | #define ASIC3_GPIO_Status 0x30 /* R Pin status */ | ||
93 | |||
94 | #define ASIC3_SPI_Base 0x0400 | ||
95 | #define ASIC3_SPI_Control 0x0000 | ||
96 | #define ASIC3_SPI_TxData 0x0004 | ||
97 | #define ASIC3_SPI_RxData 0x0008 | ||
98 | #define ASIC3_SPI_Int 0x000c | ||
99 | #define ASIC3_SPI_Status 0x0010 | ||
100 | |||
101 | #define SPI_CONTROL_SPR(clk) ((clk) & 0x0f) /* Clock rate */ | ||
102 | |||
103 | #define ASIC3_PWM_0_Base 0x0500 | ||
104 | #define ASIC3_PWM_1_Base 0x0600 | ||
105 | #define ASIC3_PWM_TimeBase 0x0000 | ||
106 | #define ASIC3_PWM_PeriodTime 0x0004 | ||
107 | #define ASIC3_PWM_DutyTime 0x0008 | ||
108 | |||
109 | #define PWM_TIMEBASE_VALUE(x) ((x)&0xf) /* Low 4 bits sets time base */ | ||
110 | #define PWM_TIMEBASE_ENABLE (1 << 4) /* Enable clock */ | ||
111 | |||
112 | #define ASIC3_LED_0_Base 0x0700 | ||
113 | #define ASIC3_LED_1_Base 0x0800 | ||
114 | #define ASIC3_LED_2_Base 0x0900 | ||
115 | #define ASIC3_LED_TimeBase 0x0000 /* R/W 7 bits */ | ||
116 | #define ASIC3_LED_PeriodTime 0x0004 /* R/W 12 bits */ | ||
117 | #define ASIC3_LED_DutyTime 0x0008 /* R/W 12 bits */ | ||
118 | #define ASIC3_LED_AutoStopCount 0x000c /* R/W 16 bits */ | ||
119 | |||
120 | /* LED TimeBase bits - match ASIC2 */ | ||
121 | #define LED_TBS 0x0f /* Low 4 bits sets time base, max = 13 */ | ||
122 | /* Note: max = 5 on hx4700 */ | ||
123 | /* 0: maximum time base */ | ||
124 | /* 1: maximum time base / 2 */ | ||
125 | /* n: maximum time base / 2^n */ | ||
126 | |||
127 | #define LED_EN (1 << 4) /* LED ON/OFF 0:off, 1:on */ | ||
128 | #define LED_AUTOSTOP (1 << 5) /* LED ON/OFF auto stop 0:disable, 1:enable */ | ||
129 | #define LED_ALWAYS (1 << 6) /* LED Interrupt Mask 0:No mask, 1:mask */ | ||
130 | |||
131 | #define ASIC3_CLOCK_Base 0x0A00 | ||
132 | #define ASIC3_CLOCK_CDEX 0x00 | ||
133 | #define ASIC3_CLOCK_SEL 0x04 | ||
134 | |||
135 | #define CLOCK_CDEX_SOURCE (1 << 0) /* 2 bits */ | ||
136 | #define CLOCK_CDEX_SOURCE0 (1 << 0) | ||
137 | #define CLOCK_CDEX_SOURCE1 (1 << 1) | ||
138 | #define CLOCK_CDEX_SPI (1 << 2) | ||
139 | #define CLOCK_CDEX_OWM (1 << 3) | ||
140 | #define CLOCK_CDEX_PWM0 (1 << 4) | ||
141 | #define CLOCK_CDEX_PWM1 (1 << 5) | ||
142 | #define CLOCK_CDEX_LED0 (1 << 6) | ||
143 | #define CLOCK_CDEX_LED1 (1 << 7) | ||
144 | #define CLOCK_CDEX_LED2 (1 << 8) | ||
145 | |||
146 | /* Clocks settings: 1 for 24.576 MHz, 0 for 12.288Mhz */ | ||
147 | #define CLOCK_CDEX_SD_HOST (1 << 9) /* R/W: SD host clock source */ | ||
148 | #define CLOCK_CDEX_SD_BUS (1 << 10) /* R/W: SD bus clock source ctrl */ | ||
149 | #define CLOCK_CDEX_SMBUS (1 << 11) | ||
150 | #define CLOCK_CDEX_CONTROL_CX (1 << 12) | ||
151 | |||
152 | #define CLOCK_CDEX_EX0 (1 << 13) /* R/W: 32.768 kHz crystal */ | ||
153 | #define CLOCK_CDEX_EX1 (1 << 14) /* R/W: 24.576 MHz crystal */ | ||
154 | |||
155 | #define CLOCK_SEL_SD_HCLK_SEL (1 << 0) /* R/W: SDIO host clock select */ | ||
156 | #define CLOCK_SEL_SD_BCLK_SEL (1 << 1) /* R/W: SDIO bus clock select */ | ||
157 | |||
158 | /* R/W: INT clock source control (32.768 kHz) */ | ||
159 | #define CLOCK_SEL_CX (1 << 2) | ||
160 | |||
161 | |||
162 | #define ASIC3_INTR_Base 0x0B00 | ||
163 | |||
164 | #define ASIC3_INTR_IntMask 0x00 /* Interrupt mask control */ | ||
165 | #define ASIC3_INTR_PIntStat 0x04 /* Peripheral interrupt status */ | ||
166 | #define ASIC3_INTR_IntCPS 0x08 /* Interrupt timer clock pre-scale */ | ||
167 | #define ASIC3_INTR_IntTBS 0x0c /* Interrupt timer set */ | ||
168 | |||
169 | #define ASIC3_INTMASK_GINTMASK (1 << 0) /* Global INTs mask 1:enable */ | ||
170 | #define ASIC3_INTMASK_GINTEL (1 << 1) /* 1: rising edge, 0: hi level */ | ||
171 | #define ASIC3_INTMASK_MASK0 (1 << 2) | ||
172 | #define ASIC3_INTMASK_MASK1 (1 << 3) | ||
173 | #define ASIC3_INTMASK_MASK2 (1 << 4) | ||
174 | #define ASIC3_INTMASK_MASK3 (1 << 5) | ||
175 | #define ASIC3_INTMASK_MASK4 (1 << 6) | ||
176 | #define ASIC3_INTMASK_MASK5 (1 << 7) | ||
177 | |||
178 | #define ASIC3_INTR_PERIPHERAL_A (1 << 0) | ||
179 | #define ASIC3_INTR_PERIPHERAL_B (1 << 1) | ||
180 | #define ASIC3_INTR_PERIPHERAL_C (1 << 2) | ||
181 | #define ASIC3_INTR_PERIPHERAL_D (1 << 3) | ||
182 | #define ASIC3_INTR_LED0 (1 << 4) | ||
183 | #define ASIC3_INTR_LED1 (1 << 5) | ||
184 | #define ASIC3_INTR_LED2 (1 << 6) | ||
185 | #define ASIC3_INTR_SPI (1 << 7) | ||
186 | #define ASIC3_INTR_SMBUS (1 << 8) | ||
187 | #define ASIC3_INTR_OWM (1 << 9) | ||
188 | |||
189 | #define ASIC3_INTR_CPS(x) ((x)&0x0f) /* 4 bits, max 14 */ | ||
190 | #define ASIC3_INTR_CPS_SET (1 << 4) /* Time base enable */ | ||
191 | |||
192 | |||
193 | /* Basic control of the SD ASIC */ | ||
194 | #define ASIC3_SDHWCTRL_Base 0x0E00 | ||
195 | #define ASIC3_SDHWCTRL_SDConf 0x00 | ||
196 | |||
197 | #define ASIC3_SDHWCTRL_SUSPEND (1 << 0) /* 1=suspend all SD operations */ | ||
198 | #define ASIC3_SDHWCTRL_CLKSEL (1 << 1) /* 1=SDICK, 0=HCLK */ | ||
199 | #define ASIC3_SDHWCTRL_PCLR (1 << 2) /* All registers of SDIO cleared */ | ||
200 | #define ASIC3_SDHWCTRL_LEVCD (1 << 3) /* SD card detection: 0:low */ | ||
201 | |||
202 | /* SD card write protection: 0=high */ | ||
203 | #define ASIC3_SDHWCTRL_LEVWP (1 << 4) | ||
204 | #define ASIC3_SDHWCTRL_SDLED (1 << 5) /* SD card LED signal 0=disable */ | ||
205 | |||
206 | /* SD card power supply ctrl 1=enable */ | ||
207 | #define ASIC3_SDHWCTRL_SDPWR (1 << 6) | ||
208 | |||
209 | #define ASIC3_EXTCF_Base 0x1100 | ||
210 | |||
211 | #define ASIC3_EXTCF_Select 0x00 | ||
212 | #define ASIC3_EXTCF_Reset 0x04 | ||
213 | |||
214 | #define ASIC3_EXTCF_SMOD0 (1 << 0) /* slot number of mode 0 */ | ||
215 | #define ASIC3_EXTCF_SMOD1 (1 << 1) /* slot number of mode 1 */ | ||
216 | #define ASIC3_EXTCF_SMOD2 (1 << 2) /* slot number of mode 2 */ | ||
217 | #define ASIC3_EXTCF_OWM_EN (1 << 4) /* enable onewire module */ | ||
218 | #define ASIC3_EXTCF_OWM_SMB (1 << 5) /* OWM bus selection */ | ||
219 | #define ASIC3_EXTCF_OWM_RESET (1 << 6) /* ?? used by OWM and CF */ | ||
220 | #define ASIC3_EXTCF_CF0_SLEEP_MODE (1 << 7) /* CF0 sleep state */ | ||
221 | #define ASIC3_EXTCF_CF1_SLEEP_MODE (1 << 8) /* CF1 sleep state */ | ||
222 | #define ASIC3_EXTCF_CF0_PWAIT_EN (1 << 10) /* CF0 PWAIT_n control */ | ||
223 | #define ASIC3_EXTCF_CF1_PWAIT_EN (1 << 11) /* CF1 PWAIT_n control */ | ||
224 | #define ASIC3_EXTCF_CF0_BUF_EN (1 << 12) /* CF0 buffer control */ | ||
225 | #define ASIC3_EXTCF_CF1_BUF_EN (1 << 13) /* CF1 buffer control */ | ||
226 | #define ASIC3_EXTCF_SD_MEM_ENABLE (1 << 14) | ||
227 | #define ASIC3_EXTCF_CF_SLEEP (1 << 15) /* CF sleep mode control */ | ||
228 | |||
229 | /********************************************* | ||
230 | * The Onewire interface registers | ||
231 | * | ||
232 | * OWM_CMD | ||
233 | * OWM_DAT | ||
234 | * OWM_INTR | ||
235 | * OWM_INTEN | ||
236 | * OWM_CLKDIV | ||
237 | * | ||
238 | *********************************************/ | ||
239 | |||
240 | #define ASIC3_OWM_Base 0xC00 | ||
241 | |||
242 | #define ASIC3_OWM_CMD 0x00 | ||
243 | #define ASIC3_OWM_DAT 0x04 | ||
244 | #define ASIC3_OWM_INTR 0x08 | ||
245 | #define ASIC3_OWM_INTEN 0x0C | ||
246 | #define ASIC3_OWM_CLKDIV 0x10 | ||
247 | |||
248 | #define ASIC3_OWM_CMD_ONEWR (1 << 0) | ||
249 | #define ASIC3_OWM_CMD_SRA (1 << 1) | ||
250 | #define ASIC3_OWM_CMD_DQO (1 << 2) | ||
251 | #define ASIC3_OWM_CMD_DQI (1 << 3) | ||
252 | |||
253 | #define ASIC3_OWM_INTR_PD (1 << 0) | ||
254 | #define ASIC3_OWM_INTR_PDR (1 << 1) | ||
255 | #define ASIC3_OWM_INTR_TBE (1 << 2) | ||
256 | #define ASIC3_OWM_INTR_TEMP (1 << 3) | ||
257 | #define ASIC3_OWM_INTR_RBF (1 << 4) | ||
258 | |||
259 | #define ASIC3_OWM_INTEN_EPD (1 << 0) | ||
260 | #define ASIC3_OWM_INTEN_IAS (1 << 1) | ||
261 | #define ASIC3_OWM_INTEN_ETBE (1 << 2) | ||
262 | #define ASIC3_OWM_INTEN_ETMT (1 << 3) | ||
263 | #define ASIC3_OWM_INTEN_ERBF (1 << 4) | ||
264 | |||
265 | #define ASIC3_OWM_CLKDIV_PRE (3 << 0) /* two bits wide at bit 0 */ | ||
266 | #define ASIC3_OWM_CLKDIV_DIV (7 << 2) /* 3 bits wide at bit 2 */ | ||
267 | |||
268 | |||
269 | /***************************************************************************** | ||
270 | * The SD configuration registers are at a completely different location | ||
271 | * in memory. They are divided into three sets of registers: | ||
272 | * | ||
273 | * SD_CONFIG Core configuration register | ||
274 | * SD_CTRL Control registers for SD operations | ||
275 | * SDIO_CTRL Control registers for SDIO operations | ||
276 | * | ||
277 | *****************************************************************************/ | ||
278 | #define ASIC3_SD_CONFIG_Base 0x0400 /* Assumes 32 bit addressing */ | ||
279 | |||
280 | #define ASIC3_SD_CONFIG_Command 0x08 /* R/W: Command */ | ||
281 | |||
282 | /* [0:8] SD Control Register Base Address */ | ||
283 | #define ASIC3_SD_CONFIG_Addr0 0x20 | ||
284 | |||
285 | /* [9:31] SD Control Register Base Address */ | ||
286 | #define ASIC3_SD_CONFIG_Addr1 0x24 | ||
287 | |||
288 | /* R/O: interrupt assigned to pin */ | ||
289 | #define ASIC3_SD_CONFIG_IntPin 0x78 | ||
290 | |||
291 | /* | ||
292 | * Set to 0x1f to clock SD controller, 0 otherwise. | ||
293 | * At 0x82 - Gated Clock Ctrl | ||
294 | */ | ||
295 | #define ASIC3_SD_CONFIG_ClkStop 0x80 | ||
296 | |||
297 | /* Control clock of SD controller */ | ||
298 | #define ASIC3_SD_CONFIG_ClockMode 0x84 | ||
299 | #define ASIC3_SD_CONFIG_SDHC_PinStatus 0x88 /* R/0: SD pins status */ | ||
300 | #define ASIC3_SD_CONFIG_SDHC_Power1 0x90 /* Power1 - manual pwr ctrl */ | ||
301 | |||
302 | /* auto power up after card inserted */ | ||
303 | #define ASIC3_SD_CONFIG_SDHC_Power2 0x92 | ||
304 | |||
305 | /* auto power down when card removed */ | ||
306 | #define ASIC3_SD_CONFIG_SDHC_Power3 0x94 | ||
307 | #define ASIC3_SD_CONFIG_SDHC_CardDetect 0x98 | ||
308 | #define ASIC3_SD_CONFIG_SDHC_Slot 0xA0 /* R/O: support slot number */ | ||
309 | #define ASIC3_SD_CONFIG_SDHC_ExtGateClk1 0x1E0 /* Not used */ | ||
310 | #define ASIC3_SD_CONFIG_SDHC_ExtGateClk2 0x1E2 /* Not used*/ | ||
311 | |||
312 | /* GPIO Output Reg. , at 0x1EA - GPIO Output Enable Reg. */ | ||
313 | #define ASIC3_SD_CONFIG_SDHC_GPIO_OutAndEnable 0x1E8 | ||
314 | #define ASIC3_SD_CONFIG_SDHC_GPIO_Status 0x1EC /* GPIO Status Reg. */ | ||
315 | |||
316 | /* Bit 1: double buffer/single buffer */ | ||
317 | #define ASIC3_SD_CONFIG_SDHC_ExtGateClk3 0x1F0 | ||
318 | |||
319 | /* Memory access enable (set to 1 to access SD Controller) */ | ||
320 | #define SD_CONFIG_COMMAND_MAE (1<<1) | ||
321 | |||
322 | #define SD_CONFIG_CLK_ENABLE_ALL 0x1f | ||
323 | |||
324 | #define SD_CONFIG_POWER1_PC_33V 0x0200 /* Set for 3.3 volts */ | ||
325 | #define SD_CONFIG_POWER1_PC_OFF 0x0000 /* Turn off power */ | ||
326 | |||
327 | /* two bits - number of cycles for card detection */ | ||
328 | #define SD_CONFIG_CARDDETECTMODE_CLK ((x) & 0x3) | ||
329 | |||
330 | |||
331 | #define ASIC3_SD_CTRL_Base 0x1000 | ||
332 | |||
333 | #define ASIC3_SD_CTRL_Cmd 0x00 | ||
334 | #define ASIC3_SD_CTRL_Arg0 0x08 | ||
335 | #define ASIC3_SD_CTRL_Arg1 0x0C | ||
336 | #define ASIC3_SD_CTRL_StopInternal 0x10 | ||
337 | #define ASIC3_SD_CTRL_TransferSectorCount 0x14 | ||
338 | #define ASIC3_SD_CTRL_Response0 0x18 | ||
339 | #define ASIC3_SD_CTRL_Response1 0x1C | ||
340 | #define ASIC3_SD_CTRL_Response2 0x20 | ||
341 | #define ASIC3_SD_CTRL_Response3 0x24 | ||
342 | #define ASIC3_SD_CTRL_Response4 0x28 | ||
343 | #define ASIC3_SD_CTRL_Response5 0x2C | ||
344 | #define ASIC3_SD_CTRL_Response6 0x30 | ||
345 | #define ASIC3_SD_CTRL_Response7 0x34 | ||
346 | #define ASIC3_SD_CTRL_CardStatus 0x38 | ||
347 | #define ASIC3_SD_CTRL_BufferCtrl 0x3C | ||
348 | #define ASIC3_SD_CTRL_IntMaskCard 0x40 | ||
349 | #define ASIC3_SD_CTRL_IntMaskBuffer 0x44 | ||
350 | #define ASIC3_SD_CTRL_CardClockCtrl 0x48 | ||
351 | #define ASIC3_SD_CTRL_MemCardXferDataLen 0x4C | ||
352 | #define ASIC3_SD_CTRL_MemCardOptionSetup 0x50 | ||
353 | #define ASIC3_SD_CTRL_ErrorStatus0 0x58 | ||
354 | #define ASIC3_SD_CTRL_ErrorStatus1 0x5C | ||
355 | #define ASIC3_SD_CTRL_DataPort 0x60 | ||
356 | #define ASIC3_SD_CTRL_TransactionCtrl 0x68 | ||
357 | #define ASIC3_SD_CTRL_SoftwareReset 0x1C0 | ||
358 | |||
359 | #define SD_CTRL_SOFTWARE_RESET_CLEAR (1<<0) | ||
360 | |||
361 | #define SD_CTRL_TRANSACTIONCONTROL_SET (1<<8) | ||
362 | |||
363 | #define SD_CTRL_CARDCLOCKCONTROL_FOR_SD_CARD (1<<15) | ||
364 | #define SD_CTRL_CARDCLOCKCONTROL_ENABLE_CLOCK (1<<8) | ||
365 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_512 (1<<7) | ||
366 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_256 (1<<6) | ||
367 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_128 (1<<5) | ||
368 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_64 (1<<4) | ||
369 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_32 (1<<3) | ||
370 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_16 (1<<2) | ||
371 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_8 (1<<1) | ||
372 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_4 (1<<0) | ||
373 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_2 (0<<0) | ||
374 | |||
375 | #define MEM_CARD_OPTION_REQUIRED 0x000e | ||
376 | #define MEM_CARD_OPTION_DATA_RESPONSE_TIMEOUT(x) (((x) & 0x0f) << 4) | ||
377 | #define MEM_CARD_OPTION_C2_MODULE_NOT_PRESENT (1<<14) | ||
378 | #define MEM_CARD_OPTION_DATA_XFR_WIDTH_1 (1<<15) | ||
379 | #define MEM_CARD_OPTION_DATA_XFR_WIDTH_4 0 | ||
380 | |||
381 | #define SD_CTRL_COMMAND_INDEX(x) ((x) & 0x3f) | ||
382 | #define SD_CTRL_COMMAND_TYPE_CMD (0 << 6) | ||
383 | #define SD_CTRL_COMMAND_TYPE_ACMD (1 << 6) | ||
384 | #define SD_CTRL_COMMAND_TYPE_AUTHENTICATION (2 << 6) | ||
385 | #define SD_CTRL_COMMAND_RESPONSE_TYPE_NORMAL (0 << 8) | ||
386 | #define SD_CTRL_COMMAND_RESPONSE_TYPE_EXT_R1 (4 << 8) | ||
387 | #define SD_CTRL_COMMAND_RESPONSE_TYPE_EXT_R1B (5 << 8) | ||
388 | #define SD_CTRL_COMMAND_RESPONSE_TYPE_EXT_R2 (6 << 8) | ||
389 | #define SD_CTRL_COMMAND_RESPONSE_TYPE_EXT_R3 (7 << 8) | ||
390 | #define SD_CTRL_COMMAND_DATA_PRESENT (1 << 11) | ||
391 | #define SD_CTRL_COMMAND_TRANSFER_READ (1 << 12) | ||
392 | #define SD_CTRL_COMMAND_TRANSFER_WRITE (0 << 12) | ||
393 | #define SD_CTRL_COMMAND_MULTI_BLOCK (1 << 13) | ||
394 | #define SD_CTRL_COMMAND_SECURITY_CMD (1 << 14) | ||
395 | |||
396 | #define SD_CTRL_STOP_INTERNAL_ISSSUE_CMD12 (1 << 0) | ||
397 | #define SD_CTRL_STOP_INTERNAL_AUTO_ISSUE_CMD12 (1 << 8) | ||
398 | |||
399 | #define SD_CTRL_CARDSTATUS_RESPONSE_END (1 << 0) | ||
400 | #define SD_CTRL_CARDSTATUS_RW_END (1 << 2) | ||
401 | #define SD_CTRL_CARDSTATUS_CARD_REMOVED_0 (1 << 3) | ||
402 | #define SD_CTRL_CARDSTATUS_CARD_INSERTED_0 (1 << 4) | ||
403 | #define SD_CTRL_CARDSTATUS_SIGNAL_STATE_PRESENT_0 (1 << 5) | ||
404 | #define SD_CTRL_CARDSTATUS_WRITE_PROTECT (1 << 7) | ||
405 | #define SD_CTRL_CARDSTATUS_CARD_REMOVED_3 (1 << 8) | ||
406 | #define SD_CTRL_CARDSTATUS_CARD_INSERTED_3 (1 << 9) | ||
407 | #define SD_CTRL_CARDSTATUS_SIGNAL_STATE_PRESENT_3 (1 << 10) | ||
408 | |||
409 | #define SD_CTRL_BUFFERSTATUS_CMD_INDEX_ERROR (1 << 0) | ||
410 | #define SD_CTRL_BUFFERSTATUS_CRC_ERROR (1 << 1) | ||
411 | #define SD_CTRL_BUFFERSTATUS_STOP_BIT_END_ERROR (1 << 2) | ||
412 | #define SD_CTRL_BUFFERSTATUS_DATA_TIMEOUT (1 << 3) | ||
413 | #define SD_CTRL_BUFFERSTATUS_BUFFER_OVERFLOW (1 << 4) | ||
414 | #define SD_CTRL_BUFFERSTATUS_BUFFER_UNDERFLOW (1 << 5) | ||
415 | #define SD_CTRL_BUFFERSTATUS_CMD_TIMEOUT (1 << 6) | ||
416 | #define SD_CTRL_BUFFERSTATUS_UNK7 (1 << 7) | ||
417 | #define SD_CTRL_BUFFERSTATUS_BUFFER_READ_ENABLE (1 << 8) | ||
418 | #define SD_CTRL_BUFFERSTATUS_BUFFER_WRITE_ENABLE (1 << 9) | ||
419 | #define SD_CTRL_BUFFERSTATUS_ILLEGAL_FUNCTION (1 << 13) | ||
420 | #define SD_CTRL_BUFFERSTATUS_CMD_BUSY (1 << 14) | ||
421 | #define SD_CTRL_BUFFERSTATUS_ILLEGAL_ACCESS (1 << 15) | ||
422 | |||
423 | #define SD_CTRL_INTMASKCARD_RESPONSE_END (1 << 0) | ||
424 | #define SD_CTRL_INTMASKCARD_RW_END (1 << 2) | ||
425 | #define SD_CTRL_INTMASKCARD_CARD_REMOVED_0 (1 << 3) | ||
426 | #define SD_CTRL_INTMASKCARD_CARD_INSERTED_0 (1 << 4) | ||
427 | #define SD_CTRL_INTMASKCARD_SIGNAL_STATE_PRESENT_0 (1 << 5) | ||
428 | #define SD_CTRL_INTMASKCARD_UNK6 (1 << 6) | ||
429 | #define SD_CTRL_INTMASKCARD_WRITE_PROTECT (1 << 7) | ||
430 | #define SD_CTRL_INTMASKCARD_CARD_REMOVED_3 (1 << 8) | ||
431 | #define SD_CTRL_INTMASKCARD_CARD_INSERTED_3 (1 << 9) | ||
432 | #define SD_CTRL_INTMASKCARD_SIGNAL_STATE_PRESENT_3 (1 << 10) | ||
433 | |||
434 | #define SD_CTRL_INTMASKBUFFER_CMD_INDEX_ERROR (1 << 0) | ||
435 | #define SD_CTRL_INTMASKBUFFER_CRC_ERROR (1 << 1) | ||
436 | #define SD_CTRL_INTMASKBUFFER_STOP_BIT_END_ERROR (1 << 2) | ||
437 | #define SD_CTRL_INTMASKBUFFER_DATA_TIMEOUT (1 << 3) | ||
438 | #define SD_CTRL_INTMASKBUFFER_BUFFER_OVERFLOW (1 << 4) | ||
439 | #define SD_CTRL_INTMASKBUFFER_BUFFER_UNDERFLOW (1 << 5) | ||
440 | #define SD_CTRL_INTMASKBUFFER_CMD_TIMEOUT (1 << 6) | ||
441 | #define SD_CTRL_INTMASKBUFFER_UNK7 (1 << 7) | ||
442 | #define SD_CTRL_INTMASKBUFFER_BUFFER_READ_ENABLE (1 << 8) | ||
443 | #define SD_CTRL_INTMASKBUFFER_BUFFER_WRITE_ENABLE (1 << 9) | ||
444 | #define SD_CTRL_INTMASKBUFFER_ILLEGAL_FUNCTION (1 << 13) | ||
445 | #define SD_CTRL_INTMASKBUFFER_CMD_BUSY (1 << 14) | ||
446 | #define SD_CTRL_INTMASKBUFFER_ILLEGAL_ACCESS (1 << 15) | ||
447 | |||
448 | #define SD_CTRL_DETAIL0_RESPONSE_CMD_ERROR (1 << 0) | ||
449 | #define SD_CTRL_DETAIL0_END_BIT_ERROR_FOR_RESPONSE_NON_CMD12 (1 << 2) | ||
450 | #define SD_CTRL_DETAIL0_END_BIT_ERROR_FOR_RESPONSE_CMD12 (1 << 3) | ||
451 | #define SD_CTRL_DETAIL0_END_BIT_ERROR_FOR_READ_DATA (1 << 4) | ||
452 | #define SD_CTRL_DETAIL0_END_BIT_ERROR_FOR_WRITE_CRC_STATUS (1 << 5) | ||
453 | #define SD_CTRL_DETAIL0_CRC_ERROR_FOR_RESPONSE_NON_CMD12 (1 << 8) | ||
454 | #define SD_CTRL_DETAIL0_CRC_ERROR_FOR_RESPONSE_CMD12 (1 << 9) | ||
455 | #define SD_CTRL_DETAIL0_CRC_ERROR_FOR_READ_DATA (1 << 10) | ||
456 | #define SD_CTRL_DETAIL0_CRC_ERROR_FOR_WRITE_CMD (1 << 11) | ||
457 | |||
458 | #define SD_CTRL_DETAIL1_NO_CMD_RESPONSE (1 << 0) | ||
459 | #define SD_CTRL_DETAIL1_TIMEOUT_READ_DATA (1 << 4) | ||
460 | #define SD_CTRL_DETAIL1_TIMEOUT_CRS_STATUS (1 << 5) | ||
461 | #define SD_CTRL_DETAIL1_TIMEOUT_CRC_BUSY (1 << 6) | ||
462 | |||
463 | #define ASIC3_SDIO_CTRL_Base 0x1200 | ||
464 | |||
465 | #define ASIC3_SDIO_CTRL_Cmd 0x00 | ||
466 | #define ASIC3_SDIO_CTRL_CardPortSel 0x04 | ||
467 | #define ASIC3_SDIO_CTRL_Arg0 0x08 | ||
468 | #define ASIC3_SDIO_CTRL_Arg1 0x0C | ||
469 | #define ASIC3_SDIO_CTRL_TransferBlockCount 0x14 | ||
470 | #define ASIC3_SDIO_CTRL_Response0 0x18 | ||
471 | #define ASIC3_SDIO_CTRL_Response1 0x1C | ||
472 | #define ASIC3_SDIO_CTRL_Response2 0x20 | ||
473 | #define ASIC3_SDIO_CTRL_Response3 0x24 | ||
474 | #define ASIC3_SDIO_CTRL_Response4 0x28 | ||
475 | #define ASIC3_SDIO_CTRL_Response5 0x2C | ||
476 | #define ASIC3_SDIO_CTRL_Response6 0x30 | ||
477 | #define ASIC3_SDIO_CTRL_Response7 0x34 | ||
478 | #define ASIC3_SDIO_CTRL_CardStatus 0x38 | ||
479 | #define ASIC3_SDIO_CTRL_BufferCtrl 0x3C | ||
480 | #define ASIC3_SDIO_CTRL_IntMaskCard 0x40 | ||
481 | #define ASIC3_SDIO_CTRL_IntMaskBuffer 0x44 | ||
482 | #define ASIC3_SDIO_CTRL_CardXferDataLen 0x4C | ||
483 | #define ASIC3_SDIO_CTRL_CardOptionSetup 0x50 | ||
484 | #define ASIC3_SDIO_CTRL_ErrorStatus0 0x54 | ||
485 | #define ASIC3_SDIO_CTRL_ErrorStatus1 0x58 | ||
486 | #define ASIC3_SDIO_CTRL_DataPort 0x60 | ||
487 | #define ASIC3_SDIO_CTRL_TransactionCtrl 0x68 | ||
488 | #define ASIC3_SDIO_CTRL_CardIntCtrl 0x6C | ||
489 | #define ASIC3_SDIO_CTRL_ClocknWaitCtrl 0x70 | ||
490 | #define ASIC3_SDIO_CTRL_HostInformation 0x74 | ||
491 | #define ASIC3_SDIO_CTRL_ErrorCtrl 0x78 | ||
492 | #define ASIC3_SDIO_CTRL_LEDCtrl 0x7C | ||
493 | #define ASIC3_SDIO_CTRL_SoftwareReset 0x1C0 | ||
494 | |||
495 | #define ASIC3_MAP_SIZE 0x2000 | ||
496 | |||
497 | #endif /* __ASIC3_H__ */ | ||
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index f4c03e0b355e..34023c65d466 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -88,6 +88,9 @@ struct page { | |||
88 | void *virtual; /* Kernel virtual address (NULL if | 88 | void *virtual; /* Kernel virtual address (NULL if |
89 | not kmapped, ie. highmem) */ | 89 | not kmapped, ie. highmem) */ |
90 | #endif /* WANT_PAGE_VIRTUAL */ | 90 | #endif /* WANT_PAGE_VIRTUAL */ |
91 | #ifdef CONFIG_CGROUP_MEM_CONT | ||
92 | unsigned long page_cgroup; | ||
93 | #endif | ||
91 | }; | 94 | }; |
92 | 95 | ||
93 | /* | 96 | /* |
@@ -219,6 +222,9 @@ struct mm_struct { | |||
219 | /* aio bits */ | 222 | /* aio bits */ |
220 | rwlock_t ioctx_list_lock; | 223 | rwlock_t ioctx_list_lock; |
221 | struct kioctx *ioctx_list; | 224 | struct kioctx *ioctx_list; |
225 | #ifdef CONFIG_CGROUP_MEM_CONT | ||
226 | struct mem_cgroup *mem_cgroup; | ||
227 | #endif | ||
222 | }; | 228 | }; |
223 | 229 | ||
224 | #endif /* _LINUX_MM_TYPES_H */ | 230 | #endif /* _LINUX_MM_TYPES_H */ |
diff --git a/include/linux/of.h b/include/linux/of.h index b5f33efcb8e2..6981016dcc25 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -50,6 +50,7 @@ extern struct device_node *of_find_matching_node(struct device_node *from, | |||
50 | extern struct device_node *of_find_node_by_path(const char *path); | 50 | extern struct device_node *of_find_node_by_path(const char *path); |
51 | extern struct device_node *of_find_node_by_phandle(phandle handle); | 51 | extern struct device_node *of_find_node_by_phandle(phandle handle); |
52 | extern struct device_node *of_get_parent(const struct device_node *node); | 52 | extern struct device_node *of_get_parent(const struct device_node *node); |
53 | extern struct device_node *of_get_next_parent(struct device_node *node); | ||
53 | extern struct device_node *of_get_next_child(const struct device_node *node, | 54 | extern struct device_node *of_get_next_child(const struct device_node *node, |
54 | struct device_node *prev); | 55 | struct device_node *prev); |
55 | #define for_each_child_of_node(parent, child) \ | 56 | #define for_each_child_of_node(parent, child) \ |
diff --git a/include/linux/qnx4_fs.h b/include/linux/qnx4_fs.h index 19bc9b8b6191..34a196ee7941 100644 --- a/include/linux/qnx4_fs.h +++ b/include/linux/qnx4_fs.h | |||
@@ -110,6 +110,7 @@ struct qnx4_inode_info { | |||
110 | struct inode vfs_inode; | 110 | struct inode vfs_inode; |
111 | }; | 111 | }; |
112 | 112 | ||
113 | extern struct inode *qnx4_iget(struct super_block *, unsigned long); | ||
113 | extern struct dentry *qnx4_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd); | 114 | extern struct dentry *qnx4_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd); |
114 | extern unsigned long qnx4_count_free_blocks(struct super_block *sb); | 115 | extern unsigned long qnx4_count_free_blocks(struct super_block *sb); |
115 | extern unsigned long qnx4_block_map(struct inode *inode, long iblock); | 116 | extern unsigned long qnx4_block_map(struct inode *inode, long iblock); |
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h new file mode 100644 index 000000000000..61363ce896d5 --- /dev/null +++ b/include/linux/res_counter.h | |||
@@ -0,0 +1,127 @@ | |||
1 | #ifndef __RES_COUNTER_H__ | ||
2 | #define __RES_COUNTER_H__ | ||
3 | |||
4 | /* | ||
5 | * Resource Counters | ||
6 | * Contain common data types and routines for resource accounting | ||
7 | * | ||
8 | * Copyright 2007 OpenVZ SWsoft Inc | ||
9 | * | ||
10 | * Author: Pavel Emelianov <xemul@openvz.org> | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #include <linux/cgroup.h> | ||
15 | |||
16 | /* | ||
17 | * The core object. the cgroup that wishes to account for some | ||
18 | * resource may include this counter into its structures and use | ||
19 | * the helpers described beyond | ||
20 | */ | ||
21 | |||
22 | struct res_counter { | ||
23 | /* | ||
24 | * the current resource consumption level | ||
25 | */ | ||
26 | unsigned long long usage; | ||
27 | /* | ||
28 | * the limit that usage cannot exceed | ||
29 | */ | ||
30 | unsigned long long limit; | ||
31 | /* | ||
32 | * the number of unsuccessful attempts to consume the resource | ||
33 | */ | ||
34 | unsigned long long failcnt; | ||
35 | /* | ||
36 | * the lock to protect all of the above. | ||
37 | * the routines below consider this to be IRQ-safe | ||
38 | */ | ||
39 | spinlock_t lock; | ||
40 | }; | ||
41 | |||
42 | /* | ||
43 | * Helpers to interact with userspace | ||
44 | * res_counter_read/_write - put/get the specified fields from the | ||
45 | * res_counter struct to/from the user | ||
46 | * | ||
47 | * @counter: the counter in question | ||
48 | * @member: the field to work with (see RES_xxx below) | ||
49 | * @buf: the buffer to opeate on,... | ||
50 | * @nbytes: its size... | ||
51 | * @pos: and the offset. | ||
52 | */ | ||
53 | |||
54 | ssize_t res_counter_read(struct res_counter *counter, int member, | ||
55 | const char __user *buf, size_t nbytes, loff_t *pos, | ||
56 | int (*read_strategy)(unsigned long long val, char *s)); | ||
57 | ssize_t res_counter_write(struct res_counter *counter, int member, | ||
58 | const char __user *buf, size_t nbytes, loff_t *pos, | ||
59 | int (*write_strategy)(char *buf, unsigned long long *val)); | ||
60 | |||
61 | /* | ||
62 | * the field descriptors. one for each member of res_counter | ||
63 | */ | ||
64 | |||
65 | enum { | ||
66 | RES_USAGE, | ||
67 | RES_LIMIT, | ||
68 | RES_FAILCNT, | ||
69 | }; | ||
70 | |||
71 | /* | ||
72 | * helpers for accounting | ||
73 | */ | ||
74 | |||
75 | void res_counter_init(struct res_counter *counter); | ||
76 | |||
77 | /* | ||
78 | * charge - try to consume more resource. | ||
79 | * | ||
80 | * @counter: the counter | ||
81 | * @val: the amount of the resource. each controller defines its own | ||
82 | * units, e.g. numbers, bytes, Kbytes, etc | ||
83 | * | ||
84 | * returns 0 on success and <0 if the counter->usage will exceed the | ||
85 | * counter->limit _locked call expects the counter->lock to be taken | ||
86 | */ | ||
87 | |||
88 | int res_counter_charge_locked(struct res_counter *counter, unsigned long val); | ||
89 | int res_counter_charge(struct res_counter *counter, unsigned long val); | ||
90 | |||
91 | /* | ||
92 | * uncharge - tell that some portion of the resource is released | ||
93 | * | ||
94 | * @counter: the counter | ||
95 | * @val: the amount of the resource | ||
96 | * | ||
97 | * these calls check for usage underflow and show a warning on the console | ||
98 | * _locked call expects the counter->lock to be taken | ||
99 | */ | ||
100 | |||
101 | void res_counter_uncharge_locked(struct res_counter *counter, unsigned long val); | ||
102 | void res_counter_uncharge(struct res_counter *counter, unsigned long val); | ||
103 | |||
104 | static inline bool res_counter_limit_check_locked(struct res_counter *cnt) | ||
105 | { | ||
106 | if (cnt->usage < cnt->limit) | ||
107 | return true; | ||
108 | |||
109 | return false; | ||
110 | } | ||
111 | |||
112 | /* | ||
113 | * Helper function to detect if the cgroup is within it's limit or | ||
114 | * not. It's currently called from cgroup_rss_prepare() | ||
115 | */ | ||
116 | static inline bool res_counter_check_under_limit(struct res_counter *cnt) | ||
117 | { | ||
118 | bool ret; | ||
119 | unsigned long flags; | ||
120 | |||
121 | spin_lock_irqsave(&cnt->lock, flags); | ||
122 | ret = res_counter_limit_check_locked(cnt); | ||
123 | spin_unlock_irqrestore(&cnt->lock, flags); | ||
124 | return ret; | ||
125 | } | ||
126 | |||
127 | #endif | ||
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 97347f22fc20..1383692ac5bd 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <linux/slab.h> | 8 | #include <linux/slab.h> |
9 | #include <linux/mm.h> | 9 | #include <linux/mm.h> |
10 | #include <linux/spinlock.h> | 10 | #include <linux/spinlock.h> |
11 | #include <linux/memcontrol.h> | ||
11 | 12 | ||
12 | /* | 13 | /* |
13 | * The anon_vma heads a list of private "related" vmas, to scan if | 14 | * The anon_vma heads a list of private "related" vmas, to scan if |
@@ -86,7 +87,7 @@ static inline void page_dup_rmap(struct page *page, struct vm_area_struct *vma, | |||
86 | /* | 87 | /* |
87 | * Called from mm/vmscan.c to handle paging out | 88 | * Called from mm/vmscan.c to handle paging out |
88 | */ | 89 | */ |
89 | int page_referenced(struct page *, int is_locked); | 90 | int page_referenced(struct page *, int is_locked, struct mem_cgroup *cnt); |
90 | int try_to_unmap(struct page *, int ignore_refs); | 91 | int try_to_unmap(struct page *, int ignore_refs); |
91 | 92 | ||
92 | /* | 93 | /* |
@@ -114,7 +115,7 @@ int page_mkclean(struct page *); | |||
114 | #define anon_vma_prepare(vma) (0) | 115 | #define anon_vma_prepare(vma) (0) |
115 | #define anon_vma_link(vma) do {} while (0) | 116 | #define anon_vma_link(vma) do {} while (0) |
116 | 117 | ||
117 | #define page_referenced(page,l) TestClearPageReferenced(page) | 118 | #define page_referenced(page,l,cnt) TestClearPageReferenced(page) |
118 | #define try_to_unmap(page, refs) SWAP_FAIL | 119 | #define try_to_unmap(page, refs) SWAP_FAIL |
119 | 120 | ||
120 | static inline int page_mkclean(struct page *page) | 121 | static inline int page_mkclean(struct page *page) |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 7c8ca05c3cae..8a4812c1c038 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -92,6 +92,7 @@ struct sched_param { | |||
92 | 92 | ||
93 | #include <asm/processor.h> | 93 | #include <asm/processor.h> |
94 | 94 | ||
95 | struct mem_cgroup; | ||
95 | struct exec_domain; | 96 | struct exec_domain; |
96 | struct futex_pi_state; | 97 | struct futex_pi_state; |
97 | struct robust_list_head; | 98 | struct robust_list_head; |
diff --git a/include/linux/serial167.h b/include/linux/serial167.h index 71b6df2516a6..59c81b708562 100644 --- a/include/linux/serial167.h +++ b/include/linux/serial167.h | |||
@@ -37,7 +37,6 @@ struct cyclades_port { | |||
37 | int ignore_status_mask; | 37 | int ignore_status_mask; |
38 | int close_delay; | 38 | int close_delay; |
39 | int IER; /* Interrupt Enable Register */ | 39 | int IER; /* Interrupt Enable Register */ |
40 | unsigned long event; | ||
41 | unsigned long last_active; | 40 | unsigned long last_active; |
42 | int count; /* # of fd on device */ | 41 | int count; /* # of fd on device */ |
43 | int x_char; /* to be pushed out ASAP */ | 42 | int x_char; /* to be pushed out ASAP */ |
@@ -49,7 +48,6 @@ struct cyclades_port { | |||
49 | int xmit_cnt; | 48 | int xmit_cnt; |
50 | int default_threshold; | 49 | int default_threshold; |
51 | int default_timeout; | 50 | int default_timeout; |
52 | struct work_struct tqueue; | ||
53 | wait_queue_head_t open_wait; | 51 | wait_queue_head_t open_wait; |
54 | wait_queue_head_t close_wait; | 52 | wait_queue_head_t close_wait; |
55 | struct cyclades_monitor mon; | 53 | struct cyclades_monitor mon; |
@@ -67,18 +65,6 @@ struct cyclades_port { | |||
67 | #define CYGETDEFTIMEOUT 0x435908 | 65 | #define CYGETDEFTIMEOUT 0x435908 |
68 | #define CYSETDEFTIMEOUT 0x435909 | 66 | #define CYSETDEFTIMEOUT 0x435909 |
69 | 67 | ||
70 | /* | ||
71 | * Events are used to schedule things to happen at timer-interrupt | ||
72 | * time, instead of at cy interrupt time. | ||
73 | */ | ||
74 | #define Cy_EVENT_READ_PROCESS 0 | ||
75 | #define Cy_EVENT_WRITE_WAKEUP 1 | ||
76 | #define Cy_EVENT_HANGUP 2 | ||
77 | #define Cy_EVENT_BREAK 3 | ||
78 | #define Cy_EVENT_OPEN_WAKEUP 4 | ||
79 | |||
80 | |||
81 | |||
82 | #define CyMaxChipsPerCard 1 | 68 | #define CyMaxChipsPerCard 1 |
83 | 69 | ||
84 | /**** cd2401 registers ****/ | 70 | /**** cd2401 registers ****/ |
diff --git a/include/linux/shm.h b/include/linux/shm.h index eeaed921a1dc..eca6235a46c0 100644 --- a/include/linux/shm.h +++ b/include/linux/shm.h | |||
@@ -3,7 +3,11 @@ | |||
3 | 3 | ||
4 | #include <linux/ipc.h> | 4 | #include <linux/ipc.h> |
5 | #include <linux/errno.h> | 5 | #include <linux/errno.h> |
6 | #ifdef __KERNEL__ | ||
6 | #include <asm/page.h> | 7 | #include <asm/page.h> |
8 | #else | ||
9 | #include <unistd.h> | ||
10 | #endif | ||
7 | 11 | ||
8 | /* | 12 | /* |
9 | * SHMMAX, SHMMNI and SHMALL are upper limits are defaults which can | 13 | * SHMMAX, SHMMNI and SHMALL are upper limits are defaults which can |
@@ -13,7 +17,11 @@ | |||
13 | #define SHMMAX 0x2000000 /* max shared seg size (bytes) */ | 17 | #define SHMMAX 0x2000000 /* max shared seg size (bytes) */ |
14 | #define SHMMIN 1 /* min shared seg size (bytes) */ | 18 | #define SHMMIN 1 /* min shared seg size (bytes) */ |
15 | #define SHMMNI 4096 /* max num of segs system wide */ | 19 | #define SHMMNI 4096 /* max num of segs system wide */ |
20 | #ifdef __KERNEL__ | ||
16 | #define SHMALL (SHMMAX/PAGE_SIZE*(SHMMNI/16)) /* max shm system wide (pages) */ | 21 | #define SHMALL (SHMMAX/PAGE_SIZE*(SHMMNI/16)) /* max shm system wide (pages) */ |
22 | #else | ||
23 | #define SHMALL (SHMMAX/getpagesize()*(SHMMNI/16)) | ||
24 | #endif | ||
17 | #define SHMSEG SHMMNI /* max shared segs per process */ | 25 | #define SHMSEG SHMMNI /* max shared segs per process */ |
18 | 26 | ||
19 | #ifdef __KERNEL__ | 27 | #ifdef __KERNEL__ |
diff --git a/include/linux/stallion.h b/include/linux/stallion.h index 94b4a10b912f..0424d75a5aaa 100644 --- a/include/linux/stallion.h +++ b/include/linux/stallion.h | |||
@@ -95,7 +95,6 @@ struct stlport { | |||
95 | struct tty_struct *tty; | 95 | struct tty_struct *tty; |
96 | wait_queue_head_t open_wait; | 96 | wait_queue_head_t open_wait; |
97 | wait_queue_head_t close_wait; | 97 | wait_queue_head_t close_wait; |
98 | struct work_struct tqueue; | ||
99 | comstats_t stats; | 98 | comstats_t stats; |
100 | struct stlrq tx; | 99 | struct stlrq tx; |
101 | }; | 100 | }; |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 353153ea0bd5..3ca5c4bd6d3f 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/linkage.h> | 5 | #include <linux/linkage.h> |
6 | #include <linux/mmzone.h> | 6 | #include <linux/mmzone.h> |
7 | #include <linux/list.h> | 7 | #include <linux/list.h> |
8 | #include <linux/memcontrol.h> | ||
8 | #include <linux/sched.h> | 9 | #include <linux/sched.h> |
9 | 10 | ||
10 | #include <asm/atomic.h> | 11 | #include <asm/atomic.h> |
@@ -182,6 +183,9 @@ extern void swap_setup(void); | |||
182 | /* linux/mm/vmscan.c */ | 183 | /* linux/mm/vmscan.c */ |
183 | extern unsigned long try_to_free_pages(struct zone **zones, int order, | 184 | extern unsigned long try_to_free_pages(struct zone **zones, int order, |
184 | gfp_t gfp_mask); | 185 | gfp_t gfp_mask); |
186 | extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem, | ||
187 | gfp_t gfp_mask); | ||
188 | extern int __isolate_lru_page(struct page *page, int mode); | ||
185 | extern unsigned long shrink_all_memory(unsigned long nr_pages); | 189 | extern unsigned long shrink_all_memory(unsigned long nr_pages); |
186 | extern int vm_swappiness; | 190 | extern int vm_swappiness; |
187 | extern int remove_mapping(struct address_space *mapping, struct page *page); | 191 | extern int remove_mapping(struct address_space *mapping, struct page *page); |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 5824a9777ad7..dd8e08fe8855 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -53,13 +53,6 @@ | |||
53 | */ | 53 | */ |
54 | #define __DISABLED_CHAR '\0' | 54 | #define __DISABLED_CHAR '\0' |
55 | 55 | ||
56 | /* | ||
57 | * This is the flip buffer used for the tty driver. The buffer is | ||
58 | * located in the tty structure, and is used as a high speed interface | ||
59 | * between the tty driver and the tty line discipline. | ||
60 | */ | ||
61 | #define TTY_FLIPBUF_SIZE 512 | ||
62 | |||
63 | struct tty_buffer { | 56 | struct tty_buffer { |
64 | struct tty_buffer *next; | 57 | struct tty_buffer *next; |
65 | char *char_buf_ptr; | 58 | char *char_buf_ptr; |