diff options
author | Ingo Molnar <mingo@elte.hu> | 2011-05-26 07:51:31 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-05-26 07:51:35 -0400 |
commit | de66ee979d0ea45171cc2501750e9f9f22f5a690 (patch) | |
tree | 5ab1a5c6b596b9b786902fb380274e1e1f4ceb13 /include | |
parent | 916f676f8dc016103f983c7ec54c18ecdbb6e349 (diff) | |
parent | 4db70f73e56961b9bcdfd0c36c62847a18b7dbb5 (diff) |
Merge branch 'linus' into x86/urgent
Merge reason: we want to queue up a dependent patch.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
85 files changed, 3330 insertions, 395 deletions
diff --git a/include/asm-generic/audit_change_attr.h b/include/asm-generic/audit_change_attr.h index bcbab3e4a3be..89b73e5d0fd0 100644 --- a/include/asm-generic/audit_change_attr.h +++ b/include/asm-generic/audit_change_attr.h | |||
@@ -1,4 +1,6 @@ | |||
1 | #ifdef __NR_chmod | ||
1 | __NR_chmod, | 2 | __NR_chmod, |
3 | #endif | ||
2 | __NR_fchmod, | 4 | __NR_fchmod, |
3 | #ifdef __NR_chown | 5 | #ifdef __NR_chown |
4 | __NR_chown, | 6 | __NR_chown, |
@@ -20,7 +22,9 @@ __NR_chown32, | |||
20 | __NR_fchown32, | 22 | __NR_fchown32, |
21 | __NR_lchown32, | 23 | __NR_lchown32, |
22 | #endif | 24 | #endif |
25 | #ifdef __NR_link | ||
23 | __NR_link, | 26 | __NR_link, |
27 | #endif | ||
24 | #ifdef __NR_linkat | 28 | #ifdef __NR_linkat |
25 | __NR_linkat, | 29 | __NR_linkat, |
26 | #endif | 30 | #endif |
diff --git a/include/asm-generic/audit_dir_write.h b/include/asm-generic/audit_dir_write.h index 6621bd82cbe8..7b61db4fe72b 100644 --- a/include/asm-generic/audit_dir_write.h +++ b/include/asm-generic/audit_dir_write.h | |||
@@ -1,13 +1,27 @@ | |||
1 | #ifdef __NR_rename | ||
1 | __NR_rename, | 2 | __NR_rename, |
3 | #endif | ||
4 | #ifdef __NR_mkdir | ||
2 | __NR_mkdir, | 5 | __NR_mkdir, |
6 | #endif | ||
7 | #ifdef __NR_rmdir | ||
3 | __NR_rmdir, | 8 | __NR_rmdir, |
9 | #endif | ||
4 | #ifdef __NR_creat | 10 | #ifdef __NR_creat |
5 | __NR_creat, | 11 | __NR_creat, |
6 | #endif | 12 | #endif |
13 | #ifdef __NR_link | ||
7 | __NR_link, | 14 | __NR_link, |
15 | #endif | ||
16 | #ifdef __NR_unlink | ||
8 | __NR_unlink, | 17 | __NR_unlink, |
18 | #endif | ||
19 | #ifdef __NR_symlink | ||
9 | __NR_symlink, | 20 | __NR_symlink, |
21 | #endif | ||
22 | #ifdef __NR_mknod | ||
10 | __NR_mknod, | 23 | __NR_mknod, |
24 | #endif | ||
11 | #ifdef __NR_mkdirat | 25 | #ifdef __NR_mkdirat |
12 | __NR_mkdirat, | 26 | __NR_mkdirat, |
13 | __NR_mknodat, | 27 | __NR_mknodat, |
diff --git a/include/asm-generic/audit_read.h b/include/asm-generic/audit_read.h index 0e87464d9847..3b249cb857dc 100644 --- a/include/asm-generic/audit_read.h +++ b/include/asm-generic/audit_read.h | |||
@@ -1,4 +1,6 @@ | |||
1 | #ifdef __NR_readlink | ||
1 | __NR_readlink, | 2 | __NR_readlink, |
3 | #endif | ||
2 | __NR_quotactl, | 4 | __NR_quotactl, |
3 | __NR_listxattr, | 5 | __NR_listxattr, |
4 | __NR_llistxattr, | 6 | __NR_llistxattr, |
@@ -6,3 +8,6 @@ __NR_flistxattr, | |||
6 | __NR_getxattr, | 8 | __NR_getxattr, |
7 | __NR_lgetxattr, | 9 | __NR_lgetxattr, |
8 | __NR_fgetxattr, | 10 | __NR_fgetxattr, |
11 | #ifdef __NR_readlinkat | ||
12 | __NR_readlinkat, | ||
13 | #endif | ||
diff --git a/include/asm-generic/audit_write.h b/include/asm-generic/audit_write.h index c5f1c2c920e2..e7020c57b13b 100644 --- a/include/asm-generic/audit_write.h +++ b/include/asm-generic/audit_write.h | |||
@@ -4,7 +4,9 @@ __NR_acct, | |||
4 | __NR_swapon, | 4 | __NR_swapon, |
5 | #endif | 5 | #endif |
6 | __NR_quotactl, | 6 | __NR_quotactl, |
7 | #ifdef __NR_truncate | ||
7 | __NR_truncate, | 8 | __NR_truncate, |
9 | #endif | ||
8 | #ifdef __NR_truncate64 | 10 | #ifdef __NR_truncate64 |
9 | __NR_truncate64, | 11 | __NR_truncate64, |
10 | #endif | 12 | #endif |
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index e5a3f5880001..91784841e407 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h | |||
@@ -162,9 +162,46 @@ extern void warn_slowpath_null(const char *file, const int line); | |||
162 | unlikely(__ret_warn_once); \ | 162 | unlikely(__ret_warn_once); \ |
163 | }) | 163 | }) |
164 | 164 | ||
165 | #ifdef CONFIG_PRINTK | ||
166 | |||
165 | #define WARN_ON_RATELIMIT(condition, state) \ | 167 | #define WARN_ON_RATELIMIT(condition, state) \ |
166 | WARN_ON((condition) && __ratelimit(state)) | 168 | WARN_ON((condition) && __ratelimit(state)) |
167 | 169 | ||
170 | #define __WARN_RATELIMIT(condition, state, format...) \ | ||
171 | ({ \ | ||
172 | int rtn = 0; \ | ||
173 | if (unlikely(__ratelimit(state))) \ | ||
174 | rtn = WARN(condition, format); \ | ||
175 | rtn; \ | ||
176 | }) | ||
177 | |||
178 | #define WARN_RATELIMIT(condition, format...) \ | ||
179 | ({ \ | ||
180 | static DEFINE_RATELIMIT_STATE(_rs, \ | ||
181 | DEFAULT_RATELIMIT_INTERVAL, \ | ||
182 | DEFAULT_RATELIMIT_BURST); \ | ||
183 | __WARN_RATELIMIT(condition, &_rs, format); \ | ||
184 | }) | ||
185 | |||
186 | #else | ||
187 | |||
188 | #define WARN_ON_RATELIMIT(condition, state) \ | ||
189 | WARN_ON(condition) | ||
190 | |||
191 | #define __WARN_RATELIMIT(condition, state, format...) \ | ||
192 | ({ \ | ||
193 | int rtn = WARN(condition, format); \ | ||
194 | rtn; \ | ||
195 | }) | ||
196 | |||
197 | #define WARN_RATELIMIT(condition, format...) \ | ||
198 | ({ \ | ||
199 | int rtn = WARN(condition, format); \ | ||
200 | rtn; \ | ||
201 | }) | ||
202 | |||
203 | #endif | ||
204 | |||
168 | /* | 205 | /* |
169 | * WARN_ON_SMP() is for cases that the warning is either | 206 | * WARN_ON_SMP() is for cases that the warning is either |
170 | * meaningless for !SMP or may even cause failures. | 207 | * meaningless for !SMP or may even cause failures. |
diff --git a/include/asm-generic/cacheflush.h b/include/asm-generic/cacheflush.h index 57b5c3c82e86..87bc536ccde3 100644 --- a/include/asm-generic/cacheflush.h +++ b/include/asm-generic/cacheflush.h | |||
@@ -24,7 +24,10 @@ | |||
24 | #define flush_cache_vunmap(start, end) do { } while (0) | 24 | #define flush_cache_vunmap(start, end) do { } while (0) |
25 | 25 | ||
26 | #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ | 26 | #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ |
27 | memcpy(dst, src, len) | 27 | do { \ |
28 | memcpy(dst, src, len); \ | ||
29 | flush_icache_user_range(vma, page, vaddr, len); \ | ||
30 | } while (0) | ||
28 | #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ | 31 | #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ |
29 | memcpy(dst, src, len) | 32 | memcpy(dst, src, len) |
30 | 33 | ||
diff --git a/include/asm-generic/resource.h b/include/asm-generic/resource.h index 587566f95f6c..61fa862fe08d 100644 --- a/include/asm-generic/resource.h +++ b/include/asm-generic/resource.h | |||
@@ -78,7 +78,7 @@ | |||
78 | [RLIMIT_CORE] = { 0, RLIM_INFINITY }, \ | 78 | [RLIMIT_CORE] = { 0, RLIM_INFINITY }, \ |
79 | [RLIMIT_RSS] = { RLIM_INFINITY, RLIM_INFINITY }, \ | 79 | [RLIMIT_RSS] = { RLIM_INFINITY, RLIM_INFINITY }, \ |
80 | [RLIMIT_NPROC] = { 0, 0 }, \ | 80 | [RLIMIT_NPROC] = { 0, 0 }, \ |
81 | [RLIMIT_NOFILE] = { INR_OPEN, INR_OPEN }, \ | 81 | [RLIMIT_NOFILE] = { INR_OPEN_CUR, INR_OPEN_MAX }, \ |
82 | [RLIMIT_MEMLOCK] = { MLOCK_LIMIT, MLOCK_LIMIT }, \ | 82 | [RLIMIT_MEMLOCK] = { MLOCK_LIMIT, MLOCK_LIMIT }, \ |
83 | [RLIMIT_AS] = { RLIM_INFINITY, RLIM_INFINITY }, \ | 83 | [RLIMIT_AS] = { RLIM_INFINITY, RLIM_INFINITY }, \ |
84 | [RLIMIT_LOCKS] = { RLIM_INFINITY, RLIM_INFINITY }, \ | 84 | [RLIMIT_LOCKS] = { RLIM_INFINITY, RLIM_INFINITY }, \ |
diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h index e43f9766259f..e58fa777fa09 100644 --- a/include/asm-generic/tlb.h +++ b/include/asm-generic/tlb.h | |||
@@ -5,6 +5,8 @@ | |||
5 | * Copyright 2001 Red Hat, Inc. | 5 | * Copyright 2001 Red Hat, Inc. |
6 | * Based on code from mm/memory.c Copyright Linus Torvalds and others. | 6 | * Based on code from mm/memory.c Copyright Linus Torvalds and others. |
7 | * | 7 | * |
8 | * Copyright 2011 Red Hat, Inc., Peter Zijlstra <pzijlstr@redhat.com> | ||
9 | * | ||
8 | * This program is free software; you can redistribute it and/or | 10 | * This program is free software; you can redistribute it and/or |
9 | * modify it under the terms of the GNU General Public License | 11 | * modify it under the terms of the GNU General Public License |
10 | * as published by the Free Software Foundation; either version | 12 | * as published by the Free Software Foundation; either version |
@@ -17,97 +19,111 @@ | |||
17 | #include <asm/pgalloc.h> | 19 | #include <asm/pgalloc.h> |
18 | #include <asm/tlbflush.h> | 20 | #include <asm/tlbflush.h> |
19 | 21 | ||
22 | #ifdef CONFIG_HAVE_RCU_TABLE_FREE | ||
20 | /* | 23 | /* |
21 | * For UP we don't need to worry about TLB flush | 24 | * Semi RCU freeing of the page directories. |
22 | * and page free order so much.. | 25 | * |
26 | * This is needed by some architectures to implement software pagetable walkers. | ||
27 | * | ||
28 | * gup_fast() and other software pagetable walkers do a lockless page-table | ||
29 | * walk and therefore needs some synchronization with the freeing of the page | ||
30 | * directories. The chosen means to accomplish that is by disabling IRQs over | ||
31 | * the walk. | ||
32 | * | ||
33 | * Architectures that use IPIs to flush TLBs will then automagically DTRT, | ||
34 | * since we unlink the page, flush TLBs, free the page. Since the disabling of | ||
35 | * IRQs delays the completion of the TLB flush we can never observe an already | ||
36 | * freed page. | ||
37 | * | ||
38 | * Architectures that do not have this (PPC) need to delay the freeing by some | ||
39 | * other means, this is that means. | ||
40 | * | ||
41 | * What we do is batch the freed directory pages (tables) and RCU free them. | ||
42 | * We use the sched RCU variant, as that guarantees that IRQ/preempt disabling | ||
43 | * holds off grace periods. | ||
44 | * | ||
45 | * However, in order to batch these pages we need to allocate storage, this | ||
46 | * allocation is deep inside the MM code and can thus easily fail on memory | ||
47 | * pressure. To guarantee progress we fall back to single table freeing, see | ||
48 | * the implementation of tlb_remove_table_one(). | ||
49 | * | ||
23 | */ | 50 | */ |
24 | #ifdef CONFIG_SMP | 51 | struct mmu_table_batch { |
25 | #ifdef ARCH_FREE_PTR_NR | 52 | struct rcu_head rcu; |
26 | #define FREE_PTR_NR ARCH_FREE_PTR_NR | 53 | unsigned int nr; |
27 | #else | 54 | void *tables[0]; |
28 | #define FREE_PTE_NR 506 | 55 | }; |
29 | #endif | 56 | |
30 | #define tlb_fast_mode(tlb) ((tlb)->nr == ~0U) | 57 | #define MAX_TABLE_BATCH \ |
31 | #else | 58 | ((PAGE_SIZE - sizeof(struct mmu_table_batch)) / sizeof(void *)) |
32 | #define FREE_PTE_NR 1 | 59 | |
33 | #define tlb_fast_mode(tlb) 1 | 60 | extern void tlb_table_flush(struct mmu_gather *tlb); |
61 | extern void tlb_remove_table(struct mmu_gather *tlb, void *table); | ||
62 | |||
34 | #endif | 63 | #endif |
35 | 64 | ||
36 | /* struct mmu_gather is an opaque type used by the mm code for passing around | 65 | /* |
37 | * any data needed by arch specific code for tlb_remove_page. | 66 | * If we can't allocate a page to make a big batch of page pointers |
67 | * to work on, then just handle a few from the on-stack structure. | ||
38 | */ | 68 | */ |
39 | struct mmu_gather { | 69 | #define MMU_GATHER_BUNDLE 8 |
40 | struct mm_struct *mm; | 70 | |
41 | unsigned int nr; /* set to ~0U means fast mode */ | 71 | struct mmu_gather_batch { |
42 | unsigned int need_flush;/* Really unmapped some ptes? */ | 72 | struct mmu_gather_batch *next; |
43 | unsigned int fullmm; /* non-zero means full mm flush */ | 73 | unsigned int nr; |
44 | struct page * pages[FREE_PTE_NR]; | 74 | unsigned int max; |
75 | struct page *pages[0]; | ||
45 | }; | 76 | }; |
46 | 77 | ||
47 | /* Users of the generic TLB shootdown code must declare this storage space. */ | 78 | #define MAX_GATHER_BATCH \ |
48 | DECLARE_PER_CPU(struct mmu_gather, mmu_gathers); | 79 | ((PAGE_SIZE - sizeof(struct mmu_gather_batch)) / sizeof(void *)) |
49 | 80 | ||
50 | /* tlb_gather_mmu | 81 | /* struct mmu_gather is an opaque type used by the mm code for passing around |
51 | * Return a pointer to an initialized struct mmu_gather. | 82 | * any data needed by arch specific code for tlb_remove_page. |
52 | */ | 83 | */ |
53 | static inline struct mmu_gather * | 84 | struct mmu_gather { |
54 | tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) | 85 | struct mm_struct *mm; |
55 | { | 86 | #ifdef CONFIG_HAVE_RCU_TABLE_FREE |
56 | struct mmu_gather *tlb = &get_cpu_var(mmu_gathers); | 87 | struct mmu_table_batch *batch; |
57 | 88 | #endif | |
58 | tlb->mm = mm; | 89 | unsigned int need_flush : 1, /* Did free PTEs */ |
90 | fast_mode : 1; /* No batching */ | ||
59 | 91 | ||
60 | /* Use fast mode if only one CPU is online */ | 92 | unsigned int fullmm; |
61 | tlb->nr = num_online_cpus() > 1 ? 0U : ~0U; | ||
62 | 93 | ||
63 | tlb->fullmm = full_mm_flush; | 94 | struct mmu_gather_batch *active; |
95 | struct mmu_gather_batch local; | ||
96 | struct page *__pages[MMU_GATHER_BUNDLE]; | ||
97 | }; | ||
64 | 98 | ||
65 | return tlb; | 99 | #define HAVE_GENERIC_MMU_GATHER |
66 | } | ||
67 | 100 | ||
68 | static inline void | 101 | static inline int tlb_fast_mode(struct mmu_gather *tlb) |
69 | tlb_flush_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) | ||
70 | { | 102 | { |
71 | if (!tlb->need_flush) | 103 | #ifdef CONFIG_SMP |
72 | return; | 104 | return tlb->fast_mode; |
73 | tlb->need_flush = 0; | 105 | #else |
74 | tlb_flush(tlb); | 106 | /* |
75 | if (!tlb_fast_mode(tlb)) { | 107 | * For UP we don't need to worry about TLB flush |
76 | free_pages_and_swap_cache(tlb->pages, tlb->nr); | 108 | * and page free order so much.. |
77 | tlb->nr = 0; | 109 | */ |
78 | } | 110 | return 1; |
111 | #endif | ||
79 | } | 112 | } |
80 | 113 | ||
81 | /* tlb_finish_mmu | 114 | void tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, bool fullmm); |
82 | * Called at the end of the shootdown operation to free up any resources | 115 | void tlb_flush_mmu(struct mmu_gather *tlb); |
83 | * that were required. | 116 | void tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end); |
84 | */ | 117 | int __tlb_remove_page(struct mmu_gather *tlb, struct page *page); |
85 | static inline void | ||
86 | tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) | ||
87 | { | ||
88 | tlb_flush_mmu(tlb, start, end); | ||
89 | |||
90 | /* keep the page table cache within bounds */ | ||
91 | check_pgt_cache(); | ||
92 | |||
93 | put_cpu_var(mmu_gathers); | ||
94 | } | ||
95 | 118 | ||
96 | /* tlb_remove_page | 119 | /* tlb_remove_page |
97 | * Must perform the equivalent to __free_pte(pte_get_and_clear(ptep)), while | 120 | * Similar to __tlb_remove_page but will call tlb_flush_mmu() itself when |
98 | * handling the additional races in SMP caused by other CPUs caching valid | 121 | * required. |
99 | * mappings in their TLBs. | ||
100 | */ | 122 | */ |
101 | static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page) | 123 | static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page) |
102 | { | 124 | { |
103 | tlb->need_flush = 1; | 125 | if (!__tlb_remove_page(tlb, page)) |
104 | if (tlb_fast_mode(tlb)) { | 126 | tlb_flush_mmu(tlb); |
105 | free_page_and_swap_cache(page); | ||
106 | return; | ||
107 | } | ||
108 | tlb->pages[tlb->nr++] = page; | ||
109 | if (tlb->nr >= FREE_PTE_NR) | ||
110 | tlb_flush_mmu(tlb, 0, 0); | ||
111 | } | 127 | } |
112 | 128 | ||
113 | /** | 129 | /** |
diff --git a/include/asm-generic/unistd.h b/include/asm-generic/unistd.h index 07c40d5149de..33d524704883 100644 --- a/include/asm-generic/unistd.h +++ b/include/asm-generic/unistd.h | |||
@@ -24,16 +24,24 @@ | |||
24 | #define __SC_3264(_nr, _32, _64) __SYSCALL(_nr, _64) | 24 | #define __SC_3264(_nr, _32, _64) __SYSCALL(_nr, _64) |
25 | #endif | 25 | #endif |
26 | 26 | ||
27 | #ifdef __SYSCALL_COMPAT | ||
28 | #define __SC_COMP(_nr, _sys, _comp) __SYSCALL(_nr, _comp) | ||
29 | #define __SC_COMP_3264(_nr, _32, _64, _comp) __SYSCALL(_nr, _comp) | ||
30 | #else | ||
31 | #define __SC_COMP(_nr, _sys, _comp) __SYSCALL(_nr, _sys) | ||
32 | #define __SC_COMP_3264(_nr, _32, _64, _comp) __SC_3264(_nr, _32, _64) | ||
33 | #endif | ||
34 | |||
27 | #define __NR_io_setup 0 | 35 | #define __NR_io_setup 0 |
28 | __SYSCALL(__NR_io_setup, sys_io_setup) | 36 | __SC_COMP(__NR_io_setup, sys_io_setup, compat_sys_io_setup) |
29 | #define __NR_io_destroy 1 | 37 | #define __NR_io_destroy 1 |
30 | __SYSCALL(__NR_io_destroy, sys_io_destroy) | 38 | __SYSCALL(__NR_io_destroy, sys_io_destroy) |
31 | #define __NR_io_submit 2 | 39 | #define __NR_io_submit 2 |
32 | __SYSCALL(__NR_io_submit, sys_io_submit) | 40 | __SC_COMP(__NR_io_submit, sys_io_submit, compat_sys_io_submit) |
33 | #define __NR_io_cancel 3 | 41 | #define __NR_io_cancel 3 |
34 | __SYSCALL(__NR_io_cancel, sys_io_cancel) | 42 | __SYSCALL(__NR_io_cancel, sys_io_cancel) |
35 | #define __NR_io_getevents 4 | 43 | #define __NR_io_getevents 4 |
36 | __SYSCALL(__NR_io_getevents, sys_io_getevents) | 44 | __SC_COMP(__NR_io_getevents, sys_io_getevents, compat_sys_io_getevents) |
37 | 45 | ||
38 | /* fs/xattr.c */ | 46 | /* fs/xattr.c */ |
39 | #define __NR_setxattr 5 | 47 | #define __NR_setxattr 5 |
@@ -67,7 +75,7 @@ __SYSCALL(__NR_getcwd, sys_getcwd) | |||
67 | 75 | ||
68 | /* fs/cookies.c */ | 76 | /* fs/cookies.c */ |
69 | #define __NR_lookup_dcookie 18 | 77 | #define __NR_lookup_dcookie 18 |
70 | __SYSCALL(__NR_lookup_dcookie, sys_lookup_dcookie) | 78 | __SC_COMP(__NR_lookup_dcookie, sys_lookup_dcookie, compat_sys_lookup_dcookie) |
71 | 79 | ||
72 | /* fs/eventfd.c */ | 80 | /* fs/eventfd.c */ |
73 | #define __NR_eventfd2 19 | 81 | #define __NR_eventfd2 19 |
@@ -79,7 +87,7 @@ __SYSCALL(__NR_epoll_create1, sys_epoll_create1) | |||
79 | #define __NR_epoll_ctl 21 | 87 | #define __NR_epoll_ctl 21 |
80 | __SYSCALL(__NR_epoll_ctl, sys_epoll_ctl) | 88 | __SYSCALL(__NR_epoll_ctl, sys_epoll_ctl) |
81 | #define __NR_epoll_pwait 22 | 89 | #define __NR_epoll_pwait 22 |
82 | __SYSCALL(__NR_epoll_pwait, sys_epoll_pwait) | 90 | __SC_COMP(__NR_epoll_pwait, sys_epoll_pwait, compat_sys_epoll_pwait) |
83 | 91 | ||
84 | /* fs/fcntl.c */ | 92 | /* fs/fcntl.c */ |
85 | #define __NR_dup 23 | 93 | #define __NR_dup 23 |
@@ -87,7 +95,7 @@ __SYSCALL(__NR_dup, sys_dup) | |||
87 | #define __NR_dup3 24 | 95 | #define __NR_dup3 24 |
88 | __SYSCALL(__NR_dup3, sys_dup3) | 96 | __SYSCALL(__NR_dup3, sys_dup3) |
89 | #define __NR3264_fcntl 25 | 97 | #define __NR3264_fcntl 25 |
90 | __SC_3264(__NR3264_fcntl, sys_fcntl64, sys_fcntl) | 98 | __SC_COMP_3264(__NR3264_fcntl, sys_fcntl64, sys_fcntl, compat_sys_fcntl64) |
91 | 99 | ||
92 | /* fs/inotify_user.c */ | 100 | /* fs/inotify_user.c */ |
93 | #define __NR_inotify_init1 26 | 101 | #define __NR_inotify_init1 26 |
@@ -99,7 +107,7 @@ __SYSCALL(__NR_inotify_rm_watch, sys_inotify_rm_watch) | |||
99 | 107 | ||
100 | /* fs/ioctl.c */ | 108 | /* fs/ioctl.c */ |
101 | #define __NR_ioctl 29 | 109 | #define __NR_ioctl 29 |
102 | __SYSCALL(__NR_ioctl, sys_ioctl) | 110 | __SC_COMP(__NR_ioctl, sys_ioctl, compat_sys_ioctl) |
103 | 111 | ||
104 | /* fs/ioprio.c */ | 112 | /* fs/ioprio.c */ |
105 | #define __NR_ioprio_set 30 | 113 | #define __NR_ioprio_set 30 |
@@ -129,26 +137,30 @@ __SYSCALL(__NR_renameat, sys_renameat) | |||
129 | #define __NR_umount2 39 | 137 | #define __NR_umount2 39 |
130 | __SYSCALL(__NR_umount2, sys_umount) | 138 | __SYSCALL(__NR_umount2, sys_umount) |
131 | #define __NR_mount 40 | 139 | #define __NR_mount 40 |
132 | __SYSCALL(__NR_mount, sys_mount) | 140 | __SC_COMP(__NR_mount, sys_mount, compat_sys_mount) |
133 | #define __NR_pivot_root 41 | 141 | #define __NR_pivot_root 41 |
134 | __SYSCALL(__NR_pivot_root, sys_pivot_root) | 142 | __SYSCALL(__NR_pivot_root, sys_pivot_root) |
135 | 143 | ||
136 | /* fs/nfsctl.c */ | 144 | /* fs/nfsctl.c */ |
137 | #define __NR_nfsservctl 42 | 145 | #define __NR_nfsservctl 42 |
138 | __SYSCALL(__NR_nfsservctl, sys_nfsservctl) | 146 | __SC_COMP(__NR_nfsservctl, sys_nfsservctl, compat_sys_nfsservctl) |
139 | 147 | ||
140 | /* fs/open.c */ | 148 | /* fs/open.c */ |
141 | #define __NR3264_statfs 43 | 149 | #define __NR3264_statfs 43 |
142 | __SC_3264(__NR3264_statfs, sys_statfs64, sys_statfs) | 150 | __SC_COMP_3264(__NR3264_statfs, sys_statfs64, sys_statfs, \ |
151 | compat_sys_statfs64) | ||
143 | #define __NR3264_fstatfs 44 | 152 | #define __NR3264_fstatfs 44 |
144 | __SC_3264(__NR3264_fstatfs, sys_fstatfs64, sys_fstatfs) | 153 | __SC_COMP_3264(__NR3264_fstatfs, sys_fstatfs64, sys_fstatfs, \ |
154 | compat_sys_fstatfs64) | ||
145 | #define __NR3264_truncate 45 | 155 | #define __NR3264_truncate 45 |
146 | __SC_3264(__NR3264_truncate, sys_truncate64, sys_truncate) | 156 | __SC_COMP_3264(__NR3264_truncate, sys_truncate64, sys_truncate, \ |
157 | compat_sys_truncate64) | ||
147 | #define __NR3264_ftruncate 46 | 158 | #define __NR3264_ftruncate 46 |
148 | __SC_3264(__NR3264_ftruncate, sys_ftruncate64, sys_ftruncate) | 159 | __SC_COMP_3264(__NR3264_ftruncate, sys_ftruncate64, sys_ftruncate, \ |
160 | compat_sys_ftruncate64) | ||
149 | 161 | ||
150 | #define __NR_fallocate 47 | 162 | #define __NR_fallocate 47 |
151 | __SYSCALL(__NR_fallocate, sys_fallocate) | 163 | __SC_COMP(__NR_fallocate, sys_fallocate, compat_sys_fallocate) |
152 | #define __NR_faccessat 48 | 164 | #define __NR_faccessat 48 |
153 | __SYSCALL(__NR_faccessat, sys_faccessat) | 165 | __SYSCALL(__NR_faccessat, sys_faccessat) |
154 | #define __NR_chdir 49 | 166 | #define __NR_chdir 49 |
@@ -166,7 +178,7 @@ __SYSCALL(__NR_fchownat, sys_fchownat) | |||
166 | #define __NR_fchown 55 | 178 | #define __NR_fchown 55 |
167 | __SYSCALL(__NR_fchown, sys_fchown) | 179 | __SYSCALL(__NR_fchown, sys_fchown) |
168 | #define __NR_openat 56 | 180 | #define __NR_openat 56 |
169 | __SYSCALL(__NR_openat, sys_openat) | 181 | __SC_COMP(__NR_openat, sys_openat, compat_sys_openat) |
170 | #define __NR_close 57 | 182 | #define __NR_close 57 |
171 | __SYSCALL(__NR_close, sys_close) | 183 | __SYSCALL(__NR_close, sys_close) |
172 | #define __NR_vhangup 58 | 184 | #define __NR_vhangup 58 |
@@ -182,7 +194,7 @@ __SYSCALL(__NR_quotactl, sys_quotactl) | |||
182 | 194 | ||
183 | /* fs/readdir.c */ | 195 | /* fs/readdir.c */ |
184 | #define __NR_getdents64 61 | 196 | #define __NR_getdents64 61 |
185 | __SYSCALL(__NR_getdents64, sys_getdents64) | 197 | __SC_COMP(__NR_getdents64, sys_getdents64, compat_sys_getdents64) |
186 | 198 | ||
187 | /* fs/read_write.c */ | 199 | /* fs/read_write.c */ |
188 | #define __NR3264_lseek 62 | 200 | #define __NR3264_lseek 62 |
@@ -192,17 +204,17 @@ __SYSCALL(__NR_read, sys_read) | |||
192 | #define __NR_write 64 | 204 | #define __NR_write 64 |
193 | __SYSCALL(__NR_write, sys_write) | 205 | __SYSCALL(__NR_write, sys_write) |
194 | #define __NR_readv 65 | 206 | #define __NR_readv 65 |
195 | __SYSCALL(__NR_readv, sys_readv) | 207 | __SC_COMP(__NR_readv, sys_readv, compat_sys_readv) |
196 | #define __NR_writev 66 | 208 | #define __NR_writev 66 |
197 | __SYSCALL(__NR_writev, sys_writev) | 209 | __SC_COMP(__NR_writev, sys_writev, compat_sys_writev) |
198 | #define __NR_pread64 67 | 210 | #define __NR_pread64 67 |
199 | __SYSCALL(__NR_pread64, sys_pread64) | 211 | __SC_COMP(__NR_pread64, sys_pread64, compat_sys_pread64) |
200 | #define __NR_pwrite64 68 | 212 | #define __NR_pwrite64 68 |
201 | __SYSCALL(__NR_pwrite64, sys_pwrite64) | 213 | __SC_COMP(__NR_pwrite64, sys_pwrite64, compat_sys_pwrite64) |
202 | #define __NR_preadv 69 | 214 | #define __NR_preadv 69 |
203 | __SYSCALL(__NR_preadv, sys_preadv) | 215 | __SC_COMP(__NR_preadv, sys_preadv, compat_sys_preadv) |
204 | #define __NR_pwritev 70 | 216 | #define __NR_pwritev 70 |
205 | __SYSCALL(__NR_pwritev, sys_pwritev) | 217 | __SC_COMP(__NR_pwritev, sys_pwritev, compat_sys_pwritev) |
206 | 218 | ||
207 | /* fs/sendfile.c */ | 219 | /* fs/sendfile.c */ |
208 | #define __NR3264_sendfile 71 | 220 | #define __NR3264_sendfile 71 |
@@ -210,17 +222,17 @@ __SC_3264(__NR3264_sendfile, sys_sendfile64, sys_sendfile) | |||
210 | 222 | ||
211 | /* fs/select.c */ | 223 | /* fs/select.c */ |
212 | #define __NR_pselect6 72 | 224 | #define __NR_pselect6 72 |
213 | __SYSCALL(__NR_pselect6, sys_pselect6) | 225 | __SC_COMP(__NR_pselect6, sys_pselect6, compat_sys_pselect6) |
214 | #define __NR_ppoll 73 | 226 | #define __NR_ppoll 73 |
215 | __SYSCALL(__NR_ppoll, sys_ppoll) | 227 | __SC_COMP(__NR_ppoll, sys_ppoll, compat_sys_ppoll) |
216 | 228 | ||
217 | /* fs/signalfd.c */ | 229 | /* fs/signalfd.c */ |
218 | #define __NR_signalfd4 74 | 230 | #define __NR_signalfd4 74 |
219 | __SYSCALL(__NR_signalfd4, sys_signalfd4) | 231 | __SC_COMP(__NR_signalfd4, sys_signalfd4, compat_sys_signalfd4) |
220 | 232 | ||
221 | /* fs/splice.c */ | 233 | /* fs/splice.c */ |
222 | #define __NR_vmsplice 75 | 234 | #define __NR_vmsplice 75 |
223 | __SYSCALL(__NR_vmsplice, sys_vmsplice) | 235 | __SC_COMP(__NR_vmsplice, sys_vmsplice, compat_sys_vmsplice) |
224 | #define __NR_splice 76 | 236 | #define __NR_splice 76 |
225 | __SYSCALL(__NR_splice, sys_splice) | 237 | __SYSCALL(__NR_splice, sys_splice) |
226 | #define __NR_tee 77 | 238 | #define __NR_tee 77 |
@@ -243,23 +255,27 @@ __SYSCALL(__NR_fsync, sys_fsync) | |||
243 | __SYSCALL(__NR_fdatasync, sys_fdatasync) | 255 | __SYSCALL(__NR_fdatasync, sys_fdatasync) |
244 | #ifdef __ARCH_WANT_SYNC_FILE_RANGE2 | 256 | #ifdef __ARCH_WANT_SYNC_FILE_RANGE2 |
245 | #define __NR_sync_file_range2 84 | 257 | #define __NR_sync_file_range2 84 |
246 | __SYSCALL(__NR_sync_file_range2, sys_sync_file_range2) | 258 | __SC_COMP(__NR_sync_file_range2, sys_sync_file_range2, \ |
259 | compat_sys_sync_file_range2) | ||
247 | #else | 260 | #else |
248 | #define __NR_sync_file_range 84 | 261 | #define __NR_sync_file_range 84 |
249 | __SYSCALL(__NR_sync_file_range, sys_sync_file_range) | 262 | __SC_COMP(__NR_sync_file_range, sys_sync_file_range, \ |
263 | compat_sys_sync_file_range) | ||
250 | #endif | 264 | #endif |
251 | 265 | ||
252 | /* fs/timerfd.c */ | 266 | /* fs/timerfd.c */ |
253 | #define __NR_timerfd_create 85 | 267 | #define __NR_timerfd_create 85 |
254 | __SYSCALL(__NR_timerfd_create, sys_timerfd_create) | 268 | __SYSCALL(__NR_timerfd_create, sys_timerfd_create) |
255 | #define __NR_timerfd_settime 86 | 269 | #define __NR_timerfd_settime 86 |
256 | __SYSCALL(__NR_timerfd_settime, sys_timerfd_settime) | 270 | __SC_COMP(__NR_timerfd_settime, sys_timerfd_settime, \ |
271 | compat_sys_timerfd_settime) | ||
257 | #define __NR_timerfd_gettime 87 | 272 | #define __NR_timerfd_gettime 87 |
258 | __SYSCALL(__NR_timerfd_gettime, sys_timerfd_gettime) | 273 | __SC_COMP(__NR_timerfd_gettime, sys_timerfd_gettime, \ |
274 | compat_sys_timerfd_gettime) | ||
259 | 275 | ||
260 | /* fs/utimes.c */ | 276 | /* fs/utimes.c */ |
261 | #define __NR_utimensat 88 | 277 | #define __NR_utimensat 88 |
262 | __SYSCALL(__NR_utimensat, sys_utimensat) | 278 | __SC_COMP(__NR_utimensat, sys_utimensat, compat_sys_utimensat) |
263 | 279 | ||
264 | /* kernel/acct.c */ | 280 | /* kernel/acct.c */ |
265 | #define __NR_acct 89 | 281 | #define __NR_acct 89 |
@@ -281,7 +297,7 @@ __SYSCALL(__NR_exit, sys_exit) | |||
281 | #define __NR_exit_group 94 | 297 | #define __NR_exit_group 94 |
282 | __SYSCALL(__NR_exit_group, sys_exit_group) | 298 | __SYSCALL(__NR_exit_group, sys_exit_group) |
283 | #define __NR_waitid 95 | 299 | #define __NR_waitid 95 |
284 | __SYSCALL(__NR_waitid, sys_waitid) | 300 | __SC_COMP(__NR_waitid, sys_waitid, compat_sys_waitid) |
285 | 301 | ||
286 | /* kernel/fork.c */ | 302 | /* kernel/fork.c */ |
287 | #define __NR_set_tid_address 96 | 303 | #define __NR_set_tid_address 96 |
@@ -291,25 +307,27 @@ __SYSCALL(__NR_unshare, sys_unshare) | |||
291 | 307 | ||
292 | /* kernel/futex.c */ | 308 | /* kernel/futex.c */ |
293 | #define __NR_futex 98 | 309 | #define __NR_futex 98 |
294 | __SYSCALL(__NR_futex, sys_futex) | 310 | __SC_COMP(__NR_futex, sys_futex, compat_sys_futex) |
295 | #define __NR_set_robust_list 99 | 311 | #define __NR_set_robust_list 99 |
296 | __SYSCALL(__NR_set_robust_list, sys_set_robust_list) | 312 | __SC_COMP(__NR_set_robust_list, sys_set_robust_list, \ |
313 | compat_sys_set_robust_list) | ||
297 | #define __NR_get_robust_list 100 | 314 | #define __NR_get_robust_list 100 |
298 | __SYSCALL(__NR_get_robust_list, sys_get_robust_list) | 315 | __SC_COMP(__NR_get_robust_list, sys_get_robust_list, \ |
316 | compat_sys_get_robust_list) | ||
299 | 317 | ||
300 | /* kernel/hrtimer.c */ | 318 | /* kernel/hrtimer.c */ |
301 | #define __NR_nanosleep 101 | 319 | #define __NR_nanosleep 101 |
302 | __SYSCALL(__NR_nanosleep, sys_nanosleep) | 320 | __SC_COMP(__NR_nanosleep, sys_nanosleep, compat_sys_nanosleep) |
303 | 321 | ||
304 | /* kernel/itimer.c */ | 322 | /* kernel/itimer.c */ |
305 | #define __NR_getitimer 102 | 323 | #define __NR_getitimer 102 |
306 | __SYSCALL(__NR_getitimer, sys_getitimer) | 324 | __SC_COMP(__NR_getitimer, sys_getitimer, compat_sys_getitimer) |
307 | #define __NR_setitimer 103 | 325 | #define __NR_setitimer 103 |
308 | __SYSCALL(__NR_setitimer, sys_setitimer) | 326 | __SC_COMP(__NR_setitimer, sys_setitimer, compat_sys_setitimer) |
309 | 327 | ||
310 | /* kernel/kexec.c */ | 328 | /* kernel/kexec.c */ |
311 | #define __NR_kexec_load 104 | 329 | #define __NR_kexec_load 104 |
312 | __SYSCALL(__NR_kexec_load, sys_kexec_load) | 330 | __SC_COMP(__NR_kexec_load, sys_kexec_load, compat_sys_kexec_load) |
313 | 331 | ||
314 | /* kernel/module.c */ | 332 | /* kernel/module.c */ |
315 | #define __NR_init_module 105 | 333 | #define __NR_init_module 105 |
@@ -319,23 +337,24 @@ __SYSCALL(__NR_delete_module, sys_delete_module) | |||
319 | 337 | ||
320 | /* kernel/posix-timers.c */ | 338 | /* kernel/posix-timers.c */ |
321 | #define __NR_timer_create 107 | 339 | #define __NR_timer_create 107 |
322 | __SYSCALL(__NR_timer_create, sys_timer_create) | 340 | __SC_COMP(__NR_timer_create, sys_timer_create, compat_sys_timer_create) |
323 | #define __NR_timer_gettime 108 | 341 | #define __NR_timer_gettime 108 |
324 | __SYSCALL(__NR_timer_gettime, sys_timer_gettime) | 342 | __SC_COMP(__NR_timer_gettime, sys_timer_gettime, compat_sys_timer_gettime) |
325 | #define __NR_timer_getoverrun 109 | 343 | #define __NR_timer_getoverrun 109 |
326 | __SYSCALL(__NR_timer_getoverrun, sys_timer_getoverrun) | 344 | __SYSCALL(__NR_timer_getoverrun, sys_timer_getoverrun) |
327 | #define __NR_timer_settime 110 | 345 | #define __NR_timer_settime 110 |
328 | __SYSCALL(__NR_timer_settime, sys_timer_settime) | 346 | __SC_COMP(__NR_timer_settime, sys_timer_settime, compat_sys_timer_settime) |
329 | #define __NR_timer_delete 111 | 347 | #define __NR_timer_delete 111 |
330 | __SYSCALL(__NR_timer_delete, sys_timer_delete) | 348 | __SYSCALL(__NR_timer_delete, sys_timer_delete) |
331 | #define __NR_clock_settime 112 | 349 | #define __NR_clock_settime 112 |
332 | __SYSCALL(__NR_clock_settime, sys_clock_settime) | 350 | __SC_COMP(__NR_clock_settime, sys_clock_settime, compat_sys_clock_settime) |
333 | #define __NR_clock_gettime 113 | 351 | #define __NR_clock_gettime 113 |
334 | __SYSCALL(__NR_clock_gettime, sys_clock_gettime) | 352 | __SC_COMP(__NR_clock_gettime, sys_clock_gettime, compat_sys_clock_gettime) |
335 | #define __NR_clock_getres 114 | 353 | #define __NR_clock_getres 114 |
336 | __SYSCALL(__NR_clock_getres, sys_clock_getres) | 354 | __SC_COMP(__NR_clock_getres, sys_clock_getres, compat_sys_clock_getres) |
337 | #define __NR_clock_nanosleep 115 | 355 | #define __NR_clock_nanosleep 115 |
338 | __SYSCALL(__NR_clock_nanosleep, sys_clock_nanosleep) | 356 | __SC_COMP(__NR_clock_nanosleep, sys_clock_nanosleep, \ |
357 | compat_sys_clock_nanosleep) | ||
339 | 358 | ||
340 | /* kernel/printk.c */ | 359 | /* kernel/printk.c */ |
341 | #define __NR_syslog 116 | 360 | #define __NR_syslog 116 |
@@ -355,9 +374,11 @@ __SYSCALL(__NR_sched_getscheduler, sys_sched_getscheduler) | |||
355 | #define __NR_sched_getparam 121 | 374 | #define __NR_sched_getparam 121 |
356 | __SYSCALL(__NR_sched_getparam, sys_sched_getparam) | 375 | __SYSCALL(__NR_sched_getparam, sys_sched_getparam) |
357 | #define __NR_sched_setaffinity 122 | 376 | #define __NR_sched_setaffinity 122 |
358 | __SYSCALL(__NR_sched_setaffinity, sys_sched_setaffinity) | 377 | __SC_COMP(__NR_sched_setaffinity, sys_sched_setaffinity, \ |
378 | compat_sys_sched_setaffinity) | ||
359 | #define __NR_sched_getaffinity 123 | 379 | #define __NR_sched_getaffinity 123 |
360 | __SYSCALL(__NR_sched_getaffinity, sys_sched_getaffinity) | 380 | __SC_COMP(__NR_sched_getaffinity, sys_sched_getaffinity, \ |
381 | compat_sys_sched_getaffinity) | ||
361 | #define __NR_sched_yield 124 | 382 | #define __NR_sched_yield 124 |
362 | __SYSCALL(__NR_sched_yield, sys_sched_yield) | 383 | __SYSCALL(__NR_sched_yield, sys_sched_yield) |
363 | #define __NR_sched_get_priority_max 125 | 384 | #define __NR_sched_get_priority_max 125 |
@@ -365,7 +386,8 @@ __SYSCALL(__NR_sched_get_priority_max, sys_sched_get_priority_max) | |||
365 | #define __NR_sched_get_priority_min 126 | 386 | #define __NR_sched_get_priority_min 126 |
366 | __SYSCALL(__NR_sched_get_priority_min, sys_sched_get_priority_min) | 387 | __SYSCALL(__NR_sched_get_priority_min, sys_sched_get_priority_min) |
367 | #define __NR_sched_rr_get_interval 127 | 388 | #define __NR_sched_rr_get_interval 127 |
368 | __SYSCALL(__NR_sched_rr_get_interval, sys_sched_rr_get_interval) | 389 | __SC_COMP(__NR_sched_rr_get_interval, sys_sched_rr_get_interval, \ |
390 | compat_sys_sched_rr_get_interval) | ||
369 | 391 | ||
370 | /* kernel/signal.c */ | 392 | /* kernel/signal.c */ |
371 | #define __NR_restart_syscall 128 | 393 | #define __NR_restart_syscall 128 |
@@ -377,21 +399,23 @@ __SYSCALL(__NR_tkill, sys_tkill) | |||
377 | #define __NR_tgkill 131 | 399 | #define __NR_tgkill 131 |
378 | __SYSCALL(__NR_tgkill, sys_tgkill) | 400 | __SYSCALL(__NR_tgkill, sys_tgkill) |
379 | #define __NR_sigaltstack 132 | 401 | #define __NR_sigaltstack 132 |
380 | __SYSCALL(__NR_sigaltstack, sys_sigaltstack) | 402 | __SC_COMP(__NR_sigaltstack, sys_sigaltstack, compat_sys_sigaltstack) |
381 | #define __NR_rt_sigsuspend 133 | 403 | #define __NR_rt_sigsuspend 133 |
382 | __SYSCALL(__NR_rt_sigsuspend, sys_rt_sigsuspend) /* __ARCH_WANT_SYS_RT_SIGSUSPEND */ | 404 | __SC_COMP(__NR_rt_sigsuspend, sys_rt_sigsuspend, compat_sys_rt_sigsuspend) |
383 | #define __NR_rt_sigaction 134 | 405 | #define __NR_rt_sigaction 134 |
384 | __SYSCALL(__NR_rt_sigaction, sys_rt_sigaction) /* __ARCH_WANT_SYS_RT_SIGACTION */ | 406 | __SC_COMP(__NR_rt_sigaction, sys_rt_sigaction, compat_sys_rt_sigaction) |
385 | #define __NR_rt_sigprocmask 135 | 407 | #define __NR_rt_sigprocmask 135 |
386 | __SYSCALL(__NR_rt_sigprocmask, sys_rt_sigprocmask) | 408 | __SYSCALL(__NR_rt_sigprocmask, sys_rt_sigprocmask) |
387 | #define __NR_rt_sigpending 136 | 409 | #define __NR_rt_sigpending 136 |
388 | __SYSCALL(__NR_rt_sigpending, sys_rt_sigpending) | 410 | __SYSCALL(__NR_rt_sigpending, sys_rt_sigpending) |
389 | #define __NR_rt_sigtimedwait 137 | 411 | #define __NR_rt_sigtimedwait 137 |
390 | __SYSCALL(__NR_rt_sigtimedwait, sys_rt_sigtimedwait) | 412 | __SC_COMP(__NR_rt_sigtimedwait, sys_rt_sigtimedwait, \ |
413 | compat_sys_rt_sigtimedwait) | ||
391 | #define __NR_rt_sigqueueinfo 138 | 414 | #define __NR_rt_sigqueueinfo 138 |
392 | __SYSCALL(__NR_rt_sigqueueinfo, sys_rt_sigqueueinfo) | 415 | __SC_COMP(__NR_rt_sigqueueinfo, sys_rt_sigqueueinfo, \ |
416 | compat_sys_rt_sigqueueinfo) | ||
393 | #define __NR_rt_sigreturn 139 | 417 | #define __NR_rt_sigreturn 139 |
394 | __SYSCALL(__NR_rt_sigreturn, sys_rt_sigreturn) /* sys_rt_sigreturn_wrapper, */ | 418 | __SC_COMP(__NR_rt_sigreturn, sys_rt_sigreturn, compat_sys_rt_sigreturn) |
395 | 419 | ||
396 | /* kernel/sys.c */ | 420 | /* kernel/sys.c */ |
397 | #define __NR_setpriority 140 | 421 | #define __NR_setpriority 140 |
@@ -421,7 +445,7 @@ __SYSCALL(__NR_setfsuid, sys_setfsuid) | |||
421 | #define __NR_setfsgid 152 | 445 | #define __NR_setfsgid 152 |
422 | __SYSCALL(__NR_setfsgid, sys_setfsgid) | 446 | __SYSCALL(__NR_setfsgid, sys_setfsgid) |
423 | #define __NR_times 153 | 447 | #define __NR_times 153 |
424 | __SYSCALL(__NR_times, sys_times) | 448 | __SC_COMP(__NR_times, sys_times, compat_sys_times) |
425 | #define __NR_setpgid 154 | 449 | #define __NR_setpgid 154 |
426 | __SYSCALL(__NR_setpgid, sys_setpgid) | 450 | __SYSCALL(__NR_setpgid, sys_setpgid) |
427 | #define __NR_getpgid 155 | 451 | #define __NR_getpgid 155 |
@@ -441,11 +465,11 @@ __SYSCALL(__NR_sethostname, sys_sethostname) | |||
441 | #define __NR_setdomainname 162 | 465 | #define __NR_setdomainname 162 |
442 | __SYSCALL(__NR_setdomainname, sys_setdomainname) | 466 | __SYSCALL(__NR_setdomainname, sys_setdomainname) |
443 | #define __NR_getrlimit 163 | 467 | #define __NR_getrlimit 163 |
444 | __SYSCALL(__NR_getrlimit, sys_getrlimit) | 468 | __SC_COMP(__NR_getrlimit, sys_getrlimit, compat_sys_getrlimit) |
445 | #define __NR_setrlimit 164 | 469 | #define __NR_setrlimit 164 |
446 | __SYSCALL(__NR_setrlimit, sys_setrlimit) | 470 | __SC_COMP(__NR_setrlimit, sys_setrlimit, compat_sys_setrlimit) |
447 | #define __NR_getrusage 165 | 471 | #define __NR_getrusage 165 |
448 | __SYSCALL(__NR_getrusage, sys_getrusage) | 472 | __SC_COMP(__NR_getrusage, sys_getrusage, compat_sys_getrusage) |
449 | #define __NR_umask 166 | 473 | #define __NR_umask 166 |
450 | __SYSCALL(__NR_umask, sys_umask) | 474 | __SYSCALL(__NR_umask, sys_umask) |
451 | #define __NR_prctl 167 | 475 | #define __NR_prctl 167 |
@@ -455,11 +479,11 @@ __SYSCALL(__NR_getcpu, sys_getcpu) | |||
455 | 479 | ||
456 | /* kernel/time.c */ | 480 | /* kernel/time.c */ |
457 | #define __NR_gettimeofday 169 | 481 | #define __NR_gettimeofday 169 |
458 | __SYSCALL(__NR_gettimeofday, sys_gettimeofday) | 482 | __SC_COMP(__NR_gettimeofday, sys_gettimeofday, compat_sys_gettimeofday) |
459 | #define __NR_settimeofday 170 | 483 | #define __NR_settimeofday 170 |
460 | __SYSCALL(__NR_settimeofday, sys_settimeofday) | 484 | __SC_COMP(__NR_settimeofday, sys_settimeofday, compat_sys_settimeofday) |
461 | #define __NR_adjtimex 171 | 485 | #define __NR_adjtimex 171 |
462 | __SYSCALL(__NR_adjtimex, sys_adjtimex) | 486 | __SC_COMP(__NR_adjtimex, sys_adjtimex, compat_sys_adjtimex) |
463 | 487 | ||
464 | /* kernel/timer.c */ | 488 | /* kernel/timer.c */ |
465 | #define __NR_getpid 172 | 489 | #define __NR_getpid 172 |
@@ -477,39 +501,40 @@ __SYSCALL(__NR_getegid, sys_getegid) | |||
477 | #define __NR_gettid 178 | 501 | #define __NR_gettid 178 |
478 | __SYSCALL(__NR_gettid, sys_gettid) | 502 | __SYSCALL(__NR_gettid, sys_gettid) |
479 | #define __NR_sysinfo 179 | 503 | #define __NR_sysinfo 179 |
480 | __SYSCALL(__NR_sysinfo, sys_sysinfo) | 504 | __SC_COMP(__NR_sysinfo, sys_sysinfo, compat_sys_sysinfo) |
481 | 505 | ||
482 | /* ipc/mqueue.c */ | 506 | /* ipc/mqueue.c */ |
483 | #define __NR_mq_open 180 | 507 | #define __NR_mq_open 180 |
484 | __SYSCALL(__NR_mq_open, sys_mq_open) | 508 | __SC_COMP(__NR_mq_open, sys_mq_open, compat_sys_mq_open) |
485 | #define __NR_mq_unlink 181 | 509 | #define __NR_mq_unlink 181 |
486 | __SYSCALL(__NR_mq_unlink, sys_mq_unlink) | 510 | __SYSCALL(__NR_mq_unlink, sys_mq_unlink) |
487 | #define __NR_mq_timedsend 182 | 511 | #define __NR_mq_timedsend 182 |
488 | __SYSCALL(__NR_mq_timedsend, sys_mq_timedsend) | 512 | __SC_COMP(__NR_mq_timedsend, sys_mq_timedsend, compat_sys_mq_timedsend) |
489 | #define __NR_mq_timedreceive 183 | 513 | #define __NR_mq_timedreceive 183 |
490 | __SYSCALL(__NR_mq_timedreceive, sys_mq_timedreceive) | 514 | __SC_COMP(__NR_mq_timedreceive, sys_mq_timedreceive, \ |
515 | compat_sys_mq_timedreceive) | ||
491 | #define __NR_mq_notify 184 | 516 | #define __NR_mq_notify 184 |
492 | __SYSCALL(__NR_mq_notify, sys_mq_notify) | 517 | __SC_COMP(__NR_mq_notify, sys_mq_notify, compat_sys_mq_notify) |
493 | #define __NR_mq_getsetattr 185 | 518 | #define __NR_mq_getsetattr 185 |
494 | __SYSCALL(__NR_mq_getsetattr, sys_mq_getsetattr) | 519 | __SC_COMP(__NR_mq_getsetattr, sys_mq_getsetattr, compat_sys_mq_getsetattr) |
495 | 520 | ||
496 | /* ipc/msg.c */ | 521 | /* ipc/msg.c */ |
497 | #define __NR_msgget 186 | 522 | #define __NR_msgget 186 |
498 | __SYSCALL(__NR_msgget, sys_msgget) | 523 | __SYSCALL(__NR_msgget, sys_msgget) |
499 | #define __NR_msgctl 187 | 524 | #define __NR_msgctl 187 |
500 | __SYSCALL(__NR_msgctl, sys_msgctl) | 525 | __SC_COMP(__NR_msgctl, sys_msgctl, compat_sys_msgctl) |
501 | #define __NR_msgrcv 188 | 526 | #define __NR_msgrcv 188 |
502 | __SYSCALL(__NR_msgrcv, sys_msgrcv) | 527 | __SC_COMP(__NR_msgrcv, sys_msgrcv, compat_sys_msgrcv) |
503 | #define __NR_msgsnd 189 | 528 | #define __NR_msgsnd 189 |
504 | __SYSCALL(__NR_msgsnd, sys_msgsnd) | 529 | __SC_COMP(__NR_msgsnd, sys_msgsnd, compat_sys_msgsnd) |
505 | 530 | ||
506 | /* ipc/sem.c */ | 531 | /* ipc/sem.c */ |
507 | #define __NR_semget 190 | 532 | #define __NR_semget 190 |
508 | __SYSCALL(__NR_semget, sys_semget) | 533 | __SYSCALL(__NR_semget, sys_semget) |
509 | #define __NR_semctl 191 | 534 | #define __NR_semctl 191 |
510 | __SYSCALL(__NR_semctl, sys_semctl) | 535 | __SC_COMP(__NR_semctl, sys_semctl, compat_sys_semctl) |
511 | #define __NR_semtimedop 192 | 536 | #define __NR_semtimedop 192 |
512 | __SYSCALL(__NR_semtimedop, sys_semtimedop) | 537 | __SC_COMP(__NR_semtimedop, sys_semtimedop, compat_sys_semtimedop) |
513 | #define __NR_semop 193 | 538 | #define __NR_semop 193 |
514 | __SYSCALL(__NR_semop, sys_semop) | 539 | __SYSCALL(__NR_semop, sys_semop) |
515 | 540 | ||
@@ -517,9 +542,9 @@ __SYSCALL(__NR_semop, sys_semop) | |||
517 | #define __NR_shmget 194 | 542 | #define __NR_shmget 194 |
518 | __SYSCALL(__NR_shmget, sys_shmget) | 543 | __SYSCALL(__NR_shmget, sys_shmget) |
519 | #define __NR_shmctl 195 | 544 | #define __NR_shmctl 195 |
520 | __SYSCALL(__NR_shmctl, sys_shmctl) | 545 | __SC_COMP(__NR_shmctl, sys_shmctl, compat_sys_shmctl) |
521 | #define __NR_shmat 196 | 546 | #define __NR_shmat 196 |
522 | __SYSCALL(__NR_shmat, sys_shmat) | 547 | __SC_COMP(__NR_shmat, sys_shmat, compat_sys_shmat) |
523 | #define __NR_shmdt 197 | 548 | #define __NR_shmdt 197 |
524 | __SYSCALL(__NR_shmdt, sys_shmdt) | 549 | __SYSCALL(__NR_shmdt, sys_shmdt) |
525 | 550 | ||
@@ -543,21 +568,21 @@ __SYSCALL(__NR_getpeername, sys_getpeername) | |||
543 | #define __NR_sendto 206 | 568 | #define __NR_sendto 206 |
544 | __SYSCALL(__NR_sendto, sys_sendto) | 569 | __SYSCALL(__NR_sendto, sys_sendto) |
545 | #define __NR_recvfrom 207 | 570 | #define __NR_recvfrom 207 |
546 | __SYSCALL(__NR_recvfrom, sys_recvfrom) | 571 | __SC_COMP(__NR_recvfrom, sys_recvfrom, compat_sys_recvfrom) |
547 | #define __NR_setsockopt 208 | 572 | #define __NR_setsockopt 208 |
548 | __SYSCALL(__NR_setsockopt, sys_setsockopt) | 573 | __SC_COMP(__NR_setsockopt, sys_setsockopt, compat_sys_setsockopt) |
549 | #define __NR_getsockopt 209 | 574 | #define __NR_getsockopt 209 |
550 | __SYSCALL(__NR_getsockopt, sys_getsockopt) | 575 | __SC_COMP(__NR_getsockopt, sys_getsockopt, compat_sys_getsockopt) |
551 | #define __NR_shutdown 210 | 576 | #define __NR_shutdown 210 |
552 | __SYSCALL(__NR_shutdown, sys_shutdown) | 577 | __SYSCALL(__NR_shutdown, sys_shutdown) |
553 | #define __NR_sendmsg 211 | 578 | #define __NR_sendmsg 211 |
554 | __SYSCALL(__NR_sendmsg, sys_sendmsg) | 579 | __SC_COMP(__NR_sendmsg, sys_sendmsg, compat_sys_sendmsg) |
555 | #define __NR_recvmsg 212 | 580 | #define __NR_recvmsg 212 |
556 | __SYSCALL(__NR_recvmsg, sys_recvmsg) | 581 | __SC_COMP(__NR_recvmsg, sys_recvmsg, compat_sys_recvmsg) |
557 | 582 | ||
558 | /* mm/filemap.c */ | 583 | /* mm/filemap.c */ |
559 | #define __NR_readahead 213 | 584 | #define __NR_readahead 213 |
560 | __SYSCALL(__NR_readahead, sys_readahead) | 585 | __SC_COMP(__NR_readahead, sys_readahead, compat_sys_readahead) |
561 | 586 | ||
562 | /* mm/nommu.c, also with MMU */ | 587 | /* mm/nommu.c, also with MMU */ |
563 | #define __NR_brk 214 | 588 | #define __NR_brk 214 |
@@ -573,19 +598,19 @@ __SYSCALL(__NR_add_key, sys_add_key) | |||
573 | #define __NR_request_key 218 | 598 | #define __NR_request_key 218 |
574 | __SYSCALL(__NR_request_key, sys_request_key) | 599 | __SYSCALL(__NR_request_key, sys_request_key) |
575 | #define __NR_keyctl 219 | 600 | #define __NR_keyctl 219 |
576 | __SYSCALL(__NR_keyctl, sys_keyctl) | 601 | __SC_COMP(__NR_keyctl, sys_keyctl, compat_sys_keyctl) |
577 | 602 | ||
578 | /* arch/example/kernel/sys_example.c */ | 603 | /* arch/example/kernel/sys_example.c */ |
579 | #define __NR_clone 220 | 604 | #define __NR_clone 220 |
580 | __SYSCALL(__NR_clone, sys_clone) /* .long sys_clone_wrapper */ | 605 | __SYSCALL(__NR_clone, sys_clone) |
581 | #define __NR_execve 221 | 606 | #define __NR_execve 221 |
582 | __SYSCALL(__NR_execve, sys_execve) /* .long sys_execve_wrapper */ | 607 | __SC_COMP(__NR_execve, sys_execve, compat_sys_execve) |
583 | 608 | ||
584 | #define __NR3264_mmap 222 | 609 | #define __NR3264_mmap 222 |
585 | __SC_3264(__NR3264_mmap, sys_mmap2, sys_mmap) | 610 | __SC_3264(__NR3264_mmap, sys_mmap2, sys_mmap) |
586 | /* mm/fadvise.c */ | 611 | /* mm/fadvise.c */ |
587 | #define __NR3264_fadvise64 223 | 612 | #define __NR3264_fadvise64 223 |
588 | __SYSCALL(__NR3264_fadvise64, sys_fadvise64_64) | 613 | __SC_COMP(__NR3264_fadvise64, sys_fadvise64_64, compat_sys_fadvise64_64) |
589 | 614 | ||
590 | /* mm/, CONFIG_MMU only */ | 615 | /* mm/, CONFIG_MMU only */ |
591 | #ifndef __ARCH_NOMMU | 616 | #ifndef __ARCH_NOMMU |
@@ -612,25 +637,26 @@ __SYSCALL(__NR_madvise, sys_madvise) | |||
612 | #define __NR_remap_file_pages 234 | 637 | #define __NR_remap_file_pages 234 |
613 | __SYSCALL(__NR_remap_file_pages, sys_remap_file_pages) | 638 | __SYSCALL(__NR_remap_file_pages, sys_remap_file_pages) |
614 | #define __NR_mbind 235 | 639 | #define __NR_mbind 235 |
615 | __SYSCALL(__NR_mbind, sys_mbind) | 640 | __SC_COMP(__NR_mbind, sys_mbind, compat_sys_mbind) |
616 | #define __NR_get_mempolicy 236 | 641 | #define __NR_get_mempolicy 236 |
617 | __SYSCALL(__NR_get_mempolicy, sys_get_mempolicy) | 642 | __SC_COMP(__NR_get_mempolicy, sys_get_mempolicy, compat_sys_get_mempolicy) |
618 | #define __NR_set_mempolicy 237 | 643 | #define __NR_set_mempolicy 237 |
619 | __SYSCALL(__NR_set_mempolicy, sys_set_mempolicy) | 644 | __SC_COMP(__NR_set_mempolicy, sys_set_mempolicy, compat_sys_set_mempolicy) |
620 | #define __NR_migrate_pages 238 | 645 | #define __NR_migrate_pages 238 |
621 | __SYSCALL(__NR_migrate_pages, sys_migrate_pages) | 646 | __SC_COMP(__NR_migrate_pages, sys_migrate_pages, compat_sys_migrate_pages) |
622 | #define __NR_move_pages 239 | 647 | #define __NR_move_pages 239 |
623 | __SYSCALL(__NR_move_pages, sys_move_pages) | 648 | __SC_COMP(__NR_move_pages, sys_move_pages, compat_sys_move_pages) |
624 | #endif | 649 | #endif |
625 | 650 | ||
626 | #define __NR_rt_tgsigqueueinfo 240 | 651 | #define __NR_rt_tgsigqueueinfo 240 |
627 | __SYSCALL(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo) | 652 | __SC_COMP(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo, \ |
653 | compat_sys_rt_tgsigqueueinfo) | ||
628 | #define __NR_perf_event_open 241 | 654 | #define __NR_perf_event_open 241 |
629 | __SYSCALL(__NR_perf_event_open, sys_perf_event_open) | 655 | __SYSCALL(__NR_perf_event_open, sys_perf_event_open) |
630 | #define __NR_accept4 242 | 656 | #define __NR_accept4 242 |
631 | __SYSCALL(__NR_accept4, sys_accept4) | 657 | __SYSCALL(__NR_accept4, sys_accept4) |
632 | #define __NR_recvmmsg 243 | 658 | #define __NR_recvmmsg 243 |
633 | __SYSCALL(__NR_recvmmsg, sys_recvmmsg) | 659 | __SC_COMP(__NR_recvmmsg, sys_recvmmsg, compat_sys_recvmmsg) |
634 | 660 | ||
635 | /* | 661 | /* |
636 | * Architectures may provide up to 16 syscalls of their own | 662 | * Architectures may provide up to 16 syscalls of their own |
@@ -639,19 +665,20 @@ __SYSCALL(__NR_recvmmsg, sys_recvmmsg) | |||
639 | #define __NR_arch_specific_syscall 244 | 665 | #define __NR_arch_specific_syscall 244 |
640 | 666 | ||
641 | #define __NR_wait4 260 | 667 | #define __NR_wait4 260 |
642 | __SYSCALL(__NR_wait4, sys_wait4) | 668 | __SC_COMP(__NR_wait4, sys_wait4, compat_sys_wait4) |
643 | #define __NR_prlimit64 261 | 669 | #define __NR_prlimit64 261 |
644 | __SYSCALL(__NR_prlimit64, sys_prlimit64) | 670 | __SYSCALL(__NR_prlimit64, sys_prlimit64) |
645 | #define __NR_fanotify_init 262 | 671 | #define __NR_fanotify_init 262 |
646 | __SYSCALL(__NR_fanotify_init, sys_fanotify_init) | 672 | __SYSCALL(__NR_fanotify_init, sys_fanotify_init) |
647 | #define __NR_fanotify_mark 263 | 673 | #define __NR_fanotify_mark 263 |
648 | __SYSCALL(__NR_fanotify_mark, sys_fanotify_mark) | 674 | __SYSCALL(__NR_fanotify_mark, sys_fanotify_mark) |
649 | #define __NR_name_to_handle_at 264 | 675 | #define __NR_name_to_handle_at 264 |
650 | __SYSCALL(__NR_name_to_handle_at, sys_name_to_handle_at) | 676 | __SYSCALL(__NR_name_to_handle_at, sys_name_to_handle_at) |
651 | #define __NR_open_by_handle_at 265 | 677 | #define __NR_open_by_handle_at 265 |
652 | __SYSCALL(__NR_open_by_handle_at, sys_open_by_handle_at) | 678 | __SC_COMP(__NR_open_by_handle_at, sys_open_by_handle_at, \ |
679 | compat_sys_open_by_handle_at) | ||
653 | #define __NR_clock_adjtime 266 | 680 | #define __NR_clock_adjtime 266 |
654 | __SYSCALL(__NR_clock_adjtime, sys_clock_adjtime) | 681 | __SC_COMP(__NR_clock_adjtime, sys_clock_adjtime, compat_sys_clock_adjtime) |
655 | #define __NR_syncfs 267 | 682 | #define __NR_syncfs 267 |
656 | __SYSCALL(__NR_syncfs, sys_syncfs) | 683 | __SYSCALL(__NR_syncfs, sys_syncfs) |
657 | 684 | ||
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index cb1ded2bd545..01f636275057 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -4,6 +4,7 @@ header-y += caif/ | |||
4 | header-y += dvb/ | 4 | header-y += dvb/ |
5 | header-y += hdlc/ | 5 | header-y += hdlc/ |
6 | header-y += isdn/ | 6 | header-y += isdn/ |
7 | header-y += mmc/ | ||
7 | header-y += nfsd/ | 8 | header-y += nfsd/ |
8 | header-y += raid/ | 9 | header-y += raid/ |
9 | header-y += spi/ | 10 | header-y += spi/ |
@@ -302,6 +303,7 @@ header-y += ppp-comp.h | |||
302 | header-y += ppp_defs.h | 303 | header-y += ppp_defs.h |
303 | header-y += pps.h | 304 | header-y += pps.h |
304 | header-y += prctl.h | 305 | header-y += prctl.h |
306 | header-y += ptp_clock.h | ||
305 | header-y += ptrace.h | 307 | header-y += ptrace.h |
306 | header-y += qnx4_fs.h | 308 | header-y += qnx4_fs.h |
307 | header-y += qnxtypes.h | 309 | header-y += qnxtypes.h |
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index daf8c480c786..dcafe0bf0005 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h | |||
@@ -55,7 +55,8 @@ | |||
55 | * bitmap_parse(buf, buflen, dst, nbits) Parse bitmap dst from kernel buf | 55 | * bitmap_parse(buf, buflen, dst, nbits) Parse bitmap dst from kernel buf |
56 | * bitmap_parse_user(ubuf, ulen, dst, nbits) Parse bitmap dst from user buf | 56 | * bitmap_parse_user(ubuf, ulen, dst, nbits) Parse bitmap dst from user buf |
57 | * bitmap_scnlistprintf(buf, len, src, nbits) Print bitmap src as list to buf | 57 | * bitmap_scnlistprintf(buf, len, src, nbits) Print bitmap src as list to buf |
58 | * bitmap_parselist(buf, dst, nbits) Parse bitmap dst from list | 58 | * bitmap_parselist(buf, dst, nbits) Parse bitmap dst from kernel buf |
59 | * bitmap_parselist_user(buf, dst, nbits) Parse bitmap dst from user buf | ||
59 | * bitmap_find_free_region(bitmap, bits, order) Find and allocate bit region | 60 | * bitmap_find_free_region(bitmap, bits, order) Find and allocate bit region |
60 | * bitmap_release_region(bitmap, pos, order) Free specified bit region | 61 | * bitmap_release_region(bitmap, pos, order) Free specified bit region |
61 | * bitmap_allocate_region(bitmap, pos, order) Allocate specified bit region | 62 | * bitmap_allocate_region(bitmap, pos, order) Allocate specified bit region |
@@ -129,6 +130,8 @@ extern int bitmap_scnlistprintf(char *buf, unsigned int len, | |||
129 | const unsigned long *src, int nbits); | 130 | const unsigned long *src, int nbits); |
130 | extern int bitmap_parselist(const char *buf, unsigned long *maskp, | 131 | extern int bitmap_parselist(const char *buf, unsigned long *maskp, |
131 | int nmaskbits); | 132 | int nmaskbits); |
133 | extern int bitmap_parselist_user(const char __user *ubuf, unsigned int ulen, | ||
134 | unsigned long *dst, int nbits); | ||
132 | extern void bitmap_remap(unsigned long *dst, const unsigned long *src, | 135 | extern void bitmap_remap(unsigned long *dst, const unsigned long *src, |
133 | const unsigned long *old, const unsigned long *new, int bits); | 136 | const unsigned long *old, const unsigned long *new, int bits); |
134 | extern int bitmap_bitremap(int oldbit, | 137 | extern int bitmap_bitremap(int oldbit, |
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index be50d9e70a7d..2a7cea53ca0d 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h | |||
@@ -151,7 +151,6 @@ enum rq_flag_bits { | |||
151 | __REQ_IO_STAT, /* account I/O stat */ | 151 | __REQ_IO_STAT, /* account I/O stat */ |
152 | __REQ_MIXED_MERGE, /* merge of different types, fail separately */ | 152 | __REQ_MIXED_MERGE, /* merge of different types, fail separately */ |
153 | __REQ_SECURE, /* secure discard (used with __REQ_DISCARD) */ | 153 | __REQ_SECURE, /* secure discard (used with __REQ_DISCARD) */ |
154 | __REQ_ON_PLUG, /* on plug list */ | ||
155 | __REQ_NR_BITS, /* stops here */ | 154 | __REQ_NR_BITS, /* stops here */ |
156 | }; | 155 | }; |
157 | 156 | ||
@@ -192,6 +191,5 @@ enum rq_flag_bits { | |||
192 | #define REQ_IO_STAT (1 << __REQ_IO_STAT) | 191 | #define REQ_IO_STAT (1 << __REQ_IO_STAT) |
193 | #define REQ_MIXED_MERGE (1 << __REQ_MIXED_MERGE) | 192 | #define REQ_MIXED_MERGE (1 << __REQ_MIXED_MERGE) |
194 | #define REQ_SECURE (1 << __REQ_SECURE) | 193 | #define REQ_SECURE (1 << __REQ_SECURE) |
195 | #define REQ_ON_PLUG (1 << __REQ_ON_PLUG) | ||
196 | 194 | ||
197 | #endif /* __LINUX_BLK_TYPES_H */ | 195 | #endif /* __LINUX_BLK_TYPES_H */ |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 2ad95fa1d130..ae9091a68480 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -257,7 +257,7 @@ struct queue_limits { | |||
257 | unsigned char misaligned; | 257 | unsigned char misaligned; |
258 | unsigned char discard_misaligned; | 258 | unsigned char discard_misaligned; |
259 | unsigned char cluster; | 259 | unsigned char cluster; |
260 | signed char discard_zeroes_data; | 260 | unsigned char discard_zeroes_data; |
261 | }; | 261 | }; |
262 | 262 | ||
263 | struct request_queue | 263 | struct request_queue |
@@ -364,6 +364,8 @@ struct request_queue | |||
364 | * for flush operations | 364 | * for flush operations |
365 | */ | 365 | */ |
366 | unsigned int flush_flags; | 366 | unsigned int flush_flags; |
367 | unsigned int flush_not_queueable:1; | ||
368 | unsigned int flush_queue_delayed:1; | ||
367 | unsigned int flush_pending_idx:1; | 369 | unsigned int flush_pending_idx:1; |
368 | unsigned int flush_running_idx:1; | 370 | unsigned int flush_running_idx:1; |
369 | unsigned long flush_pending_since; | 371 | unsigned long flush_pending_since; |
@@ -843,6 +845,7 @@ extern void blk_queue_softirq_done(struct request_queue *, softirq_done_fn *); | |||
843 | extern void blk_queue_rq_timed_out(struct request_queue *, rq_timed_out_fn *); | 845 | extern void blk_queue_rq_timed_out(struct request_queue *, rq_timed_out_fn *); |
844 | extern void blk_queue_rq_timeout(struct request_queue *, unsigned int); | 846 | extern void blk_queue_rq_timeout(struct request_queue *, unsigned int); |
845 | extern void blk_queue_flush(struct request_queue *q, unsigned int flush); | 847 | extern void blk_queue_flush(struct request_queue *q, unsigned int flush); |
848 | extern void blk_queue_flush_queueable(struct request_queue *q, bool queueable); | ||
846 | extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); | 849 | extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); |
847 | 850 | ||
848 | extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); | 851 | extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); |
@@ -1066,13 +1069,16 @@ static inline int queue_limit_discard_alignment(struct queue_limits *lim, sector | |||
1066 | { | 1069 | { |
1067 | unsigned int alignment = (sector << 9) & (lim->discard_granularity - 1); | 1070 | unsigned int alignment = (sector << 9) & (lim->discard_granularity - 1); |
1068 | 1071 | ||
1072 | if (!lim->max_discard_sectors) | ||
1073 | return 0; | ||
1074 | |||
1069 | return (lim->discard_granularity + lim->discard_alignment - alignment) | 1075 | return (lim->discard_granularity + lim->discard_alignment - alignment) |
1070 | & (lim->discard_granularity - 1); | 1076 | & (lim->discard_granularity - 1); |
1071 | } | 1077 | } |
1072 | 1078 | ||
1073 | static inline unsigned int queue_discard_zeroes_data(struct request_queue *q) | 1079 | static inline unsigned int queue_discard_zeroes_data(struct request_queue *q) |
1074 | { | 1080 | { |
1075 | if (q->limits.discard_zeroes_data == 1) | 1081 | if (q->limits.max_discard_sectors && q->limits.discard_zeroes_data == 1) |
1076 | return 1; | 1082 | return 1; |
1077 | 1083 | ||
1078 | return 0; | 1084 | return 0; |
@@ -1111,6 +1117,11 @@ static inline unsigned int block_size(struct block_device *bdev) | |||
1111 | return bdev->bd_block_size; | 1117 | return bdev->bd_block_size; |
1112 | } | 1118 | } |
1113 | 1119 | ||
1120 | static inline bool queue_flush_queueable(struct request_queue *q) | ||
1121 | { | ||
1122 | return !q->flush_not_queueable; | ||
1123 | } | ||
1124 | |||
1114 | typedef struct {struct page *v;} Sector; | 1125 | typedef struct {struct page *v;} Sector; |
1115 | 1126 | ||
1116 | unsigned char *read_dev_sector(struct block_device *, sector_t, Sector *); | 1127 | unsigned char *read_dev_sector(struct block_device *, sector_t, Sector *); |
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 01eca1794e14..ab344a521105 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
@@ -99,24 +99,31 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat, | |||
99 | unsigned long align, | 99 | unsigned long align, |
100 | unsigned long goal); | 100 | unsigned long goal); |
101 | 101 | ||
102 | #ifdef CONFIG_NO_BOOTMEM | ||
103 | /* We are using top down, so it is safe to use 0 here */ | ||
104 | #define BOOTMEM_LOW_LIMIT 0 | ||
105 | #else | ||
106 | #define BOOTMEM_LOW_LIMIT __pa(MAX_DMA_ADDRESS) | ||
107 | #endif | ||
108 | |||
102 | #define alloc_bootmem(x) \ | 109 | #define alloc_bootmem(x) \ |
103 | __alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) | 110 | __alloc_bootmem(x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT) |
104 | #define alloc_bootmem_align(x, align) \ | 111 | #define alloc_bootmem_align(x, align) \ |
105 | __alloc_bootmem(x, align, __pa(MAX_DMA_ADDRESS)) | 112 | __alloc_bootmem(x, align, BOOTMEM_LOW_LIMIT) |
106 | #define alloc_bootmem_nopanic(x) \ | 113 | #define alloc_bootmem_nopanic(x) \ |
107 | __alloc_bootmem_nopanic(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) | 114 | __alloc_bootmem_nopanic(x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT) |
108 | #define alloc_bootmem_pages(x) \ | 115 | #define alloc_bootmem_pages(x) \ |
109 | __alloc_bootmem(x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) | 116 | __alloc_bootmem(x, PAGE_SIZE, BOOTMEM_LOW_LIMIT) |
110 | #define alloc_bootmem_pages_nopanic(x) \ | 117 | #define alloc_bootmem_pages_nopanic(x) \ |
111 | __alloc_bootmem_nopanic(x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) | 118 | __alloc_bootmem_nopanic(x, PAGE_SIZE, BOOTMEM_LOW_LIMIT) |
112 | #define alloc_bootmem_node(pgdat, x) \ | 119 | #define alloc_bootmem_node(pgdat, x) \ |
113 | __alloc_bootmem_node(pgdat, x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) | 120 | __alloc_bootmem_node(pgdat, x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT) |
114 | #define alloc_bootmem_node_nopanic(pgdat, x) \ | 121 | #define alloc_bootmem_node_nopanic(pgdat, x) \ |
115 | __alloc_bootmem_node_nopanic(pgdat, x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) | 122 | __alloc_bootmem_node_nopanic(pgdat, x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT) |
116 | #define alloc_bootmem_pages_node(pgdat, x) \ | 123 | #define alloc_bootmem_pages_node(pgdat, x) \ |
117 | __alloc_bootmem_node(pgdat, x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) | 124 | __alloc_bootmem_node(pgdat, x, PAGE_SIZE, BOOTMEM_LOW_LIMIT) |
118 | #define alloc_bootmem_pages_node_nopanic(pgdat, x) \ | 125 | #define alloc_bootmem_pages_node_nopanic(pgdat, x) \ |
119 | __alloc_bootmem_node_nopanic(pgdat, x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) | 126 | __alloc_bootmem_node_nopanic(pgdat, x, PAGE_SIZE, BOOTMEM_LOW_LIMIT) |
120 | 127 | ||
121 | #define alloc_bootmem_low(x) \ | 128 | #define alloc_bootmem_low(x) \ |
122 | __alloc_bootmem_low(x, SMP_CACHE_BYTES, 0) | 129 | __alloc_bootmem_low(x, SMP_CACHE_BYTES, 0) |
diff --git a/include/linux/c2port.h b/include/linux/c2port.h index 2a5cd867c365..a2f7d7413f30 100644 --- a/include/linux/c2port.h +++ b/include/linux/c2port.h | |||
@@ -60,9 +60,6 @@ struct c2port_ops { | |||
60 | * Exported functions | 60 | * Exported functions |
61 | */ | 61 | */ |
62 | 62 | ||
63 | #define to_class_dev(obj) container_of((obj), struct class_device, kobj) | ||
64 | #define to_c2port_device(obj) container_of((obj), struct c2port_device, class) | ||
65 | |||
66 | extern struct c2port_device *c2port_device_register(char *name, | 63 | extern struct c2port_device *c2port_device_register(char *name, |
67 | struct c2port_ops *ops, void *devdata); | 64 | struct c2port_ops *ops, void *devdata); |
68 | extern void c2port_device_unregister(struct c2port_device *dev); | 65 | extern void c2port_device_unregister(struct c2port_device *dev); |
diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h index b8e995fbd867..b8c60694b2b0 100644 --- a/include/linux/ceph/ceph_fs.h +++ b/include/linux/ceph/ceph_fs.h | |||
@@ -313,6 +313,7 @@ enum { | |||
313 | CEPH_MDS_OP_GETATTR = 0x00101, | 313 | CEPH_MDS_OP_GETATTR = 0x00101, |
314 | CEPH_MDS_OP_LOOKUPHASH = 0x00102, | 314 | CEPH_MDS_OP_LOOKUPHASH = 0x00102, |
315 | CEPH_MDS_OP_LOOKUPPARENT = 0x00103, | 315 | CEPH_MDS_OP_LOOKUPPARENT = 0x00103, |
316 | CEPH_MDS_OP_LOOKUPINO = 0x00104, | ||
316 | 317 | ||
317 | CEPH_MDS_OP_SETXATTR = 0x01105, | 318 | CEPH_MDS_OP_SETXATTR = 0x01105, |
318 | CEPH_MDS_OP_RMXATTR = 0x01106, | 319 | CEPH_MDS_OP_RMXATTR = 0x01106, |
diff --git a/include/linux/compat.h b/include/linux/compat.h index 5778b559d59c..ddcb7db38e67 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -12,6 +12,8 @@ | |||
12 | #include <linux/sem.h> | 12 | #include <linux/sem.h> |
13 | #include <linux/socket.h> | 13 | #include <linux/socket.h> |
14 | #include <linux/if.h> | 14 | #include <linux/if.h> |
15 | #include <linux/fs.h> | ||
16 | #include <linux/aio_abi.h> /* for aio_context_t */ | ||
15 | 17 | ||
16 | #include <asm/compat.h> | 18 | #include <asm/compat.h> |
17 | #include <asm/siginfo.h> | 19 | #include <asm/siginfo.h> |
@@ -26,7 +28,7 @@ typedef __compat_gid32_t compat_gid_t; | |||
26 | struct compat_sel_arg_struct; | 28 | struct compat_sel_arg_struct; |
27 | struct rusage; | 29 | struct rusage; |
28 | 30 | ||
29 | struct compat_itimerspec { | 31 | struct compat_itimerspec { |
30 | struct compat_timespec it_interval; | 32 | struct compat_timespec it_interval; |
31 | struct compat_timespec it_value; | 33 | struct compat_timespec it_value; |
32 | }; | 34 | }; |
@@ -70,9 +72,9 @@ struct compat_timex { | |||
70 | compat_long_t stbcnt; | 72 | compat_long_t stbcnt; |
71 | compat_int_t tai; | 73 | compat_int_t tai; |
72 | 74 | ||
73 | compat_int_t :32; compat_int_t :32; compat_int_t :32; compat_int_t :32; | 75 | compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32; |
74 | compat_int_t :32; compat_int_t :32; compat_int_t :32; compat_int_t :32; | 76 | compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32; |
75 | compat_int_t :32; compat_int_t :32; compat_int_t :32; | 77 | compat_int_t:32; compat_int_t:32; compat_int_t:32; |
76 | }; | 78 | }; |
77 | 79 | ||
78 | #define _COMPAT_NSIG_WORDS (_COMPAT_NSIG / _COMPAT_NSIG_BPW) | 80 | #define _COMPAT_NSIG_WORDS (_COMPAT_NSIG / _COMPAT_NSIG_BPW) |
@@ -81,8 +83,10 @@ typedef struct { | |||
81 | compat_sigset_word sig[_COMPAT_NSIG_WORDS]; | 83 | compat_sigset_word sig[_COMPAT_NSIG_WORDS]; |
82 | } compat_sigset_t; | 84 | } compat_sigset_t; |
83 | 85 | ||
84 | extern int get_compat_timespec(struct timespec *, const struct compat_timespec __user *); | 86 | extern int get_compat_timespec(struct timespec *, |
85 | extern int put_compat_timespec(const struct timespec *, struct compat_timespec __user *); | 87 | const struct compat_timespec __user *); |
88 | extern int put_compat_timespec(const struct timespec *, | ||
89 | struct compat_timespec __user *); | ||
86 | 90 | ||
87 | struct compat_iovec { | 91 | struct compat_iovec { |
88 | compat_uptr_t iov_base; | 92 | compat_uptr_t iov_base; |
@@ -113,7 +117,8 @@ struct compat_rusage { | |||
113 | compat_long_t ru_nivcsw; | 117 | compat_long_t ru_nivcsw; |
114 | }; | 118 | }; |
115 | 119 | ||
116 | extern int put_compat_rusage(const struct rusage *, struct compat_rusage __user *); | 120 | extern int put_compat_rusage(const struct rusage *, |
121 | struct compat_rusage __user *); | ||
117 | 122 | ||
118 | struct compat_siginfo; | 123 | struct compat_siginfo; |
119 | 124 | ||
@@ -166,8 +171,7 @@ struct compat_ifmap { | |||
166 | unsigned char port; | 171 | unsigned char port; |
167 | }; | 172 | }; |
168 | 173 | ||
169 | struct compat_if_settings | 174 | struct compat_if_settings { |
170 | { | ||
171 | unsigned int type; /* Type of physical device or protocol */ | 175 | unsigned int type; /* Type of physical device or protocol */ |
172 | unsigned int size; /* Size of the data allocated by the caller */ | 176 | unsigned int size; /* Size of the data allocated by the caller */ |
173 | compat_uptr_t ifs_ifsu; /* union of pointers */ | 177 | compat_uptr_t ifs_ifsu; /* union of pointers */ |
@@ -195,8 +199,8 @@ struct compat_ifreq { | |||
195 | }; | 199 | }; |
196 | 200 | ||
197 | struct compat_ifconf { | 201 | struct compat_ifconf { |
198 | compat_int_t ifc_len; /* size of buffer */ | 202 | compat_int_t ifc_len; /* size of buffer */ |
199 | compat_caddr_t ifcbuf; | 203 | compat_caddr_t ifcbuf; |
200 | }; | 204 | }; |
201 | 205 | ||
202 | struct compat_robust_list { | 206 | struct compat_robust_list { |
@@ -209,6 +213,18 @@ struct compat_robust_list_head { | |||
209 | compat_uptr_t list_op_pending; | 213 | compat_uptr_t list_op_pending; |
210 | }; | 214 | }; |
211 | 215 | ||
216 | struct compat_statfs; | ||
217 | struct compat_statfs64; | ||
218 | struct compat_old_linux_dirent; | ||
219 | struct compat_linux_dirent; | ||
220 | struct linux_dirent64; | ||
221 | struct compat_msghdr; | ||
222 | struct compat_mmsghdr; | ||
223 | struct compat_sysinfo; | ||
224 | struct compat_sysctl_args; | ||
225 | struct compat_kexec_segment; | ||
226 | struct compat_mq_attr; | ||
227 | |||
212 | extern void compat_exit_robust_list(struct task_struct *curr); | 228 | extern void compat_exit_robust_list(struct task_struct *curr); |
213 | 229 | ||
214 | asmlinkage long | 230 | asmlinkage long |
@@ -243,8 +259,8 @@ asmlinkage ssize_t compat_sys_pwritev(unsigned long fd, | |||
243 | const struct compat_iovec __user *vec, | 259 | const struct compat_iovec __user *vec, |
244 | unsigned long vlen, u32 pos_low, u32 pos_high); | 260 | unsigned long vlen, u32 pos_low, u32 pos_high); |
245 | 261 | ||
246 | int compat_do_execve(char * filename, compat_uptr_t __user *argv, | 262 | int compat_do_execve(char *filename, compat_uptr_t __user *argv, |
247 | compat_uptr_t __user *envp, struct pt_regs * regs); | 263 | compat_uptr_t __user *envp, struct pt_regs *regs); |
248 | 264 | ||
249 | asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp, | 265 | asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp, |
250 | compat_ulong_t __user *outp, compat_ulong_t __user *exp, | 266 | compat_ulong_t __user *outp, compat_ulong_t __user *exp, |
@@ -331,12 +347,18 @@ asmlinkage long compat_sys_epoll_pwait(int epfd, | |||
331 | const compat_sigset_t __user *sigmask, | 347 | const compat_sigset_t __user *sigmask, |
332 | compat_size_t sigsetsize); | 348 | compat_size_t sigsetsize); |
333 | 349 | ||
334 | asmlinkage long compat_sys_utimensat(unsigned int dfd, const char __user *filename, | 350 | asmlinkage long compat_sys_utime(const char __user *filename, |
335 | struct compat_timespec __user *t, int flags); | 351 | struct compat_utimbuf __user *t); |
352 | asmlinkage long compat_sys_utimensat(unsigned int dfd, | ||
353 | const char __user *filename, | ||
354 | struct compat_timespec __user *t, | ||
355 | int flags); | ||
336 | 356 | ||
357 | asmlinkage long compat_sys_time(compat_time_t __user *tloc); | ||
358 | asmlinkage long compat_sys_stime(compat_time_t __user *tptr); | ||
337 | asmlinkage long compat_sys_signalfd(int ufd, | 359 | asmlinkage long compat_sys_signalfd(int ufd, |
338 | const compat_sigset_t __user *sigmask, | 360 | const compat_sigset_t __user *sigmask, |
339 | compat_size_t sigsetsize); | 361 | compat_size_t sigsetsize); |
340 | asmlinkage long compat_sys_timerfd_settime(int ufd, int flags, | 362 | asmlinkage long compat_sys_timerfd_settime(int ufd, int flags, |
341 | const struct compat_itimerspec __user *utmr, | 363 | const struct compat_itimerspec __user *utmr, |
342 | struct compat_itimerspec __user *otmr); | 364 | struct compat_itimerspec __user *otmr); |
@@ -348,16 +370,190 @@ asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_page, | |||
348 | const int __user *nodes, | 370 | const int __user *nodes, |
349 | int __user *status, | 371 | int __user *status, |
350 | int flags); | 372 | int flags); |
351 | asmlinkage long compat_sys_futimesat(unsigned int dfd, const char __user *filename, | 373 | asmlinkage long compat_sys_futimesat(unsigned int dfd, |
374 | const char __user *filename, | ||
352 | struct compat_timeval __user *t); | 375 | struct compat_timeval __user *t); |
353 | asmlinkage long compat_sys_newfstatat(unsigned int dfd, const char __user * filename, | 376 | asmlinkage long compat_sys_utimes(const char __user *filename, |
377 | struct compat_timeval __user *t); | ||
378 | asmlinkage long compat_sys_newstat(const char __user *filename, | ||
379 | struct compat_stat __user *statbuf); | ||
380 | asmlinkage long compat_sys_newlstat(const char __user *filename, | ||
381 | struct compat_stat __user *statbuf); | ||
382 | asmlinkage long compat_sys_newfstatat(unsigned int dfd, | ||
383 | const char __user *filename, | ||
354 | struct compat_stat __user *statbuf, | 384 | struct compat_stat __user *statbuf, |
355 | int flag); | 385 | int flag); |
386 | asmlinkage long compat_sys_newfstat(unsigned int fd, | ||
387 | struct compat_stat __user *statbuf); | ||
388 | asmlinkage long compat_sys_statfs(const char __user *pathname, | ||
389 | struct compat_statfs __user *buf); | ||
390 | asmlinkage long compat_sys_fstatfs(unsigned int fd, | ||
391 | struct compat_statfs __user *buf); | ||
392 | asmlinkage long compat_sys_statfs64(const char __user *pathname, | ||
393 | compat_size_t sz, | ||
394 | struct compat_statfs64 __user *buf); | ||
395 | asmlinkage long compat_sys_fstatfs64(unsigned int fd, compat_size_t sz, | ||
396 | struct compat_statfs64 __user *buf); | ||
397 | asmlinkage long compat_sys_fcntl64(unsigned int fd, unsigned int cmd, | ||
398 | unsigned long arg); | ||
399 | asmlinkage long compat_sys_fcntl(unsigned int fd, unsigned int cmd, | ||
400 | unsigned long arg); | ||
401 | asmlinkage long compat_sys_io_setup(unsigned nr_reqs, u32 __user *ctx32p); | ||
402 | asmlinkage long compat_sys_io_getevents(aio_context_t ctx_id, | ||
403 | unsigned long min_nr, | ||
404 | unsigned long nr, | ||
405 | struct io_event __user *events, | ||
406 | struct compat_timespec __user *timeout); | ||
407 | asmlinkage long compat_sys_io_submit(aio_context_t ctx_id, int nr, | ||
408 | u32 __user *iocb); | ||
409 | asmlinkage long compat_sys_mount(const char __user *dev_name, | ||
410 | const char __user *dir_name, | ||
411 | const char __user *type, unsigned long flags, | ||
412 | const void __user *data); | ||
413 | asmlinkage long compat_sys_old_readdir(unsigned int fd, | ||
414 | struct compat_old_linux_dirent __user *, | ||
415 | unsigned int count); | ||
416 | asmlinkage long compat_sys_getdents(unsigned int fd, | ||
417 | struct compat_linux_dirent __user *dirent, | ||
418 | unsigned int count); | ||
419 | asmlinkage long compat_sys_getdents64(unsigned int fd, | ||
420 | struct linux_dirent64 __user *dirent, | ||
421 | unsigned int count); | ||
422 | asmlinkage long compat_sys_vmsplice(int fd, const struct compat_iovec __user *, | ||
423 | unsigned int nr_segs, unsigned int flags); | ||
424 | asmlinkage long compat_sys_open(const char __user *filename, int flags, | ||
425 | int mode); | ||
356 | asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, | 426 | asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, |
357 | int flags, int mode); | 427 | int flags, int mode); |
428 | asmlinkage long compat_sys_open_by_handle_at(int mountdirfd, | ||
429 | struct file_handle __user *handle, | ||
430 | int flags); | ||
431 | asmlinkage long compat_sys_pselect6(int n, compat_ulong_t __user *inp, | ||
432 | compat_ulong_t __user *outp, | ||
433 | compat_ulong_t __user *exp, | ||
434 | struct compat_timespec __user *tsp, | ||
435 | void __user *sig); | ||
436 | asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds, | ||
437 | unsigned int nfds, | ||
438 | struct compat_timespec __user *tsp, | ||
439 | const compat_sigset_t __user *sigmask, | ||
440 | compat_size_t sigsetsize); | ||
441 | #if (defined(CONFIG_NFSD) || defined(CONFIG_NFSD_MODULE)) && \ | ||
442 | !defined(CONFIG_NFSD_DEPRECATED) | ||
443 | union compat_nfsctl_res; | ||
444 | struct compat_nfsctl_arg; | ||
445 | asmlinkage long compat_sys_nfsservctl(int cmd, | ||
446 | struct compat_nfsctl_arg __user *arg, | ||
447 | union compat_nfsctl_res __user *res); | ||
448 | #else | ||
449 | asmlinkage long compat_sys_nfsservctl(int cmd, void *notused, void *notused2); | ||
450 | #endif | ||
451 | asmlinkage long compat_sys_signalfd4(int ufd, | ||
452 | const compat_sigset_t __user *sigmask, | ||
453 | compat_size_t sigsetsize, int flags); | ||
454 | asmlinkage long compat_sys_get_mempolicy(int __user *policy, | ||
455 | compat_ulong_t __user *nmask, | ||
456 | compat_ulong_t maxnode, | ||
457 | compat_ulong_t addr, | ||
458 | compat_ulong_t flags); | ||
459 | asmlinkage long compat_sys_set_mempolicy(int mode, compat_ulong_t __user *nmask, | ||
460 | compat_ulong_t maxnode); | ||
461 | asmlinkage long compat_sys_mbind(compat_ulong_t start, compat_ulong_t len, | ||
462 | compat_ulong_t mode, | ||
463 | compat_ulong_t __user *nmask, | ||
464 | compat_ulong_t maxnode, compat_ulong_t flags); | ||
465 | |||
466 | asmlinkage long compat_sys_setsockopt(int fd, int level, int optname, | ||
467 | char __user *optval, unsigned int optlen); | ||
468 | asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr __user *msg, | ||
469 | unsigned flags); | ||
470 | asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr __user *msg, | ||
471 | unsigned int flags); | ||
472 | asmlinkage long compat_sys_recv(int fd, void __user *buf, size_t len, | ||
473 | unsigned flags); | ||
474 | asmlinkage long compat_sys_recvfrom(int fd, void __user *buf, size_t len, | ||
475 | unsigned flags, struct sockaddr __user *addr, | ||
476 | int __user *addrlen); | ||
477 | asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg, | ||
478 | unsigned vlen, unsigned int flags, | ||
479 | struct compat_timespec __user *timeout); | ||
480 | asmlinkage long compat_sys_nanosleep(struct compat_timespec __user *rqtp, | ||
481 | struct compat_timespec __user *rmtp); | ||
482 | asmlinkage long compat_sys_getitimer(int which, | ||
483 | struct compat_itimerval __user *it); | ||
484 | asmlinkage long compat_sys_setitimer(int which, | ||
485 | struct compat_itimerval __user *in, | ||
486 | struct compat_itimerval __user *out); | ||
487 | asmlinkage long compat_sys_times(struct compat_tms __user *tbuf); | ||
488 | asmlinkage long compat_sys_setrlimit(unsigned int resource, | ||
489 | struct compat_rlimit __user *rlim); | ||
490 | asmlinkage long compat_sys_getrlimit(unsigned int resource, | ||
491 | struct compat_rlimit __user *rlim); | ||
492 | asmlinkage long compat_sys_getrusage(int who, struct compat_rusage __user *ru); | ||
493 | asmlinkage long compat_sys_sched_setaffinity(compat_pid_t pid, | ||
494 | unsigned int len, | ||
495 | compat_ulong_t __user *user_mask_ptr); | ||
496 | asmlinkage long compat_sys_sched_getaffinity(compat_pid_t pid, | ||
497 | unsigned int len, | ||
498 | compat_ulong_t __user *user_mask_ptr); | ||
499 | asmlinkage long compat_sys_timer_create(clockid_t which_clock, | ||
500 | struct compat_sigevent __user *timer_event_spec, | ||
501 | timer_t __user *created_timer_id); | ||
502 | asmlinkage long compat_sys_timer_settime(timer_t timer_id, int flags, | ||
503 | struct compat_itimerspec __user *new, | ||
504 | struct compat_itimerspec __user *old); | ||
505 | asmlinkage long compat_sys_timer_gettime(timer_t timer_id, | ||
506 | struct compat_itimerspec __user *setting); | ||
507 | asmlinkage long compat_sys_clock_settime(clockid_t which_clock, | ||
508 | struct compat_timespec __user *tp); | ||
509 | asmlinkage long compat_sys_clock_gettime(clockid_t which_clock, | ||
510 | struct compat_timespec __user *tp); | ||
511 | asmlinkage long compat_sys_clock_adjtime(clockid_t which_clock, | ||
512 | struct compat_timex __user *tp); | ||
513 | asmlinkage long compat_sys_clock_getres(clockid_t which_clock, | ||
514 | struct compat_timespec __user *tp); | ||
515 | asmlinkage long compat_sys_clock_nanosleep(clockid_t which_clock, int flags, | ||
516 | struct compat_timespec __user *rqtp, | ||
517 | struct compat_timespec __user *rmtp); | ||
518 | asmlinkage long compat_sys_rt_sigtimedwait(compat_sigset_t __user *uthese, | ||
519 | struct compat_siginfo __user *uinfo, | ||
520 | struct compat_timespec __user *uts, compat_size_t sigsetsize); | ||
521 | asmlinkage long compat_sys_rt_sigsuspend(compat_sigset_t __user *unewset, | ||
522 | compat_size_t sigsetsize); | ||
523 | asmlinkage long compat_sys_sysinfo(struct compat_sysinfo __user *info); | ||
524 | asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, | ||
525 | unsigned long arg); | ||
526 | asmlinkage long compat_sys_futex(u32 __user *uaddr, int op, u32 val, | ||
527 | struct compat_timespec __user *utime, u32 __user *uaddr2, | ||
528 | u32 val3); | ||
529 | asmlinkage long compat_sys_getsockopt(int fd, int level, int optname, | ||
530 | char __user *optval, int __user *optlen); | ||
531 | asmlinkage long compat_sys_kexec_load(unsigned long entry, | ||
532 | unsigned long nr_segments, | ||
533 | struct compat_kexec_segment __user *, | ||
534 | unsigned long flags); | ||
535 | asmlinkage long compat_sys_mq_getsetattr(mqd_t mqdes, | ||
536 | const struct compat_mq_attr __user *u_mqstat, | ||
537 | struct compat_mq_attr __user *u_omqstat); | ||
538 | asmlinkage long compat_sys_mq_notify(mqd_t mqdes, | ||
539 | const struct compat_sigevent __user *u_notification); | ||
540 | asmlinkage long compat_sys_mq_open(const char __user *u_name, | ||
541 | int oflag, compat_mode_t mode, | ||
542 | struct compat_mq_attr __user *u_attr); | ||
543 | asmlinkage long compat_sys_mq_timedsend(mqd_t mqdes, | ||
544 | const char __user *u_msg_ptr, | ||
545 | size_t msg_len, unsigned int msg_prio, | ||
546 | const struct compat_timespec __user *u_abs_timeout); | ||
547 | asmlinkage ssize_t compat_sys_mq_timedreceive(mqd_t mqdes, | ||
548 | char __user *u_msg_ptr, | ||
549 | size_t msg_len, unsigned int __user *u_msg_prio, | ||
550 | const struct compat_timespec __user *u_abs_timeout); | ||
551 | asmlinkage long compat_sys_socketcall(int call, u32 __user *args); | ||
552 | asmlinkage long compat_sys_sysctl(struct compat_sysctl_args __user *args); | ||
358 | 553 | ||
359 | extern ssize_t compat_rw_copy_check_uvector(int type, | 554 | extern ssize_t compat_rw_copy_check_uvector(int type, |
360 | const struct compat_iovec __user *uvector, unsigned long nr_segs, | 555 | const struct compat_iovec __user *uvector, |
556 | unsigned long nr_segs, | ||
361 | unsigned long fast_segs, struct iovec *fast_pointer, | 557 | unsigned long fast_segs, struct iovec *fast_pointer, |
362 | struct iovec **ret_pointer); | 558 | struct iovec **ret_pointer); |
363 | 559 | ||
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index cb4c1eb7778e..59e4028e833d 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h | |||
@@ -34,8 +34,12 @@ | |||
34 | __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \ | 34 | __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \ |
35 | (typeof(ptr)) (__ptr + (off)); }) | 35 | (typeof(ptr)) (__ptr + (off)); }) |
36 | 36 | ||
37 | #ifdef __CHECKER__ | ||
38 | #define __must_be_array(arr) 0 | ||
39 | #else | ||
37 | /* &a[0] degrades to a pointer: a different type from an array */ | 40 | /* &a[0] degrades to a pointer: a different type from an array */ |
38 | #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) | 41 | #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) |
42 | #endif | ||
39 | 43 | ||
40 | /* | 44 | /* |
41 | * Force always-inline if the user requests it so via the .config, | 45 | * Force always-inline if the user requests it so via the .config, |
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index 64b7c003fd7a..dfadc96e9d63 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h | |||
@@ -51,7 +51,7 @@ | |||
51 | #if __GNUC_MINOR__ > 0 | 51 | #if __GNUC_MINOR__ > 0 |
52 | #define __compiletime_object_size(obj) __builtin_object_size(obj, 0) | 52 | #define __compiletime_object_size(obj) __builtin_object_size(obj, 0) |
53 | #endif | 53 | #endif |
54 | #if __GNUC_MINOR__ >= 4 | 54 | #if __GNUC_MINOR__ >= 4 && !defined(__CHECKER__) |
55 | #define __compiletime_warning(message) __attribute__((warning(message))) | 55 | #define __compiletime_warning(message) __attribute__((warning(message))) |
56 | #define __compiletime_error(message) __attribute__((error(message))) | 56 | #define __compiletime_error(message) __attribute__((error(message))) |
57 | #endif | 57 | #endif |
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index bae6fe24d1f9..b24ac56477b4 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -547,6 +547,21 @@ static inline int cpumask_parse_user(const char __user *buf, int len, | |||
547 | } | 547 | } |
548 | 548 | ||
549 | /** | 549 | /** |
550 | * cpumask_parselist_user - extract a cpumask from a user string | ||
551 | * @buf: the buffer to extract from | ||
552 | * @len: the length of the buffer | ||
553 | * @dstp: the cpumask to set. | ||
554 | * | ||
555 | * Returns -errno, or 0 for success. | ||
556 | */ | ||
557 | static inline int cpumask_parselist_user(const char __user *buf, int len, | ||
558 | struct cpumask *dstp) | ||
559 | { | ||
560 | return bitmap_parselist_user(buf, len, cpumask_bits(dstp), | ||
561 | nr_cpumask_bits); | ||
562 | } | ||
563 | |||
564 | /** | ||
550 | * cpulist_scnprintf - print a cpumask into a string as comma-separated list | 565 | * cpulist_scnprintf - print a cpumask into a string as comma-separated list |
551 | * @buf: the buffer to sprintf into | 566 | * @buf: the buffer to sprintf into |
552 | * @len: the length of the buffer | 567 | * @len: the length of the buffer |
diff --git a/include/linux/drbd.h b/include/linux/drbd.h index cec467f5d676..9e5f5607eba3 100644 --- a/include/linux/drbd.h +++ b/include/linux/drbd.h | |||
@@ -38,7 +38,7 @@ | |||
38 | 38 | ||
39 | /* Although the Linux source code makes a difference between | 39 | /* Although the Linux source code makes a difference between |
40 | generic endianness and the bitfields' endianness, there is no | 40 | generic endianness and the bitfields' endianness, there is no |
41 | architecture as of Linux-2.6.24-rc4 where the bitfileds' endianness | 41 | architecture as of Linux-2.6.24-rc4 where the bitfields' endianness |
42 | does not match the generic endianness. */ | 42 | does not match the generic endianness. */ |
43 | 43 | ||
44 | #if __BYTE_ORDER == __LITTLE_ENDIAN | 44 | #if __BYTE_ORDER == __LITTLE_ENDIAN |
@@ -53,7 +53,7 @@ | |||
53 | 53 | ||
54 | 54 | ||
55 | extern const char *drbd_buildtag(void); | 55 | extern const char *drbd_buildtag(void); |
56 | #define REL_VERSION "8.3.10" | 56 | #define REL_VERSION "8.3.11" |
57 | #define API_VERSION 88 | 57 | #define API_VERSION 88 |
58 | #define PRO_VERSION_MIN 86 | 58 | #define PRO_VERSION_MIN 86 |
59 | #define PRO_VERSION_MAX 96 | 59 | #define PRO_VERSION_MAX 96 |
@@ -195,7 +195,7 @@ enum drbd_conns { | |||
195 | C_WF_REPORT_PARAMS, /* we have a socket */ | 195 | C_WF_REPORT_PARAMS, /* we have a socket */ |
196 | C_CONNECTED, /* we have introduced each other */ | 196 | C_CONNECTED, /* we have introduced each other */ |
197 | C_STARTING_SYNC_S, /* starting full sync by admin request. */ | 197 | C_STARTING_SYNC_S, /* starting full sync by admin request. */ |
198 | C_STARTING_SYNC_T, /* stariing full sync by admin request. */ | 198 | C_STARTING_SYNC_T, /* starting full sync by admin request. */ |
199 | C_WF_BITMAP_S, | 199 | C_WF_BITMAP_S, |
200 | C_WF_BITMAP_T, | 200 | C_WF_BITMAP_T, |
201 | C_WF_SYNC_UUID, | 201 | C_WF_SYNC_UUID, |
@@ -236,7 +236,7 @@ union drbd_state { | |||
236 | * pointed out by Maxim Uvarov q<muvarov@ru.mvista.com> | 236 | * pointed out by Maxim Uvarov q<muvarov@ru.mvista.com> |
237 | * even though we transmit as "cpu_to_be32(state)", | 237 | * even though we transmit as "cpu_to_be32(state)", |
238 | * the offsets of the bitfields still need to be swapped | 238 | * the offsets of the bitfields still need to be swapped |
239 | * on different endianess. | 239 | * on different endianness. |
240 | */ | 240 | */ |
241 | struct { | 241 | struct { |
242 | #if defined(__LITTLE_ENDIAN_BITFIELD) | 242 | #if defined(__LITTLE_ENDIAN_BITFIELD) |
@@ -266,7 +266,7 @@ union drbd_state { | |||
266 | unsigned peer:2 ; /* 3/4 primary/secondary/unknown */ | 266 | unsigned peer:2 ; /* 3/4 primary/secondary/unknown */ |
267 | unsigned role:2 ; /* 3/4 primary/secondary/unknown */ | 267 | unsigned role:2 ; /* 3/4 primary/secondary/unknown */ |
268 | #else | 268 | #else |
269 | # error "this endianess is not supported" | 269 | # error "this endianness is not supported" |
270 | #endif | 270 | #endif |
271 | }; | 271 | }; |
272 | unsigned int i; | 272 | unsigned int i; |
diff --git a/include/linux/drbd_tag_magic.h b/include/linux/drbd_tag_magic.h index f14a165e82dc..069543190516 100644 --- a/include/linux/drbd_tag_magic.h +++ b/include/linux/drbd_tag_magic.h | |||
@@ -30,7 +30,7 @@ enum packet_types { | |||
30 | int tag_and_len ## member; | 30 | int tag_and_len ## member; |
31 | #include "linux/drbd_nl.h" | 31 | #include "linux/drbd_nl.h" |
32 | 32 | ||
33 | /* declate tag-list-sizes */ | 33 | /* declare tag-list-sizes */ |
34 | static const int tag_list_sizes[] = { | 34 | static const int tag_list_sizes[] = { |
35 | #define NL_PACKET(name, number, fields) 2 fields , | 35 | #define NL_PACKET(name, number, fields) 2 fields , |
36 | #define NL_INTEGER(pn, pr, member) + 4 + 4 | 36 | #define NL_INTEGER(pn, pr, member) + 4 + 4 |
diff --git a/include/linux/fs.h b/include/linux/fs.h index cdf9495df204..3f9d3251790d 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -23,7 +23,8 @@ | |||
23 | 23 | ||
24 | /* Fixed constants first: */ | 24 | /* Fixed constants first: */ |
25 | #undef NR_OPEN | 25 | #undef NR_OPEN |
26 | #define INR_OPEN 1024 /* Initial setting for nfile rlimits */ | 26 | #define INR_OPEN_CUR 1024 /* Initial setting for nfile rlimits */ |
27 | #define INR_OPEN_MAX 4096 /* Hard limit for nfile rlimits */ | ||
27 | 28 | ||
28 | #define BLOCK_SIZE_BITS 10 | 29 | #define BLOCK_SIZE_BITS 10 |
29 | #define BLOCK_SIZE (1<<BLOCK_SIZE_BITS) | 30 | #define BLOCK_SIZE (1<<BLOCK_SIZE_BITS) |
@@ -634,8 +635,7 @@ struct address_space { | |||
634 | unsigned int i_mmap_writable;/* count VM_SHARED mappings */ | 635 | unsigned int i_mmap_writable;/* count VM_SHARED mappings */ |
635 | struct prio_tree_root i_mmap; /* tree of private and shared mappings */ | 636 | struct prio_tree_root i_mmap; /* tree of private and shared mappings */ |
636 | struct list_head i_mmap_nonlinear;/*list VM_NONLINEAR mappings */ | 637 | struct list_head i_mmap_nonlinear;/*list VM_NONLINEAR mappings */ |
637 | spinlock_t i_mmap_lock; /* protect tree, count, list */ | 638 | struct mutex i_mmap_mutex; /* protect tree, count, list */ |
638 | unsigned int truncate_count; /* Cover race condition with truncate */ | ||
639 | unsigned long nrpages; /* number of total pages */ | 639 | unsigned long nrpages; /* number of total pages */ |
640 | pgoff_t writeback_index;/* writeback starts here */ | 640 | pgoff_t writeback_index;/* writeback starts here */ |
641 | const struct address_space_operations *a_ops; /* methods */ | 641 | const struct address_space_operations *a_ops; /* methods */ |
@@ -644,7 +644,6 @@ struct address_space { | |||
644 | spinlock_t private_lock; /* for use by the address_space */ | 644 | spinlock_t private_lock; /* for use by the address_space */ |
645 | struct list_head private_list; /* ditto */ | 645 | struct list_head private_list; /* ditto */ |
646 | struct address_space *assoc_mapping; /* ditto */ | 646 | struct address_space *assoc_mapping; /* ditto */ |
647 | struct mutex unmap_mutex; /* to protect unmapping */ | ||
648 | } __attribute__((aligned(sizeof(long)))); | 647 | } __attribute__((aligned(sizeof(long)))); |
649 | /* | 648 | /* |
650 | * On most architectures that alignment is already the case; but | 649 | * On most architectures that alignment is already the case; but |
diff --git a/include/linux/fscache-cache.h b/include/linux/fscache-cache.h index 76427e688d15..af095b54502e 100644 --- a/include/linux/fscache-cache.h +++ b/include/linux/fscache-cache.h | |||
@@ -100,17 +100,6 @@ struct fscache_operation { | |||
100 | 100 | ||
101 | /* operation releaser */ | 101 | /* operation releaser */ |
102 | fscache_operation_release_t release; | 102 | fscache_operation_release_t release; |
103 | |||
104 | #ifdef CONFIG_WORKQUEUE_DEBUGFS | ||
105 | struct work_struct put_work; /* work to delay operation put */ | ||
106 | const char *name; /* operation name */ | ||
107 | const char *state; /* operation state */ | ||
108 | #define fscache_set_op_name(OP, N) do { (OP)->name = (N); } while(0) | ||
109 | #define fscache_set_op_state(OP, S) do { (OP)->state = (S); } while(0) | ||
110 | #else | ||
111 | #define fscache_set_op_name(OP, N) do { } while(0) | ||
112 | #define fscache_set_op_state(OP, S) do { } while(0) | ||
113 | #endif | ||
114 | }; | 103 | }; |
115 | 104 | ||
116 | extern atomic_t fscache_op_debug_id; | 105 | extern atomic_t fscache_op_debug_id; |
@@ -137,7 +126,6 @@ static inline void fscache_operation_init(struct fscache_operation *op, | |||
137 | op->processor = processor; | 126 | op->processor = processor; |
138 | op->release = release; | 127 | op->release = release; |
139 | INIT_LIST_HEAD(&op->pend_link); | 128 | INIT_LIST_HEAD(&op->pend_link); |
140 | fscache_set_op_state(op, "Init"); | ||
141 | } | 129 | } |
142 | 130 | ||
143 | /* | 131 | /* |
diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h index 9869ef3674ac..5bbebda78b02 100644 --- a/include/linux/genalloc.h +++ b/include/linux/genalloc.h | |||
@@ -9,6 +9,8 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | 11 | ||
12 | #ifndef __GENALLOC_H__ | ||
13 | #define __GENALLOC_H__ | ||
12 | /* | 14 | /* |
13 | * General purpose special memory pool descriptor. | 15 | * General purpose special memory pool descriptor. |
14 | */ | 16 | */ |
@@ -24,13 +26,34 @@ struct gen_pool { | |||
24 | struct gen_pool_chunk { | 26 | struct gen_pool_chunk { |
25 | spinlock_t lock; | 27 | spinlock_t lock; |
26 | struct list_head next_chunk; /* next chunk in pool */ | 28 | struct list_head next_chunk; /* next chunk in pool */ |
29 | phys_addr_t phys_addr; /* physical starting address of memory chunk */ | ||
27 | unsigned long start_addr; /* starting address of memory chunk */ | 30 | unsigned long start_addr; /* starting address of memory chunk */ |
28 | unsigned long end_addr; /* ending address of memory chunk */ | 31 | unsigned long end_addr; /* ending address of memory chunk */ |
29 | unsigned long bits[0]; /* bitmap for allocating memory chunk */ | 32 | unsigned long bits[0]; /* bitmap for allocating memory chunk */ |
30 | }; | 33 | }; |
31 | 34 | ||
32 | extern struct gen_pool *gen_pool_create(int, int); | 35 | extern struct gen_pool *gen_pool_create(int, int); |
33 | extern int gen_pool_add(struct gen_pool *, unsigned long, size_t, int); | 36 | extern phys_addr_t gen_pool_virt_to_phys(struct gen_pool *pool, unsigned long); |
37 | extern int gen_pool_add_virt(struct gen_pool *, unsigned long, phys_addr_t, | ||
38 | size_t, int); | ||
39 | /** | ||
40 | * gen_pool_add - add a new chunk of special memory to the pool | ||
41 | * @pool: pool to add new memory chunk to | ||
42 | * @addr: starting address of memory chunk to add to pool | ||
43 | * @size: size in bytes of the memory chunk to add to pool | ||
44 | * @nid: node id of the node the chunk structure and bitmap should be | ||
45 | * allocated on, or -1 | ||
46 | * | ||
47 | * Add a new chunk of special memory to the specified pool. | ||
48 | * | ||
49 | * Returns 0 on success or a -ve errno on failure. | ||
50 | */ | ||
51 | static inline int gen_pool_add(struct gen_pool *pool, unsigned long addr, | ||
52 | size_t size, int nid) | ||
53 | { | ||
54 | return gen_pool_add_virt(pool, addr, -1, size, nid); | ||
55 | } | ||
34 | extern void gen_pool_destroy(struct gen_pool *); | 56 | extern void gen_pool_destroy(struct gen_pool *); |
35 | extern unsigned long gen_pool_alloc(struct gen_pool *, size_t); | 57 | extern unsigned long gen_pool_alloc(struct gen_pool *, size_t); |
36 | extern void gen_pool_free(struct gen_pool *, unsigned long, size_t); | 58 | extern void gen_pool_free(struct gen_pool *, unsigned long, size_t); |
59 | #endif /* __GENALLOC_H__ */ | ||
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index d764a426e9fd..b78956b3c2e7 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -100,7 +100,6 @@ struct hd_struct { | |||
100 | sector_t start_sect; | 100 | sector_t start_sect; |
101 | sector_t nr_sects; | 101 | sector_t nr_sects; |
102 | sector_t alignment_offset; | 102 | sector_t alignment_offset; |
103 | unsigned int discard_alignment; | ||
104 | struct device __dev; | 103 | struct device __dev; |
105 | struct kobject *holder_dir; | 104 | struct kobject *holder_dir; |
106 | int policy, partno; | 105 | int policy, partno; |
@@ -127,6 +126,7 @@ struct hd_struct { | |||
127 | #define GENHD_FL_SUPPRESS_PARTITION_INFO 32 | 126 | #define GENHD_FL_SUPPRESS_PARTITION_INFO 32 |
128 | #define GENHD_FL_EXT_DEVT 64 /* allow extended devt */ | 127 | #define GENHD_FL_EXT_DEVT 64 /* allow extended devt */ |
129 | #define GENHD_FL_NATIVE_CAPACITY 128 | 128 | #define GENHD_FL_NATIVE_CAPACITY 128 |
129 | #define GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE 256 | ||
130 | 130 | ||
131 | enum { | 131 | enum { |
132 | DISK_EVENT_MEDIA_CHANGE = 1 << 0, /* media changed */ | 132 | DISK_EVENT_MEDIA_CHANGE = 1 << 0, /* media changed */ |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 56d8fc87fbbc..cb4089254f01 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -249,14 +249,7 @@ static inline enum zone_type gfp_zone(gfp_t flags) | |||
249 | 249 | ||
250 | z = (GFP_ZONE_TABLE >> (bit * ZONES_SHIFT)) & | 250 | z = (GFP_ZONE_TABLE >> (bit * ZONES_SHIFT)) & |
251 | ((1 << ZONES_SHIFT) - 1); | 251 | ((1 << ZONES_SHIFT) - 1); |
252 | 252 | VM_BUG_ON((GFP_ZONE_BAD >> bit) & 1); | |
253 | if (__builtin_constant_p(bit)) | ||
254 | BUILD_BUG_ON((GFP_ZONE_BAD >> bit) & 1); | ||
255 | else { | ||
256 | #ifdef CONFIG_DEBUG_VM | ||
257 | BUG_ON((GFP_ZONE_BAD >> bit) & 1); | ||
258 | #endif | ||
259 | } | ||
260 | return z; | 253 | return z; |
261 | } | 254 | } |
262 | 255 | ||
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index 8847c8c29791..48c32ebf65a7 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h | |||
@@ -92,12 +92,8 @@ extern void __split_huge_page_pmd(struct mm_struct *mm, pmd_t *pmd); | |||
92 | #define wait_split_huge_page(__anon_vma, __pmd) \ | 92 | #define wait_split_huge_page(__anon_vma, __pmd) \ |
93 | do { \ | 93 | do { \ |
94 | pmd_t *____pmd = (__pmd); \ | 94 | pmd_t *____pmd = (__pmd); \ |
95 | spin_unlock_wait(&(__anon_vma)->root->lock); \ | 95 | anon_vma_lock(__anon_vma); \ |
96 | /* \ | 96 | anon_vma_unlock(__anon_vma); \ |
97 | * spin_unlock_wait() is just a loop in C and so the \ | ||
98 | * CPU can reorder anything around it. \ | ||
99 | */ \ | ||
100 | smp_mb(); \ | ||
101 | BUG_ON(pmd_trans_splitting(*____pmd) || \ | 97 | BUG_ON(pmd_trans_splitting(*____pmd) || \ |
102 | pmd_trans_huge(*____pmd)); \ | 98 | pmd_trans_huge(*____pmd)); \ |
103 | } while (0) | 99 | } while (0) |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index f1e3ff5880a9..a6c652ef516d 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -409,7 +409,7 @@ void i2c_unlock_adapter(struct i2c_adapter *); | |||
409 | /* i2c adapter classes (bitmask) */ | 409 | /* i2c adapter classes (bitmask) */ |
410 | #define I2C_CLASS_HWMON (1<<0) /* lm_sensors, ... */ | 410 | #define I2C_CLASS_HWMON (1<<0) /* lm_sensors, ... */ |
411 | #define I2C_CLASS_DDC (1<<3) /* DDC bus on graphics adapters */ | 411 | #define I2C_CLASS_DDC (1<<3) /* DDC bus on graphics adapters */ |
412 | #define I2C_CLASS_SPD (1<<7) /* SPD EEPROMs and similar */ | 412 | #define I2C_CLASS_SPD (1<<7) /* Memory modules */ |
413 | 413 | ||
414 | /* Internal numbers to terminate lists */ | 414 | /* Internal numbers to terminate lists */ |
415 | #define I2C_CLIENT_END 0xfffeU | 415 | #define I2C_CLIENT_END 0xfffeU |
diff --git a/include/linux/i2c/i2c-sh_mobile.h b/include/linux/i2c/i2c-sh_mobile.h new file mode 100644 index 000000000000..beda7081aead --- /dev/null +++ b/include/linux/i2c/i2c-sh_mobile.h | |||
@@ -0,0 +1,10 @@ | |||
1 | #ifndef __I2C_SH_MOBILE_H__ | ||
2 | #define __I2C_SH_MOBILE_H__ | ||
3 | |||
4 | #include <linux/platform_device.h> | ||
5 | |||
6 | struct i2c_sh_mobile_platform_data { | ||
7 | unsigned long bus_speed; | ||
8 | }; | ||
9 | |||
10 | #endif /* __I2C_SH_MOBILE_H__ */ | ||
diff --git a/include/linux/if_link.h b/include/linux/if_link.h index f4a2e6b1b864..0ee969a5593d 100644 --- a/include/linux/if_link.h +++ b/include/linux/if_link.h | |||
@@ -136,6 +136,7 @@ enum { | |||
136 | IFLA_PORT_SELF, | 136 | IFLA_PORT_SELF, |
137 | IFLA_AF_SPEC, | 137 | IFLA_AF_SPEC, |
138 | IFLA_GROUP, /* Group the device belongs to */ | 138 | IFLA_GROUP, /* Group the device belongs to */ |
139 | IFLA_NET_NS_FD, | ||
139 | __IFLA_MAX | 140 | __IFLA_MAX |
140 | }; | 141 | }; |
141 | 142 | ||
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 290bd8ac94cf..dc01681fbb42 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
@@ -110,6 +110,11 @@ static inline void vlan_group_set_device(struct vlan_group *vg, | |||
110 | array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] = dev; | 110 | array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] = dev; |
111 | } | 111 | } |
112 | 112 | ||
113 | static inline int is_vlan_dev(struct net_device *dev) | ||
114 | { | ||
115 | return dev->priv_flags & IFF_802_1Q_VLAN; | ||
116 | } | ||
117 | |||
113 | #define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT) | 118 | #define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT) |
114 | #define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) | 119 | #define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) |
115 | 120 | ||
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index f37ba716ef8b..fb0e7329fee1 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -248,6 +248,37 @@ int __must_check kstrtos16(const char *s, unsigned int base, s16 *res); | |||
248 | int __must_check kstrtou8(const char *s, unsigned int base, u8 *res); | 248 | int __must_check kstrtou8(const char *s, unsigned int base, u8 *res); |
249 | int __must_check kstrtos8(const char *s, unsigned int base, s8 *res); | 249 | int __must_check kstrtos8(const char *s, unsigned int base, s8 *res); |
250 | 250 | ||
251 | int __must_check kstrtoull_from_user(const char __user *s, size_t count, unsigned int base, unsigned long long *res); | ||
252 | int __must_check kstrtoll_from_user(const char __user *s, size_t count, unsigned int base, long long *res); | ||
253 | int __must_check kstrtoul_from_user(const char __user *s, size_t count, unsigned int base, unsigned long *res); | ||
254 | int __must_check kstrtol_from_user(const char __user *s, size_t count, unsigned int base, long *res); | ||
255 | int __must_check kstrtouint_from_user(const char __user *s, size_t count, unsigned int base, unsigned int *res); | ||
256 | int __must_check kstrtoint_from_user(const char __user *s, size_t count, unsigned int base, int *res); | ||
257 | int __must_check kstrtou16_from_user(const char __user *s, size_t count, unsigned int base, u16 *res); | ||
258 | int __must_check kstrtos16_from_user(const char __user *s, size_t count, unsigned int base, s16 *res); | ||
259 | int __must_check kstrtou8_from_user(const char __user *s, size_t count, unsigned int base, u8 *res); | ||
260 | int __must_check kstrtos8_from_user(const char __user *s, size_t count, unsigned int base, s8 *res); | ||
261 | |||
262 | static inline int __must_check kstrtou64_from_user(const char __user *s, size_t count, unsigned int base, u64 *res) | ||
263 | { | ||
264 | return kstrtoull_from_user(s, count, base, res); | ||
265 | } | ||
266 | |||
267 | static inline int __must_check kstrtos64_from_user(const char __user *s, size_t count, unsigned int base, s64 *res) | ||
268 | { | ||
269 | return kstrtoll_from_user(s, count, base, res); | ||
270 | } | ||
271 | |||
272 | static inline int __must_check kstrtou32_from_user(const char __user *s, size_t count, unsigned int base, u32 *res) | ||
273 | { | ||
274 | return kstrtouint_from_user(s, count, base, res); | ||
275 | } | ||
276 | |||
277 | static inline int __must_check kstrtos32_from_user(const char __user *s, size_t count, unsigned int base, s32 *res) | ||
278 | { | ||
279 | return kstrtoint_from_user(s, count, base, res); | ||
280 | } | ||
281 | |||
251 | extern unsigned long simple_strtoul(const char *,char **,unsigned int); | 282 | extern unsigned long simple_strtoul(const char *,char **,unsigned int); |
252 | extern long simple_strtol(const char *,char **,unsigned int); | 283 | extern long simple_strtol(const char *,char **,unsigned int); |
253 | extern unsigned long long simple_strtoull(const char *,char **,unsigned int); | 284 | extern unsigned long long simple_strtoull(const char *,char **,unsigned int); |
@@ -638,6 +669,13 @@ struct sysinfo { | |||
638 | char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */ | 669 | char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */ |
639 | }; | 670 | }; |
640 | 671 | ||
672 | #ifdef __CHECKER__ | ||
673 | #define BUILD_BUG_ON_NOT_POWER_OF_2(n) | ||
674 | #define BUILD_BUG_ON_ZERO(e) | ||
675 | #define BUILD_BUG_ON_NULL(e) | ||
676 | #define BUILD_BUG_ON(condition) | ||
677 | #else /* __CHECKER__ */ | ||
678 | |||
641 | /* Force a compilation error if a constant expression is not a power of 2 */ | 679 | /* Force a compilation error if a constant expression is not a power of 2 */ |
642 | #define BUILD_BUG_ON_NOT_POWER_OF_2(n) \ | 680 | #define BUILD_BUG_ON_NOT_POWER_OF_2(n) \ |
643 | BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0)) | 681 | BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0)) |
@@ -674,6 +712,7 @@ extern int __build_bug_on_failed; | |||
674 | if (condition) __build_bug_on_failed = 1; \ | 712 | if (condition) __build_bug_on_failed = 1; \ |
675 | } while(0) | 713 | } while(0) |
676 | #endif | 714 | #endif |
715 | #endif /* __CHECKER__ */ | ||
677 | 716 | ||
678 | /* Trap pasters of __FUNCTION__ at compile-time */ | 717 | /* Trap pasters of __FUNCTION__ at compile-time */ |
679 | #define __FUNCTION__ (__func__) | 718 | #define __FUNCTION__ (__func__) |
diff --git a/include/linux/leds-pca9532.h b/include/linux/leds-pca9532.h index f158eb1149aa..b8d6fffed4d8 100644 --- a/include/linux/leds-pca9532.h +++ b/include/linux/leds-pca9532.h | |||
@@ -25,7 +25,7 @@ enum pca9532_state { | |||
25 | }; | 25 | }; |
26 | 26 | ||
27 | enum pca9532_type { PCA9532_TYPE_NONE, PCA9532_TYPE_LED, | 27 | enum pca9532_type { PCA9532_TYPE_NONE, PCA9532_TYPE_LED, |
28 | PCA9532_TYPE_N2100_BEEP }; | 28 | PCA9532_TYPE_N2100_BEEP, PCA9532_TYPE_GPIO }; |
29 | 29 | ||
30 | struct pca9532_led { | 30 | struct pca9532_led { |
31 | u8 id; | 31 | u8 id; |
@@ -41,6 +41,7 @@ struct pca9532_platform_data { | |||
41 | struct pca9532_led leds[16]; | 41 | struct pca9532_led leds[16]; |
42 | u8 pwm[2]; | 42 | u8 pwm[2]; |
43 | u8 psc[2]; | 43 | u8 psc[2]; |
44 | int gpio_base; | ||
44 | }; | 45 | }; |
45 | 46 | ||
46 | #endif /* __LINUX_PCA9532_H */ | 47 | #endif /* __LINUX_PCA9532_H */ |
diff --git a/include/linux/leds.h b/include/linux/leds.h index 61e0340a4b77..5884def15a24 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h | |||
@@ -207,5 +207,7 @@ struct gpio_led_platform_data { | |||
207 | unsigned long *delay_off); | 207 | unsigned long *delay_off); |
208 | }; | 208 | }; |
209 | 209 | ||
210 | struct platform_device *gpio_led_register_device( | ||
211 | int id, const struct gpio_led_platform_data *pdata); | ||
210 | 212 | ||
211 | #endif /* __LINUX_LEDS_H_INCLUDED */ | 213 | #endif /* __LINUX_LEDS_H_INCLUDED */ |
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index 4aef1dda6406..ef820a3c378b 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h | |||
@@ -487,12 +487,15 @@ static inline void print_irqtrace_events(struct task_struct *curr) | |||
487 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 487 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
488 | # ifdef CONFIG_PROVE_LOCKING | 488 | # ifdef CONFIG_PROVE_LOCKING |
489 | # define mutex_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, NULL, i) | 489 | # define mutex_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, NULL, i) |
490 | # define mutex_acquire_nest(l, s, t, n, i) lock_acquire(l, s, t, 0, 2, n, i) | ||
490 | # else | 491 | # else |
491 | # define mutex_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, NULL, i) | 492 | # define mutex_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, NULL, i) |
493 | # define mutex_acquire_nest(l, s, t, n, i) lock_acquire(l, s, t, 0, 1, n, i) | ||
492 | # endif | 494 | # endif |
493 | # define mutex_release(l, n, i) lock_release(l, n, i) | 495 | # define mutex_release(l, n, i) lock_release(l, n, i) |
494 | #else | 496 | #else |
495 | # define mutex_acquire(l, s, t, i) do { } while (0) | 497 | # define mutex_acquire(l, s, t, i) do { } while (0) |
498 | # define mutex_acquire_nest(l, s, t, n, i) do { } while (0) | ||
496 | # define mutex_release(l, n, i) do { } while (0) | 499 | # define mutex_release(l, n, i) do { } while (0) |
497 | #endif | 500 | #endif |
498 | 501 | ||
diff --git a/include/linux/lru_cache.h b/include/linux/lru_cache.h index 6a4fab7c6e09..7a71ffad037c 100644 --- a/include/linux/lru_cache.h +++ b/include/linux/lru_cache.h | |||
@@ -139,9 +139,9 @@ write intent log information, three of which are mentioned here. | |||
139 | * .list is on one of three lists: | 139 | * .list is on one of three lists: |
140 | * in_use: currently in use (refcnt > 0, lc_number != LC_FREE) | 140 | * in_use: currently in use (refcnt > 0, lc_number != LC_FREE) |
141 | * lru: unused but ready to be reused or recycled | 141 | * lru: unused but ready to be reused or recycled |
142 | * (ts_refcnt == 0, lc_number != LC_FREE), | 142 | * (lc_refcnt == 0, lc_number != LC_FREE), |
143 | * free: unused but ready to be recycled | 143 | * free: unused but ready to be recycled |
144 | * (ts_refcnt == 0, lc_number == LC_FREE), | 144 | * (lc_refcnt == 0, lc_number == LC_FREE), |
145 | * | 145 | * |
146 | * an element is said to be "in the active set", | 146 | * an element is said to be "in the active set", |
147 | * if either on "in_use" or "lru", i.e. lc_number != LC_FREE. | 147 | * if either on "in_use" or "lru", i.e. lc_number != LC_FREE. |
@@ -160,8 +160,8 @@ struct lc_element { | |||
160 | struct hlist_node colision; | 160 | struct hlist_node colision; |
161 | struct list_head list; /* LRU list or free list */ | 161 | struct list_head list; /* LRU list or free list */ |
162 | unsigned refcnt; | 162 | unsigned refcnt; |
163 | /* back "pointer" into ts_cache->element[index], | 163 | /* back "pointer" into lc_cache->element[index], |
164 | * for paranoia, and for "ts_element_to_index" */ | 164 | * for paranoia, and for "lc_element_to_index" */ |
165 | unsigned lc_index; | 165 | unsigned lc_index; |
166 | /* if we want to track a larger set of objects, | 166 | /* if we want to track a larger set of objects, |
167 | * it needs to become arch independend u64 */ | 167 | * it needs to become arch independend u64 */ |
@@ -190,8 +190,8 @@ struct lru_cache { | |||
190 | /* Arbitrary limit on maximum tracked objects. Practical limit is much | 190 | /* Arbitrary limit on maximum tracked objects. Practical limit is much |
191 | * lower due to allocation failures, probably. For typical use cases, | 191 | * lower due to allocation failures, probably. For typical use cases, |
192 | * nr_elements should be a few thousand at most. | 192 | * nr_elements should be a few thousand at most. |
193 | * This also limits the maximum value of ts_element.ts_index, allowing the | 193 | * This also limits the maximum value of lc_element.lc_index, allowing the |
194 | * 8 high bits of .ts_index to be overloaded with flags in the future. */ | 194 | * 8 high bits of .lc_index to be overloaded with flags in the future. */ |
195 | #define LC_MAX_ACTIVE (1<<24) | 195 | #define LC_MAX_ACTIVE (1<<24) |
196 | 196 | ||
197 | /* statistics */ | 197 | /* statistics */ |
diff --git a/include/linux/memblock.h b/include/linux/memblock.h index 62a10c2a11f2..7525e38c434d 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h | |||
@@ -2,6 +2,8 @@ | |||
2 | #define _LINUX_MEMBLOCK_H | 2 | #define _LINUX_MEMBLOCK_H |
3 | #ifdef __KERNEL__ | 3 | #ifdef __KERNEL__ |
4 | 4 | ||
5 | #define MEMBLOCK_ERROR 0 | ||
6 | |||
5 | #ifdef CONFIG_HAVE_MEMBLOCK | 7 | #ifdef CONFIG_HAVE_MEMBLOCK |
6 | /* | 8 | /* |
7 | * Logical memory blocks. | 9 | * Logical memory blocks. |
@@ -20,7 +22,6 @@ | |||
20 | #include <asm/memblock.h> | 22 | #include <asm/memblock.h> |
21 | 23 | ||
22 | #define INIT_MEMBLOCK_REGIONS 128 | 24 | #define INIT_MEMBLOCK_REGIONS 128 |
23 | #define MEMBLOCK_ERROR 0 | ||
24 | 25 | ||
25 | struct memblock_region { | 26 | struct memblock_region { |
26 | phys_addr_t base; | 27 | phys_addr_t base; |
@@ -160,6 +161,12 @@ static inline unsigned long memblock_region_reserved_end_pfn(const struct memblo | |||
160 | #define __initdata_memblock | 161 | #define __initdata_memblock |
161 | #endif | 162 | #endif |
162 | 163 | ||
164 | #else | ||
165 | static inline phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align) | ||
166 | { | ||
167 | return MEMBLOCK_ERROR; | ||
168 | } | ||
169 | |||
163 | #endif /* CONFIG_HAVE_MEMBLOCK */ | 170 | #endif /* CONFIG_HAVE_MEMBLOCK */ |
164 | 171 | ||
165 | #endif /* __KERNEL__ */ | 172 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index 31ac26ca4acf..7978eec1b7d9 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h | |||
@@ -199,6 +199,9 @@ void mpol_free_shared_policy(struct shared_policy *p); | |||
199 | struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp, | 199 | struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp, |
200 | unsigned long idx); | 200 | unsigned long idx); |
201 | 201 | ||
202 | struct mempolicy *get_vma_policy(struct task_struct *tsk, | ||
203 | struct vm_area_struct *vma, unsigned long addr); | ||
204 | |||
202 | extern void numa_default_policy(void); | 205 | extern void numa_default_policy(void); |
203 | extern void numa_policy_init(void); | 206 | extern void numa_policy_init(void); |
204 | extern void mpol_rebind_task(struct task_struct *tsk, const nodemask_t *new, | 207 | extern void mpol_rebind_task(struct task_struct *tsk, const nodemask_t *new, |
@@ -228,10 +231,10 @@ int do_migrate_pages(struct mm_struct *mm, | |||
228 | 231 | ||
229 | #ifdef CONFIG_TMPFS | 232 | #ifdef CONFIG_TMPFS |
230 | extern int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context); | 233 | extern int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context); |
234 | #endif | ||
231 | 235 | ||
232 | extern int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, | 236 | extern int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, |
233 | int no_context); | 237 | int no_context); |
234 | #endif | ||
235 | 238 | ||
236 | /* Check if a vma is migratable */ | 239 | /* Check if a vma is migratable */ |
237 | static inline int vma_migratable(struct vm_area_struct *vma) | 240 | static inline int vma_migratable(struct vm_area_struct *vma) |
@@ -368,13 +371,13 @@ static inline int mpol_parse_str(char *str, struct mempolicy **mpol, | |||
368 | { | 371 | { |
369 | return 1; /* error */ | 372 | return 1; /* error */ |
370 | } | 373 | } |
374 | #endif | ||
371 | 375 | ||
372 | static inline int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, | 376 | static inline int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, |
373 | int no_context) | 377 | int no_context) |
374 | { | 378 | { |
375 | return 0; | 379 | return 0; |
376 | } | 380 | } |
377 | #endif | ||
378 | 381 | ||
379 | #endif /* CONFIG_NUMA */ | 382 | #endif /* CONFIG_NUMA */ |
380 | #endif /* __KERNEL__ */ | 383 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/mfd/db5500-prcmu.h b/include/linux/mfd/db5500-prcmu.h new file mode 100644 index 000000000000..f0977986402c --- /dev/null +++ b/include/linux/mfd/db5500-prcmu.h | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * License Terms: GNU General Public License v2 | ||
5 | * | ||
6 | * U5500 PRCMU API. | ||
7 | */ | ||
8 | #ifndef __MACH_PRCMU_U5500_H | ||
9 | #define __MACH_PRCMU_U5500_H | ||
10 | |||
11 | #ifdef CONFIG_UX500_SOC_DB5500 | ||
12 | |||
13 | void db5500_prcmu_early_init(void); | ||
14 | |||
15 | int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size); | ||
16 | int db5500_prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size); | ||
17 | |||
18 | #else /* !CONFIG_UX500_SOC_DB5500 */ | ||
19 | |||
20 | static inline void db5500_prcmu_early_init(void) | ||
21 | { | ||
22 | } | ||
23 | |||
24 | static inline int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size) | ||
25 | { | ||
26 | return -ENOSYS; | ||
27 | } | ||
28 | |||
29 | static inline int db5500_prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size) | ||
30 | { | ||
31 | return -ENOSYS; | ||
32 | } | ||
33 | |||
34 | #endif /* CONFIG_UX500_SOC_DB5500 */ | ||
35 | |||
36 | static inline int db5500_prcmu_config_abb_event_readout(u32 abb_events) | ||
37 | { | ||
38 | #ifdef CONFIG_MACH_U5500_SIMULATOR | ||
39 | return 0; | ||
40 | #else | ||
41 | return -1; | ||
42 | #endif | ||
43 | } | ||
44 | |||
45 | #endif /* __MACH_PRCMU_U5500_H */ | ||
diff --git a/include/linux/mfd/db8500-prcmu.h b/include/linux/mfd/db8500-prcmu.h new file mode 100644 index 000000000000..917dbcab701c --- /dev/null +++ b/include/linux/mfd/db8500-prcmu.h | |||
@@ -0,0 +1,978 @@ | |||
1 | /* | ||
2 | * Copyright (C) STMicroelectronics 2009 | ||
3 | * Copyright (C) ST-Ericsson SA 2010 | ||
4 | * | ||
5 | * License Terms: GNU General Public License v2 | ||
6 | * Author: Kumar Sanghvi <kumar.sanghvi@stericsson.com> | ||
7 | * | ||
8 | * PRCMU f/w APIs | ||
9 | */ | ||
10 | #ifndef __MFD_DB8500_PRCMU_H | ||
11 | #define __MFD_DB8500_PRCMU_H | ||
12 | |||
13 | #include <linux/interrupt.h> | ||
14 | #include <linux/notifier.h> | ||
15 | |||
16 | /* This portion previously known as <mach/prcmu-fw-defs_v1.h> */ | ||
17 | |||
18 | /** | ||
19 | * enum state - ON/OFF state definition | ||
20 | * @OFF: State is ON | ||
21 | * @ON: State is OFF | ||
22 | * | ||
23 | */ | ||
24 | enum state { | ||
25 | OFF = 0x0, | ||
26 | ON = 0x1, | ||
27 | }; | ||
28 | |||
29 | /** | ||
30 | * enum ret_state - general purpose On/Off/Retention states | ||
31 | * | ||
32 | */ | ||
33 | enum ret_state { | ||
34 | OFFST = 0, | ||
35 | ONST = 1, | ||
36 | RETST = 2 | ||
37 | }; | ||
38 | |||
39 | /** | ||
40 | * enum clk_arm - ARM Cortex A9 clock schemes | ||
41 | * @A9_OFF: | ||
42 | * @A9_BOOT: | ||
43 | * @A9_OPPT1: | ||
44 | * @A9_OPPT2: | ||
45 | * @A9_EXTCLK: | ||
46 | */ | ||
47 | enum clk_arm { | ||
48 | A9_OFF, | ||
49 | A9_BOOT, | ||
50 | A9_OPPT1, | ||
51 | A9_OPPT2, | ||
52 | A9_EXTCLK | ||
53 | }; | ||
54 | |||
55 | /** | ||
56 | * enum clk_gen - GEN#0/GEN#1 clock schemes | ||
57 | * @GEN_OFF: | ||
58 | * @GEN_BOOT: | ||
59 | * @GEN_OPPT1: | ||
60 | */ | ||
61 | enum clk_gen { | ||
62 | GEN_OFF, | ||
63 | GEN_BOOT, | ||
64 | GEN_OPPT1, | ||
65 | }; | ||
66 | |||
67 | /* some information between arm and xp70 */ | ||
68 | |||
69 | /** | ||
70 | * enum romcode_write - Romcode message written by A9 AND read by XP70 | ||
71 | * @RDY_2_DS: Value set when ApDeepSleep state can be executed by XP70 | ||
72 | * @RDY_2_XP70_RST: Value set when 0x0F has been successfully polled by the | ||
73 | * romcode. The xp70 will go into self-reset | ||
74 | */ | ||
75 | enum romcode_write { | ||
76 | RDY_2_DS = 0x09, | ||
77 | RDY_2_XP70_RST = 0x10 | ||
78 | }; | ||
79 | |||
80 | /** | ||
81 | * enum romcode_read - Romcode message written by XP70 and read by A9 | ||
82 | * @INIT: Init value when romcode field is not used | ||
83 | * @FS_2_DS: Value set when power state is going from ApExecute to | ||
84 | * ApDeepSleep | ||
85 | * @END_DS: Value set when ApDeepSleep power state is reached coming from | ||
86 | * ApExecute state | ||
87 | * @DS_TO_FS: Value set when power state is going from ApDeepSleep to | ||
88 | * ApExecute | ||
89 | * @END_FS: Value set when ApExecute power state is reached coming from | ||
90 | * ApDeepSleep state | ||
91 | * @SWR: Value set when power state is going to ApReset | ||
92 | * @END_SWR: Value set when the xp70 finished executing ApReset actions and | ||
93 | * waits for romcode acknowledgment to go to self-reset | ||
94 | */ | ||
95 | enum romcode_read { | ||
96 | INIT = 0x00, | ||
97 | FS_2_DS = 0x0A, | ||
98 | END_DS = 0x0B, | ||
99 | DS_TO_FS = 0x0C, | ||
100 | END_FS = 0x0D, | ||
101 | SWR = 0x0E, | ||
102 | END_SWR = 0x0F | ||
103 | }; | ||
104 | |||
105 | /** | ||
106 | * enum ap_pwrst - current power states defined in PRCMU firmware | ||
107 | * @NO_PWRST: Current power state init | ||
108 | * @AP_BOOT: Current power state is apBoot | ||
109 | * @AP_EXECUTE: Current power state is apExecute | ||
110 | * @AP_DEEP_SLEEP: Current power state is apDeepSleep | ||
111 | * @AP_SLEEP: Current power state is apSleep | ||
112 | * @AP_IDLE: Current power state is apIdle | ||
113 | * @AP_RESET: Current power state is apReset | ||
114 | */ | ||
115 | enum ap_pwrst { | ||
116 | NO_PWRST = 0x00, | ||
117 | AP_BOOT = 0x01, | ||
118 | AP_EXECUTE = 0x02, | ||
119 | AP_DEEP_SLEEP = 0x03, | ||
120 | AP_SLEEP = 0x04, | ||
121 | AP_IDLE = 0x05, | ||
122 | AP_RESET = 0x06 | ||
123 | }; | ||
124 | |||
125 | /** | ||
126 | * enum ap_pwrst_trans - Transition states defined in PRCMU firmware | ||
127 | * @NO_TRANSITION: No power state transition | ||
128 | * @APEXECUTE_TO_APSLEEP: Power state transition from ApExecute to ApSleep | ||
129 | * @APIDLE_TO_APSLEEP: Power state transition from ApIdle to ApSleep | ||
130 | * @APBOOT_TO_APEXECUTE: Power state transition from ApBoot to ApExecute | ||
131 | * @APEXECUTE_TO_APDEEPSLEEP: Power state transition from ApExecute to | ||
132 | * ApDeepSleep | ||
133 | * @APEXECUTE_TO_APIDLE: Power state transition from ApExecute to ApIdle | ||
134 | */ | ||
135 | enum ap_pwrst_trans { | ||
136 | NO_TRANSITION = 0x00, | ||
137 | APEXECUTE_TO_APSLEEP = 0x01, | ||
138 | APIDLE_TO_APSLEEP = 0x02, /* To be removed */ | ||
139 | PRCMU_AP_SLEEP = 0x01, | ||
140 | APBOOT_TO_APEXECUTE = 0x03, | ||
141 | APEXECUTE_TO_APDEEPSLEEP = 0x04, /* To be removed */ | ||
142 | PRCMU_AP_DEEP_SLEEP = 0x04, | ||
143 | APEXECUTE_TO_APIDLE = 0x05, /* To be removed */ | ||
144 | PRCMU_AP_IDLE = 0x05, | ||
145 | PRCMU_AP_DEEP_IDLE = 0x07, | ||
146 | }; | ||
147 | |||
148 | /** | ||
149 | * enum ddr_pwrst - DDR power states definition | ||
150 | * @DDR_PWR_STATE_UNCHANGED: SDRAM and DDR controller state is unchanged | ||
151 | * @DDR_PWR_STATE_ON: | ||
152 | * @DDR_PWR_STATE_OFFLOWLAT: | ||
153 | * @DDR_PWR_STATE_OFFHIGHLAT: | ||
154 | */ | ||
155 | enum ddr_pwrst { | ||
156 | DDR_PWR_STATE_UNCHANGED = 0x00, | ||
157 | DDR_PWR_STATE_ON = 0x01, | ||
158 | DDR_PWR_STATE_OFFLOWLAT = 0x02, | ||
159 | DDR_PWR_STATE_OFFHIGHLAT = 0x03 | ||
160 | }; | ||
161 | |||
162 | /** | ||
163 | * enum arm_opp - ARM OPP states definition | ||
164 | * @ARM_OPP_INIT: | ||
165 | * @ARM_NO_CHANGE: The ARM operating point is unchanged | ||
166 | * @ARM_100_OPP: The new ARM operating point is arm100opp | ||
167 | * @ARM_50_OPP: The new ARM operating point is arm50opp | ||
168 | * @ARM_MAX_OPP: Operating point is "max" (more than 100) | ||
169 | * @ARM_MAX_FREQ100OPP: Set max opp if available, else 100 | ||
170 | * @ARM_EXTCLK: The new ARM operating point is armExtClk | ||
171 | */ | ||
172 | enum arm_opp { | ||
173 | ARM_OPP_INIT = 0x00, | ||
174 | ARM_NO_CHANGE = 0x01, | ||
175 | ARM_100_OPP = 0x02, | ||
176 | ARM_50_OPP = 0x03, | ||
177 | ARM_MAX_OPP = 0x04, | ||
178 | ARM_MAX_FREQ100OPP = 0x05, | ||
179 | ARM_EXTCLK = 0x07 | ||
180 | }; | ||
181 | |||
182 | /** | ||
183 | * enum ape_opp - APE OPP states definition | ||
184 | * @APE_OPP_INIT: | ||
185 | * @APE_NO_CHANGE: The APE operating point is unchanged | ||
186 | * @APE_100_OPP: The new APE operating point is ape100opp | ||
187 | * @APE_50_OPP: 50% | ||
188 | */ | ||
189 | enum ape_opp { | ||
190 | APE_OPP_INIT = 0x00, | ||
191 | APE_NO_CHANGE = 0x01, | ||
192 | APE_100_OPP = 0x02, | ||
193 | APE_50_OPP = 0x03 | ||
194 | }; | ||
195 | |||
196 | /** | ||
197 | * enum hw_acc_state - State definition for hardware accelerator | ||
198 | * @HW_NO_CHANGE: The hardware accelerator state must remain unchanged | ||
199 | * @HW_OFF: The hardware accelerator must be switched off | ||
200 | * @HW_OFF_RAMRET: The hardware accelerator must be switched off with its | ||
201 | * internal RAM in retention | ||
202 | * @HW_ON: The hwa hardware accelerator hwa must be switched on | ||
203 | * | ||
204 | * NOTE! Deprecated, to be removed when all users switched over to use the | ||
205 | * regulator API. | ||
206 | */ | ||
207 | enum hw_acc_state { | ||
208 | HW_NO_CHANGE = 0x00, | ||
209 | HW_OFF = 0x01, | ||
210 | HW_OFF_RAMRET = 0x02, | ||
211 | HW_ON = 0x04 | ||
212 | }; | ||
213 | |||
214 | /** | ||
215 | * enum mbox_2_arm_stat - Status messages definition for mbox_arm | ||
216 | * @BOOT_TO_EXECUTEOK: The apBoot to apExecute state transition has been | ||
217 | * completed | ||
218 | * @DEEPSLEEPOK: The apExecute to apDeepSleep state transition has been | ||
219 | * completed | ||
220 | * @SLEEPOK: The apExecute to apSleep state transition has been completed | ||
221 | * @IDLEOK: The apExecute to apIdle state transition has been completed | ||
222 | * @SOFTRESETOK: The A9 watchdog/ SoftReset state has been completed | ||
223 | * @SOFTRESETGO : The A9 watchdog/SoftReset state is on going | ||
224 | * @BOOT_TO_EXECUTE: The apBoot to apExecute state transition is on going | ||
225 | * @EXECUTE_TO_DEEPSLEEP: The apExecute to apDeepSleep state transition is on | ||
226 | * going | ||
227 | * @DEEPSLEEP_TO_EXECUTE: The apDeepSleep to apExecute state transition is on | ||
228 | * going | ||
229 | * @DEEPSLEEP_TO_EXECUTEOK: The apDeepSleep to apExecute state transition has | ||
230 | * been completed | ||
231 | * @EXECUTE_TO_SLEEP: The apExecute to apSleep state transition is on going | ||
232 | * @SLEEP_TO_EXECUTE: The apSleep to apExecute state transition is on going | ||
233 | * @SLEEP_TO_EXECUTEOK: The apSleep to apExecute state transition has been | ||
234 | * completed | ||
235 | * @EXECUTE_TO_IDLE: The apExecute to apIdle state transition is on going | ||
236 | * @IDLE_TO_EXECUTE: The apIdle to apExecute state transition is on going | ||
237 | * @IDLE_TO_EXECUTEOK: The apIdle to apExecute state transition has been | ||
238 | * completed | ||
239 | * @INIT_STATUS: Status init | ||
240 | */ | ||
241 | enum ap_pwrsttr_status { | ||
242 | BOOT_TO_EXECUTEOK = 0xFF, | ||
243 | DEEPSLEEPOK = 0xFE, | ||
244 | SLEEPOK = 0xFD, | ||
245 | IDLEOK = 0xFC, | ||
246 | SOFTRESETOK = 0xFB, | ||
247 | SOFTRESETGO = 0xFA, | ||
248 | BOOT_TO_EXECUTE = 0xF9, | ||
249 | EXECUTE_TO_DEEPSLEEP = 0xF8, | ||
250 | DEEPSLEEP_TO_EXECUTE = 0xF7, | ||
251 | DEEPSLEEP_TO_EXECUTEOK = 0xF6, | ||
252 | EXECUTE_TO_SLEEP = 0xF5, | ||
253 | SLEEP_TO_EXECUTE = 0xF4, | ||
254 | SLEEP_TO_EXECUTEOK = 0xF3, | ||
255 | EXECUTE_TO_IDLE = 0xF2, | ||
256 | IDLE_TO_EXECUTE = 0xF1, | ||
257 | IDLE_TO_EXECUTEOK = 0xF0, | ||
258 | RDYTODS_RETURNTOEXE = 0xEF, | ||
259 | NORDYTODS_RETURNTOEXE = 0xEE, | ||
260 | EXETOSLEEP_RETURNTOEXE = 0xED, | ||
261 | EXETOIDLE_RETURNTOEXE = 0xEC, | ||
262 | INIT_STATUS = 0xEB, | ||
263 | |||
264 | /*error messages */ | ||
265 | INITERROR = 0x00, | ||
266 | PLLARMLOCKP_ER = 0x01, | ||
267 | PLLDDRLOCKP_ER = 0x02, | ||
268 | PLLSOCLOCKP_ER = 0x03, | ||
269 | PLLSOCK1LOCKP_ER = 0x04, | ||
270 | ARMWFI_ER = 0x05, | ||
271 | SYSCLKOK_ER = 0x06, | ||
272 | I2C_NACK_DATA_ER = 0x07, | ||
273 | BOOT_ER = 0x08, | ||
274 | I2C_STATUS_ALWAYS_1 = 0x0A, | ||
275 | I2C_NACK_REG_ADDR_ER = 0x0B, | ||
276 | I2C_NACK_DATA0123_ER = 0x1B, | ||
277 | I2C_NACK_ADDR_ER = 0x1F, | ||
278 | CURAPPWRSTISNOT_BOOT = 0x20, | ||
279 | CURAPPWRSTISNOT_EXECUTE = 0x21, | ||
280 | CURAPPWRSTISNOT_SLEEPMODE = 0x22, | ||
281 | CURAPPWRSTISNOT_CORRECTFORIT10 = 0x23, | ||
282 | FIFO4500WUISNOT_WUPEVENT = 0x24, | ||
283 | PLL32KLOCKP_ER = 0x29, | ||
284 | DDRDEEPSLEEPOK_ER = 0x2A, | ||
285 | ROMCODEREADY_ER = 0x50, | ||
286 | WUPBEFOREDS = 0x51, | ||
287 | DDRCONFIG_ER = 0x52, | ||
288 | WUPBEFORESLEEP = 0x53, | ||
289 | WUPBEFOREIDLE = 0x54 | ||
290 | }; /* earlier called as mbox_2_arm_stat */ | ||
291 | |||
292 | /** | ||
293 | * enum dvfs_stat - DVFS status messages definition | ||
294 | * @DVFS_GO: A state transition DVFS is on going | ||
295 | * @DVFS_ARM100OPPOK: The state transition DVFS has been completed for 100OPP | ||
296 | * @DVFS_ARM50OPPOK: The state transition DVFS has been completed for 50OPP | ||
297 | * @DVFS_ARMEXTCLKOK: The state transition DVFS has been completed for EXTCLK | ||
298 | * @DVFS_NOCHGTCLKOK: The state transition DVFS has been completed for | ||
299 | * NOCHGCLK | ||
300 | * @DVFS_INITSTATUS: Value init | ||
301 | */ | ||
302 | enum dvfs_stat { | ||
303 | DVFS_GO = 0xFF, | ||
304 | DVFS_ARM100OPPOK = 0xFE, | ||
305 | DVFS_ARM50OPPOK = 0xFD, | ||
306 | DVFS_ARMEXTCLKOK = 0xFC, | ||
307 | DVFS_NOCHGTCLKOK = 0xFB, | ||
308 | DVFS_INITSTATUS = 0x00 | ||
309 | }; | ||
310 | |||
311 | /** | ||
312 | * enum sva_mmdsp_stat - SVA MMDSP status messages | ||
313 | * @SVA_MMDSP_GO: SVAMMDSP interrupt has happened | ||
314 | * @SVA_MMDSP_INIT: Status init | ||
315 | */ | ||
316 | enum sva_mmdsp_stat { | ||
317 | SVA_MMDSP_GO = 0xFF, | ||
318 | SVA_MMDSP_INIT = 0x00 | ||
319 | }; | ||
320 | |||
321 | /** | ||
322 | * enum sia_mmdsp_stat - SIA MMDSP status messages | ||
323 | * @SIA_MMDSP_GO: SIAMMDSP interrupt has happened | ||
324 | * @SIA_MMDSP_INIT: Status init | ||
325 | */ | ||
326 | enum sia_mmdsp_stat { | ||
327 | SIA_MMDSP_GO = 0xFF, | ||
328 | SIA_MMDSP_INIT = 0x00 | ||
329 | }; | ||
330 | |||
331 | /** | ||
332 | * enum mbox_to_arm_err - Error messages definition | ||
333 | * @INIT_ERR: Init value | ||
334 | * @PLLARMLOCKP_ERR: PLLARM has not been correctly locked in given time | ||
335 | * @PLLDDRLOCKP_ERR: PLLDDR has not been correctly locked in the given time | ||
336 | * @PLLSOC0LOCKP_ERR: PLLSOC0 has not been correctly locked in the given time | ||
337 | * @PLLSOC1LOCKP_ERR: PLLSOC1 has not been correctly locked in the given time | ||
338 | * @ARMWFI_ERR: The ARM WFI has not been correctly executed in the given time | ||
339 | * @SYSCLKOK_ERR: The SYSCLK is not available in the given time | ||
340 | * @BOOT_ERR: Romcode has not validated the XP70 self reset in the given time | ||
341 | * @ROMCODESAVECONTEXT: The Romcode didn.t correctly save it secure context | ||
342 | * @VARMHIGHSPEEDVALTO_ERR: The ARM high speed supply value transfered | ||
343 | * through I2C has not been correctly executed in the given time | ||
344 | * @VARMHIGHSPEEDACCESS_ERR: The command value of VarmHighSpeedVal transfered | ||
345 | * through I2C has not been correctly executed in the given time | ||
346 | * @VARMLOWSPEEDVALTO_ERR:The ARM low speed supply value transfered through | ||
347 | * I2C has not been correctly executed in the given time | ||
348 | * @VARMLOWSPEEDACCESS_ERR: The command value of VarmLowSpeedVal transfered | ||
349 | * through I2C has not been correctly executed in the given time | ||
350 | * @VARMRETENTIONVALTO_ERR: The ARM retention supply value transfered through | ||
351 | * I2C has not been correctly executed in the given time | ||
352 | * @VARMRETENTIONACCESS_ERR: The command value of VarmRetentionVal transfered | ||
353 | * through I2C has not been correctly executed in the given time | ||
354 | * @VAPEHIGHSPEEDVALTO_ERR: The APE highspeed supply value transfered through | ||
355 | * I2C has not been correctly executed in the given time | ||
356 | * @VSAFEHPVALTO_ERR: The SAFE high power supply value transfered through I2C | ||
357 | * has not been correctly executed in the given time | ||
358 | * @VMODSEL1VALTO_ERR: The MODEM sel1 supply value transfered through I2C has | ||
359 | * not been correctly executed in the given time | ||
360 | * @VMODSEL2VALTO_ERR: The MODEM sel2 supply value transfered through I2C has | ||
361 | * not been correctly executed in the given time | ||
362 | * @VARMOFFACCESS_ERR: The command value of Varm ON/OFF transfered through | ||
363 | * I2C has not been correctly executed in the given time | ||
364 | * @VAPEOFFACCESS_ERR: The command value of Vape ON/OFF transfered through | ||
365 | * I2C has not been correctly executed in the given time | ||
366 | * @VARMRETACCES_ERR: The command value of Varm retention ON/OFF transfered | ||
367 | * through I2C has not been correctly executed in the given time | ||
368 | * @CURAPPWRSTISNOTBOOT:Generated when Arm want to do power state transition | ||
369 | * ApBoot to ApExecute but the power current state is not Apboot | ||
370 | * @CURAPPWRSTISNOTEXECUTE: Generated when Arm want to do power state | ||
371 | * transition from ApExecute to others power state but the | ||
372 | * power current state is not ApExecute | ||
373 | * @CURAPPWRSTISNOTSLEEPMODE: Generated when wake up events are transmitted | ||
374 | * but the power current state is not ApDeepSleep/ApSleep/ApIdle | ||
375 | * @CURAPPWRSTISNOTCORRECTDBG: Generated when wake up events are transmitted | ||
376 | * but the power current state is not correct | ||
377 | * @ARMREGU1VALTO_ERR:The ArmRegu1 value transferred through I2C has not | ||
378 | * been correctly executed in the given time | ||
379 | * @ARMREGU2VALTO_ERR: The ArmRegu2 value transferred through I2C has not | ||
380 | * been correctly executed in the given time | ||
381 | * @VAPEREGUVALTO_ERR: The VApeRegu value transfered through I2C has not | ||
382 | * been correctly executed in the given time | ||
383 | * @VSMPS3REGUVALTO_ERR: The VSmps3Regu value transfered through I2C has not | ||
384 | * been correctly executed in the given time | ||
385 | * @VMODREGUVALTO_ERR: The VModemRegu value transfered through I2C has not | ||
386 | * been correctly executed in the given time | ||
387 | */ | ||
388 | enum mbox_to_arm_err { | ||
389 | INIT_ERR = 0x00, | ||
390 | PLLARMLOCKP_ERR = 0x01, | ||
391 | PLLDDRLOCKP_ERR = 0x02, | ||
392 | PLLSOC0LOCKP_ERR = 0x03, | ||
393 | PLLSOC1LOCKP_ERR = 0x04, | ||
394 | ARMWFI_ERR = 0x05, | ||
395 | SYSCLKOK_ERR = 0x06, | ||
396 | BOOT_ERR = 0x07, | ||
397 | ROMCODESAVECONTEXT = 0x08, | ||
398 | VARMHIGHSPEEDVALTO_ERR = 0x10, | ||
399 | VARMHIGHSPEEDACCESS_ERR = 0x11, | ||
400 | VARMLOWSPEEDVALTO_ERR = 0x12, | ||
401 | VARMLOWSPEEDACCESS_ERR = 0x13, | ||
402 | VARMRETENTIONVALTO_ERR = 0x14, | ||
403 | VARMRETENTIONACCESS_ERR = 0x15, | ||
404 | VAPEHIGHSPEEDVALTO_ERR = 0x16, | ||
405 | VSAFEHPVALTO_ERR = 0x17, | ||
406 | VMODSEL1VALTO_ERR = 0x18, | ||
407 | VMODSEL2VALTO_ERR = 0x19, | ||
408 | VARMOFFACCESS_ERR = 0x1A, | ||
409 | VAPEOFFACCESS_ERR = 0x1B, | ||
410 | VARMRETACCES_ERR = 0x1C, | ||
411 | CURAPPWRSTISNOTBOOT = 0x20, | ||
412 | CURAPPWRSTISNOTEXECUTE = 0x21, | ||
413 | CURAPPWRSTISNOTSLEEPMODE = 0x22, | ||
414 | CURAPPWRSTISNOTCORRECTDBG = 0x23, | ||
415 | ARMREGU1VALTO_ERR = 0x24, | ||
416 | ARMREGU2VALTO_ERR = 0x25, | ||
417 | VAPEREGUVALTO_ERR = 0x26, | ||
418 | VSMPS3REGUVALTO_ERR = 0x27, | ||
419 | VMODREGUVALTO_ERR = 0x28 | ||
420 | }; | ||
421 | |||
422 | enum hw_acc { | ||
423 | SVAMMDSP = 0, | ||
424 | SVAPIPE = 1, | ||
425 | SIAMMDSP = 2, | ||
426 | SIAPIPE = 3, | ||
427 | SGA = 4, | ||
428 | B2R2MCDE = 5, | ||
429 | ESRAM12 = 6, | ||
430 | ESRAM34 = 7, | ||
431 | }; | ||
432 | |||
433 | enum cs_pwrmgt { | ||
434 | PWRDNCS0 = 0, | ||
435 | WKUPCS0 = 1, | ||
436 | PWRDNCS1 = 2, | ||
437 | WKUPCS1 = 3 | ||
438 | }; | ||
439 | |||
440 | /* Defs related to autonomous power management */ | ||
441 | |||
442 | /** | ||
443 | * enum sia_sva_pwr_policy - Power policy | ||
444 | * @NO_CHGT: No change | ||
445 | * @DSPOFF_HWPOFF: | ||
446 | * @DSPOFFRAMRET_HWPOFF: | ||
447 | * @DSPCLKOFF_HWPOFF: | ||
448 | * @DSPCLKOFF_HWPCLKOFF: | ||
449 | * | ||
450 | */ | ||
451 | enum sia_sva_pwr_policy { | ||
452 | NO_CHGT = 0x0, | ||
453 | DSPOFF_HWPOFF = 0x1, | ||
454 | DSPOFFRAMRET_HWPOFF = 0x2, | ||
455 | DSPCLKOFF_HWPOFF = 0x3, | ||
456 | DSPCLKOFF_HWPCLKOFF = 0x4, | ||
457 | }; | ||
458 | |||
459 | /** | ||
460 | * enum auto_enable - Auto Power enable | ||
461 | * @AUTO_OFF: | ||
462 | * @AUTO_ON: | ||
463 | * | ||
464 | */ | ||
465 | enum auto_enable { | ||
466 | AUTO_OFF = 0x0, | ||
467 | AUTO_ON = 0x1, | ||
468 | }; | ||
469 | |||
470 | /* End of file previously known as prcmu-fw-defs_v1.h */ | ||
471 | |||
472 | /* PRCMU Wakeup defines */ | ||
473 | enum prcmu_wakeup_index { | ||
474 | PRCMU_WAKEUP_INDEX_RTC, | ||
475 | PRCMU_WAKEUP_INDEX_RTT0, | ||
476 | PRCMU_WAKEUP_INDEX_RTT1, | ||
477 | PRCMU_WAKEUP_INDEX_HSI0, | ||
478 | PRCMU_WAKEUP_INDEX_HSI1, | ||
479 | PRCMU_WAKEUP_INDEX_USB, | ||
480 | PRCMU_WAKEUP_INDEX_ABB, | ||
481 | PRCMU_WAKEUP_INDEX_ABB_FIFO, | ||
482 | PRCMU_WAKEUP_INDEX_ARM, | ||
483 | NUM_PRCMU_WAKEUP_INDICES | ||
484 | }; | ||
485 | #define PRCMU_WAKEUP(_name) (BIT(PRCMU_WAKEUP_INDEX_##_name)) | ||
486 | |||
487 | /* PRCMU QoS APE OPP class */ | ||
488 | #define PRCMU_QOS_APE_OPP 1 | ||
489 | #define PRCMU_QOS_DDR_OPP 2 | ||
490 | #define PRCMU_QOS_DEFAULT_VALUE -1 | ||
491 | |||
492 | /** | ||
493 | * enum hw_acc_dev - enum for hw accelerators | ||
494 | * @HW_ACC_SVAMMDSP: for SVAMMDSP | ||
495 | * @HW_ACC_SVAPIPE: for SVAPIPE | ||
496 | * @HW_ACC_SIAMMDSP: for SIAMMDSP | ||
497 | * @HW_ACC_SIAPIPE: for SIAPIPE | ||
498 | * @HW_ACC_SGA: for SGA | ||
499 | * @HW_ACC_B2R2: for B2R2 | ||
500 | * @HW_ACC_MCDE: for MCDE | ||
501 | * @HW_ACC_ESRAM1: for ESRAM1 | ||
502 | * @HW_ACC_ESRAM2: for ESRAM2 | ||
503 | * @HW_ACC_ESRAM3: for ESRAM3 | ||
504 | * @HW_ACC_ESRAM4: for ESRAM4 | ||
505 | * @NUM_HW_ACC: number of hardware accelerators | ||
506 | * | ||
507 | * Different hw accelerators which can be turned ON/ | ||
508 | * OFF or put into retention (MMDSPs and ESRAMs). | ||
509 | * Used with EPOD API. | ||
510 | * | ||
511 | * NOTE! Deprecated, to be removed when all users switched over to use the | ||
512 | * regulator API. | ||
513 | */ | ||
514 | enum hw_acc_dev { | ||
515 | HW_ACC_SVAMMDSP, | ||
516 | HW_ACC_SVAPIPE, | ||
517 | HW_ACC_SIAMMDSP, | ||
518 | HW_ACC_SIAPIPE, | ||
519 | HW_ACC_SGA, | ||
520 | HW_ACC_B2R2, | ||
521 | HW_ACC_MCDE, | ||
522 | HW_ACC_ESRAM1, | ||
523 | HW_ACC_ESRAM2, | ||
524 | HW_ACC_ESRAM3, | ||
525 | HW_ACC_ESRAM4, | ||
526 | NUM_HW_ACC | ||
527 | }; | ||
528 | |||
529 | /* | ||
530 | * Ids for all EPODs (power domains) | ||
531 | * - EPOD_ID_SVAMMDSP: power domain for SVA MMDSP | ||
532 | * - EPOD_ID_SVAPIPE: power domain for SVA pipe | ||
533 | * - EPOD_ID_SIAMMDSP: power domain for SIA MMDSP | ||
534 | * - EPOD_ID_SIAPIPE: power domain for SIA pipe | ||
535 | * - EPOD_ID_SGA: power domain for SGA | ||
536 | * - EPOD_ID_B2R2_MCDE: power domain for B2R2 and MCDE | ||
537 | * - EPOD_ID_ESRAM12: power domain for ESRAM 1 and 2 | ||
538 | * - EPOD_ID_ESRAM34: power domain for ESRAM 3 and 4 | ||
539 | * - NUM_EPOD_ID: number of power domains | ||
540 | */ | ||
541 | #define EPOD_ID_SVAMMDSP 0 | ||
542 | #define EPOD_ID_SVAPIPE 1 | ||
543 | #define EPOD_ID_SIAMMDSP 2 | ||
544 | #define EPOD_ID_SIAPIPE 3 | ||
545 | #define EPOD_ID_SGA 4 | ||
546 | #define EPOD_ID_B2R2_MCDE 5 | ||
547 | #define EPOD_ID_ESRAM12 6 | ||
548 | #define EPOD_ID_ESRAM34 7 | ||
549 | #define NUM_EPOD_ID 8 | ||
550 | |||
551 | /* | ||
552 | * state definition for EPOD (power domain) | ||
553 | * - EPOD_STATE_NO_CHANGE: The EPOD should remain unchanged | ||
554 | * - EPOD_STATE_OFF: The EPOD is switched off | ||
555 | * - EPOD_STATE_RAMRET: The EPOD is switched off with its internal RAM in | ||
556 | * retention | ||
557 | * - EPOD_STATE_ON_CLK_OFF: The EPOD is switched on, clock is still off | ||
558 | * - EPOD_STATE_ON: Same as above, but with clock enabled | ||
559 | */ | ||
560 | #define EPOD_STATE_NO_CHANGE 0x00 | ||
561 | #define EPOD_STATE_OFF 0x01 | ||
562 | #define EPOD_STATE_RAMRET 0x02 | ||
563 | #define EPOD_STATE_ON_CLK_OFF 0x03 | ||
564 | #define EPOD_STATE_ON 0x04 | ||
565 | |||
566 | /* | ||
567 | * CLKOUT sources | ||
568 | */ | ||
569 | #define PRCMU_CLKSRC_CLK38M 0x00 | ||
570 | #define PRCMU_CLKSRC_ACLK 0x01 | ||
571 | #define PRCMU_CLKSRC_SYSCLK 0x02 | ||
572 | #define PRCMU_CLKSRC_LCDCLK 0x03 | ||
573 | #define PRCMU_CLKSRC_SDMMCCLK 0x04 | ||
574 | #define PRCMU_CLKSRC_TVCLK 0x05 | ||
575 | #define PRCMU_CLKSRC_TIMCLK 0x06 | ||
576 | #define PRCMU_CLKSRC_CLK009 0x07 | ||
577 | /* These are only valid for CLKOUT1: */ | ||
578 | #define PRCMU_CLKSRC_SIAMMDSPCLK 0x40 | ||
579 | #define PRCMU_CLKSRC_I2CCLK 0x41 | ||
580 | #define PRCMU_CLKSRC_MSP02CLK 0x42 | ||
581 | #define PRCMU_CLKSRC_ARMPLL_OBSCLK 0x43 | ||
582 | #define PRCMU_CLKSRC_HSIRXCLK 0x44 | ||
583 | #define PRCMU_CLKSRC_HSITXCLK 0x45 | ||
584 | #define PRCMU_CLKSRC_ARMCLKFIX 0x46 | ||
585 | #define PRCMU_CLKSRC_HDMICLK 0x47 | ||
586 | |||
587 | /* | ||
588 | * Definitions for autonomous power management configuration. | ||
589 | */ | ||
590 | |||
591 | #define PRCMU_AUTO_PM_OFF 0 | ||
592 | #define PRCMU_AUTO_PM_ON 1 | ||
593 | |||
594 | #define PRCMU_AUTO_PM_POWER_ON_HSEM BIT(0) | ||
595 | #define PRCMU_AUTO_PM_POWER_ON_ABB_FIFO_IT BIT(1) | ||
596 | |||
597 | enum prcmu_auto_pm_policy { | ||
598 | PRCMU_AUTO_PM_POLICY_NO_CHANGE, | ||
599 | PRCMU_AUTO_PM_POLICY_DSP_OFF_HWP_OFF, | ||
600 | PRCMU_AUTO_PM_POLICY_DSP_OFF_RAMRET_HWP_OFF, | ||
601 | PRCMU_AUTO_PM_POLICY_DSP_CLK_OFF_HWP_OFF, | ||
602 | PRCMU_AUTO_PM_POLICY_DSP_CLK_OFF_HWP_CLK_OFF, | ||
603 | }; | ||
604 | |||
605 | /** | ||
606 | * struct prcmu_auto_pm_config - Autonomous power management configuration. | ||
607 | * @sia_auto_pm_enable: SIA autonomous pm enable. (PRCMU_AUTO_PM_{OFF,ON}) | ||
608 | * @sia_power_on: SIA power ON enable. (PRCMU_AUTO_PM_POWER_ON_* bitmask) | ||
609 | * @sia_policy: SIA power policy. (enum prcmu_auto_pm_policy) | ||
610 | * @sva_auto_pm_enable: SVA autonomous pm enable. (PRCMU_AUTO_PM_{OFF,ON}) | ||
611 | * @sva_power_on: SVA power ON enable. (PRCMU_AUTO_PM_POWER_ON_* bitmask) | ||
612 | * @sva_policy: SVA power policy. (enum prcmu_auto_pm_policy) | ||
613 | */ | ||
614 | struct prcmu_auto_pm_config { | ||
615 | u8 sia_auto_pm_enable; | ||
616 | u8 sia_power_on; | ||
617 | u8 sia_policy; | ||
618 | u8 sva_auto_pm_enable; | ||
619 | u8 sva_power_on; | ||
620 | u8 sva_policy; | ||
621 | }; | ||
622 | |||
623 | /** | ||
624 | * enum ddr_opp - DDR OPP states definition | ||
625 | * @DDR_100_OPP: The new DDR operating point is ddr100opp | ||
626 | * @DDR_50_OPP: The new DDR operating point is ddr50opp | ||
627 | * @DDR_25_OPP: The new DDR operating point is ddr25opp | ||
628 | */ | ||
629 | enum ddr_opp { | ||
630 | DDR_100_OPP = 0x00, | ||
631 | DDR_50_OPP = 0x01, | ||
632 | DDR_25_OPP = 0x02, | ||
633 | }; | ||
634 | |||
635 | /* | ||
636 | * Clock identifiers. | ||
637 | */ | ||
638 | enum prcmu_clock { | ||
639 | PRCMU_SGACLK, | ||
640 | PRCMU_UARTCLK, | ||
641 | PRCMU_MSP02CLK, | ||
642 | PRCMU_MSP1CLK, | ||
643 | PRCMU_I2CCLK, | ||
644 | PRCMU_SDMMCCLK, | ||
645 | PRCMU_SLIMCLK, | ||
646 | PRCMU_PER1CLK, | ||
647 | PRCMU_PER2CLK, | ||
648 | PRCMU_PER3CLK, | ||
649 | PRCMU_PER5CLK, | ||
650 | PRCMU_PER6CLK, | ||
651 | PRCMU_PER7CLK, | ||
652 | PRCMU_LCDCLK, | ||
653 | PRCMU_BMLCLK, | ||
654 | PRCMU_HSITXCLK, | ||
655 | PRCMU_HSIRXCLK, | ||
656 | PRCMU_HDMICLK, | ||
657 | PRCMU_APEATCLK, | ||
658 | PRCMU_APETRACECLK, | ||
659 | PRCMU_MCDECLK, | ||
660 | PRCMU_IPI2CCLK, | ||
661 | PRCMU_DSIALTCLK, | ||
662 | PRCMU_DMACLK, | ||
663 | PRCMU_B2R2CLK, | ||
664 | PRCMU_TVCLK, | ||
665 | PRCMU_SSPCLK, | ||
666 | PRCMU_RNGCLK, | ||
667 | PRCMU_UICCCLK, | ||
668 | PRCMU_NUM_REG_CLOCKS, | ||
669 | PRCMU_SYSCLK = PRCMU_NUM_REG_CLOCKS, | ||
670 | PRCMU_TIMCLK, | ||
671 | }; | ||
672 | |||
673 | /* | ||
674 | * Definitions for controlling ESRAM0 in deep sleep. | ||
675 | */ | ||
676 | #define ESRAM0_DEEP_SLEEP_STATE_OFF 1 | ||
677 | #define ESRAM0_DEEP_SLEEP_STATE_RET 2 | ||
678 | |||
679 | #ifdef CONFIG_MFD_DB8500_PRCMU | ||
680 | void __init prcmu_early_init(void); | ||
681 | int prcmu_set_display_clocks(void); | ||
682 | int prcmu_disable_dsipll(void); | ||
683 | int prcmu_enable_dsipll(void); | ||
684 | #else | ||
685 | static inline void __init prcmu_early_init(void) {} | ||
686 | #endif | ||
687 | |||
688 | #ifdef CONFIG_MFD_DB8500_PRCMU | ||
689 | |||
690 | int prcmu_set_rc_a2p(enum romcode_write); | ||
691 | enum romcode_read prcmu_get_rc_p2a(void); | ||
692 | enum ap_pwrst prcmu_get_xp70_current_state(void); | ||
693 | int prcmu_set_power_state(u8 state, bool keep_ulp_clk, bool keep_ap_pll); | ||
694 | |||
695 | void prcmu_enable_wakeups(u32 wakeups); | ||
696 | static inline void prcmu_disable_wakeups(void) | ||
697 | { | ||
698 | prcmu_enable_wakeups(0); | ||
699 | } | ||
700 | |||
701 | void prcmu_config_abb_event_readout(u32 abb_events); | ||
702 | void prcmu_get_abb_event_buffer(void __iomem **buf); | ||
703 | int prcmu_set_arm_opp(u8 opp); | ||
704 | int prcmu_get_arm_opp(void); | ||
705 | bool prcmu_has_arm_maxopp(void); | ||
706 | bool prcmu_is_u8400(void); | ||
707 | int prcmu_set_ape_opp(u8 opp); | ||
708 | int prcmu_get_ape_opp(void); | ||
709 | int prcmu_request_ape_opp_100_voltage(bool enable); | ||
710 | int prcmu_release_usb_wakeup_state(void); | ||
711 | int prcmu_set_ddr_opp(u8 opp); | ||
712 | int prcmu_get_ddr_opp(void); | ||
713 | unsigned long prcmu_qos_get_cpufreq_opp_delay(void); | ||
714 | void prcmu_qos_set_cpufreq_opp_delay(unsigned long); | ||
715 | /* NOTE! Use regulator framework instead */ | ||
716 | int prcmu_set_hwacc(u16 hw_acc_dev, u8 state); | ||
717 | int prcmu_set_epod(u16 epod_id, u8 epod_state); | ||
718 | void prcmu_configure_auto_pm(struct prcmu_auto_pm_config *sleep, | ||
719 | struct prcmu_auto_pm_config *idle); | ||
720 | bool prcmu_is_auto_pm_enabled(void); | ||
721 | |||
722 | int prcmu_config_clkout(u8 clkout, u8 source, u8 div); | ||
723 | int prcmu_request_clock(u8 clock, bool enable); | ||
724 | int prcmu_set_clock_divider(u8 clock, u8 divider); | ||
725 | int prcmu_config_esram0_deep_sleep(u8 state); | ||
726 | int prcmu_config_hotdog(u8 threshold); | ||
727 | int prcmu_config_hotmon(u8 low, u8 high); | ||
728 | int prcmu_start_temp_sense(u16 cycles32k); | ||
729 | int prcmu_stop_temp_sense(void); | ||
730 | int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size); | ||
731 | int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size); | ||
732 | |||
733 | void prcmu_ac_wake_req(void); | ||
734 | void prcmu_ac_sleep_req(void); | ||
735 | void prcmu_system_reset(u16 reset_code); | ||
736 | void prcmu_modem_reset(void); | ||
737 | bool prcmu_is_ac_wake_requested(void); | ||
738 | void prcmu_enable_spi2(void); | ||
739 | void prcmu_disable_spi2(void); | ||
740 | |||
741 | #else /* !CONFIG_MFD_DB8500_PRCMU */ | ||
742 | |||
743 | static inline int prcmu_set_rc_a2p(enum romcode_write code) | ||
744 | { | ||
745 | return 0; | ||
746 | } | ||
747 | |||
748 | static inline enum romcode_read prcmu_get_rc_p2a(void) | ||
749 | { | ||
750 | return INIT; | ||
751 | } | ||
752 | |||
753 | static inline enum ap_pwrst prcmu_get_xp70_current_state(void) | ||
754 | { | ||
755 | return AP_EXECUTE; | ||
756 | } | ||
757 | |||
758 | static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk, | ||
759 | bool keep_ap_pll) | ||
760 | { | ||
761 | return 0; | ||
762 | } | ||
763 | |||
764 | static inline void prcmu_enable_wakeups(u32 wakeups) {} | ||
765 | |||
766 | static inline void prcmu_disable_wakeups(void) {} | ||
767 | |||
768 | static inline void prcmu_config_abb_event_readout(u32 abb_events) {} | ||
769 | |||
770 | static inline int prcmu_set_arm_opp(u8 opp) | ||
771 | { | ||
772 | return 0; | ||
773 | } | ||
774 | |||
775 | static inline int prcmu_get_arm_opp(void) | ||
776 | { | ||
777 | return ARM_100_OPP; | ||
778 | } | ||
779 | |||
780 | static bool prcmu_has_arm_maxopp(void) | ||
781 | { | ||
782 | return false; | ||
783 | } | ||
784 | |||
785 | static bool prcmu_is_u8400(void) | ||
786 | { | ||
787 | return false; | ||
788 | } | ||
789 | |||
790 | static inline int prcmu_set_ape_opp(u8 opp) | ||
791 | { | ||
792 | return 0; | ||
793 | } | ||
794 | |||
795 | static inline int prcmu_get_ape_opp(void) | ||
796 | { | ||
797 | return APE_100_OPP; | ||
798 | } | ||
799 | |||
800 | static inline int prcmu_request_ape_opp_100_voltage(bool enable) | ||
801 | { | ||
802 | return 0; | ||
803 | } | ||
804 | |||
805 | static inline int prcmu_release_usb_wakeup_state(void) | ||
806 | { | ||
807 | return 0; | ||
808 | } | ||
809 | |||
810 | static inline int prcmu_set_ddr_opp(u8 opp) | ||
811 | { | ||
812 | return 0; | ||
813 | } | ||
814 | |||
815 | static inline int prcmu_get_ddr_opp(void) | ||
816 | { | ||
817 | return DDR_100_OPP; | ||
818 | } | ||
819 | |||
820 | static inline unsigned long prcmu_qos_get_cpufreq_opp_delay(void) | ||
821 | { | ||
822 | return 0; | ||
823 | } | ||
824 | |||
825 | static inline void prcmu_qos_set_cpufreq_opp_delay(unsigned long n) {} | ||
826 | |||
827 | static inline int prcmu_set_hwacc(u16 hw_acc_dev, u8 state) | ||
828 | { | ||
829 | return 0; | ||
830 | } | ||
831 | |||
832 | static inline void prcmu_configure_auto_pm(struct prcmu_auto_pm_config *sleep, | ||
833 | struct prcmu_auto_pm_config *idle) | ||
834 | { | ||
835 | } | ||
836 | |||
837 | static inline bool prcmu_is_auto_pm_enabled(void) | ||
838 | { | ||
839 | return false; | ||
840 | } | ||
841 | |||
842 | static inline int prcmu_config_clkout(u8 clkout, u8 source, u8 div) | ||
843 | { | ||
844 | return 0; | ||
845 | } | ||
846 | |||
847 | static inline int prcmu_request_clock(u8 clock, bool enable) | ||
848 | { | ||
849 | return 0; | ||
850 | } | ||
851 | |||
852 | static inline int prcmu_set_clock_divider(u8 clock, u8 divider) | ||
853 | { | ||
854 | return 0; | ||
855 | } | ||
856 | |||
857 | int prcmu_config_esram0_deep_sleep(u8 state) | ||
858 | { | ||
859 | return 0; | ||
860 | } | ||
861 | |||
862 | static inline int prcmu_config_hotdog(u8 threshold) | ||
863 | { | ||
864 | return 0; | ||
865 | } | ||
866 | |||
867 | static inline int prcmu_config_hotmon(u8 low, u8 high) | ||
868 | { | ||
869 | return 0; | ||
870 | } | ||
871 | |||
872 | static inline int prcmu_start_temp_sense(u16 cycles32k) | ||
873 | { | ||
874 | return 0; | ||
875 | } | ||
876 | |||
877 | static inline int prcmu_stop_temp_sense(void) | ||
878 | { | ||
879 | return 0; | ||
880 | } | ||
881 | |||
882 | static inline int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size) | ||
883 | { | ||
884 | return -ENOSYS; | ||
885 | } | ||
886 | |||
887 | static inline int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size) | ||
888 | { | ||
889 | return -ENOSYS; | ||
890 | } | ||
891 | |||
892 | static inline void prcmu_ac_wake_req(void) {} | ||
893 | |||
894 | static inline void prcmu_ac_sleep_req(void) {} | ||
895 | |||
896 | static inline void prcmu_system_reset(u16 reset_code) {} | ||
897 | |||
898 | static inline void prcmu_modem_reset(void) {} | ||
899 | |||
900 | static inline bool prcmu_is_ac_wake_requested(void) | ||
901 | { | ||
902 | return false; | ||
903 | } | ||
904 | |||
905 | #ifndef CONFIG_UX500_SOC_DB5500 | ||
906 | static inline int prcmu_set_display_clocks(void) | ||
907 | { | ||
908 | return 0; | ||
909 | } | ||
910 | |||
911 | static inline int prcmu_disable_dsipll(void) | ||
912 | { | ||
913 | return 0; | ||
914 | } | ||
915 | |||
916 | static inline int prcmu_enable_dsipll(void) | ||
917 | { | ||
918 | return 0; | ||
919 | } | ||
920 | #endif | ||
921 | |||
922 | static inline int prcmu_enable_spi2(void) | ||
923 | { | ||
924 | return 0; | ||
925 | } | ||
926 | |||
927 | static inline int prcmu_disable_spi2(void) | ||
928 | { | ||
929 | return 0; | ||
930 | } | ||
931 | |||
932 | #endif /* !CONFIG_MFD_DB8500_PRCMU */ | ||
933 | |||
934 | #ifdef CONFIG_UX500_PRCMU_QOS_POWER | ||
935 | int prcmu_qos_requirement(int pm_qos_class); | ||
936 | int prcmu_qos_add_requirement(int pm_qos_class, char *name, s32 value); | ||
937 | int prcmu_qos_update_requirement(int pm_qos_class, char *name, s32 new_value); | ||
938 | void prcmu_qos_remove_requirement(int pm_qos_class, char *name); | ||
939 | int prcmu_qos_add_notifier(int prcmu_qos_class, | ||
940 | struct notifier_block *notifier); | ||
941 | int prcmu_qos_remove_notifier(int prcmu_qos_class, | ||
942 | struct notifier_block *notifier); | ||
943 | #else | ||
944 | static inline int prcmu_qos_requirement(int prcmu_qos_class) | ||
945 | { | ||
946 | return 0; | ||
947 | } | ||
948 | |||
949 | static inline int prcmu_qos_add_requirement(int prcmu_qos_class, | ||
950 | char *name, s32 value) | ||
951 | { | ||
952 | return 0; | ||
953 | } | ||
954 | |||
955 | static inline int prcmu_qos_update_requirement(int prcmu_qos_class, | ||
956 | char *name, s32 new_value) | ||
957 | { | ||
958 | return 0; | ||
959 | } | ||
960 | |||
961 | static inline void prcmu_qos_remove_requirement(int prcmu_qos_class, char *name) | ||
962 | { | ||
963 | } | ||
964 | |||
965 | static inline int prcmu_qos_add_notifier(int prcmu_qos_class, | ||
966 | struct notifier_block *notifier) | ||
967 | { | ||
968 | return 0; | ||
969 | } | ||
970 | static inline int prcmu_qos_remove_notifier(int prcmu_qos_class, | ||
971 | struct notifier_block *notifier) | ||
972 | { | ||
973 | return 0; | ||
974 | } | ||
975 | |||
976 | #endif | ||
977 | |||
978 | #endif /* __MFD_DB8500_PRCMU_H */ | ||
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h index 8e70310ee945..5a90266c3a5a 100644 --- a/include/linux/mfd/tmio.h +++ b/include/linux/mfd/tmio.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/fb.h> | 4 | #include <linux/fb.h> |
5 | #include <linux/io.h> | 5 | #include <linux/io.h> |
6 | #include <linux/platform_device.h> | 6 | #include <linux/platform_device.h> |
7 | #include <linux/pm_runtime.h> | ||
7 | 8 | ||
8 | #define tmio_ioread8(addr) readb(addr) | 9 | #define tmio_ioread8(addr) readb(addr) |
9 | #define tmio_ioread16(addr) readw(addr) | 10 | #define tmio_ioread16(addr) readw(addr) |
@@ -61,6 +62,12 @@ | |||
61 | * Some controllers can support SDIO IRQ signalling. | 62 | * Some controllers can support SDIO IRQ signalling. |
62 | */ | 63 | */ |
63 | #define TMIO_MMC_SDIO_IRQ (1 << 2) | 64 | #define TMIO_MMC_SDIO_IRQ (1 << 2) |
65 | /* | ||
66 | * Some platforms can detect card insertion events with controller powered | ||
67 | * down, in which case they have to call tmio_mmc_cd_wakeup() to power up the | ||
68 | * controller and report the event to the driver. | ||
69 | */ | ||
70 | #define TMIO_MMC_HAS_COLD_CD (1 << 3) | ||
64 | 71 | ||
65 | int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); | 72 | int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); |
66 | int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); | 73 | int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); |
@@ -82,11 +89,21 @@ struct tmio_mmc_data { | |||
82 | unsigned long flags; | 89 | unsigned long flags; |
83 | u32 ocr_mask; /* available voltages */ | 90 | u32 ocr_mask; /* available voltages */ |
84 | struct tmio_mmc_dma *dma; | 91 | struct tmio_mmc_dma *dma; |
92 | struct device *dev; | ||
93 | bool power; | ||
85 | void (*set_pwr)(struct platform_device *host, int state); | 94 | void (*set_pwr)(struct platform_device *host, int state); |
86 | void (*set_clk_div)(struct platform_device *host, int state); | 95 | void (*set_clk_div)(struct platform_device *host, int state); |
87 | int (*get_cd)(struct platform_device *host); | 96 | int (*get_cd)(struct platform_device *host); |
88 | }; | 97 | }; |
89 | 98 | ||
99 | static inline void tmio_mmc_cd_wakeup(struct tmio_mmc_data *pdata) | ||
100 | { | ||
101 | if (pdata && !pdata->power) { | ||
102 | pdata->power = true; | ||
103 | pm_runtime_get(pdata->dev); | ||
104 | } | ||
105 | } | ||
106 | |||
90 | /* | 107 | /* |
91 | * data for the NAND controller | 108 | * data for the NAND controller |
92 | */ | 109 | */ |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 6507dde38b16..8eb969ebf904 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -153,6 +153,7 @@ extern pgprot_t protection_map[16]; | |||
153 | #define FAULT_FLAG_MKWRITE 0x04 /* Fault was mkwrite of existing pte */ | 153 | #define FAULT_FLAG_MKWRITE 0x04 /* Fault was mkwrite of existing pte */ |
154 | #define FAULT_FLAG_ALLOW_RETRY 0x08 /* Retry fault if blocking */ | 154 | #define FAULT_FLAG_ALLOW_RETRY 0x08 /* Retry fault if blocking */ |
155 | #define FAULT_FLAG_RETRY_NOWAIT 0x10 /* Don't drop mmap_sem and wait when retrying */ | 155 | #define FAULT_FLAG_RETRY_NOWAIT 0x10 /* Don't drop mmap_sem and wait when retrying */ |
156 | #define FAULT_FLAG_KILLABLE 0x20 /* The fault task is in SIGKILL killable region */ | ||
156 | 157 | ||
157 | /* | 158 | /* |
158 | * This interface is used by x86 PAT code to identify a pfn mapping that is | 159 | * This interface is used by x86 PAT code to identify a pfn mapping that is |
@@ -604,10 +605,6 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma) | |||
604 | #define NODE_NOT_IN_PAGE_FLAGS | 605 | #define NODE_NOT_IN_PAGE_FLAGS |
605 | #endif | 606 | #endif |
606 | 607 | ||
607 | #ifndef PFN_SECTION_SHIFT | ||
608 | #define PFN_SECTION_SHIFT 0 | ||
609 | #endif | ||
610 | |||
611 | /* | 608 | /* |
612 | * Define the bit shifts to access each section. For non-existent | 609 | * Define the bit shifts to access each section. For non-existent |
613 | * sections we define the shift as 0; that plus a 0 mask ensures | 610 | * sections we define the shift as 0; that plus a 0 mask ensures |
@@ -681,6 +678,12 @@ static inline struct zone *page_zone(struct page *page) | |||
681 | } | 678 | } |
682 | 679 | ||
683 | #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) | 680 | #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) |
681 | static inline void set_page_section(struct page *page, unsigned long section) | ||
682 | { | ||
683 | page->flags &= ~(SECTIONS_MASK << SECTIONS_PGSHIFT); | ||
684 | page->flags |= (section & SECTIONS_MASK) << SECTIONS_PGSHIFT; | ||
685 | } | ||
686 | |||
684 | static inline unsigned long page_to_section(struct page *page) | 687 | static inline unsigned long page_to_section(struct page *page) |
685 | { | 688 | { |
686 | return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK; | 689 | return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK; |
@@ -699,18 +702,14 @@ static inline void set_page_node(struct page *page, unsigned long node) | |||
699 | page->flags |= (node & NODES_MASK) << NODES_PGSHIFT; | 702 | page->flags |= (node & NODES_MASK) << NODES_PGSHIFT; |
700 | } | 703 | } |
701 | 704 | ||
702 | static inline void set_page_section(struct page *page, unsigned long section) | ||
703 | { | ||
704 | page->flags &= ~(SECTIONS_MASK << SECTIONS_PGSHIFT); | ||
705 | page->flags |= (section & SECTIONS_MASK) << SECTIONS_PGSHIFT; | ||
706 | } | ||
707 | |||
708 | static inline void set_page_links(struct page *page, enum zone_type zone, | 705 | static inline void set_page_links(struct page *page, enum zone_type zone, |
709 | unsigned long node, unsigned long pfn) | 706 | unsigned long node, unsigned long pfn) |
710 | { | 707 | { |
711 | set_page_zone(page, zone); | 708 | set_page_zone(page, zone); |
712 | set_page_node(page, node); | 709 | set_page_node(page, node); |
710 | #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) | ||
713 | set_page_section(page, pfn_to_section_nr(pfn)); | 711 | set_page_section(page, pfn_to_section_nr(pfn)); |
712 | #endif | ||
714 | } | 713 | } |
715 | 714 | ||
716 | /* | 715 | /* |
@@ -862,26 +861,18 @@ extern void pagefault_out_of_memory(void); | |||
862 | #define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) | 861 | #define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) |
863 | 862 | ||
864 | /* | 863 | /* |
865 | * Flags passed to show_mem() and __show_free_areas() to suppress output in | 864 | * Flags passed to show_mem() and show_free_areas() to suppress output in |
866 | * various contexts. | 865 | * various contexts. |
867 | */ | 866 | */ |
868 | #define SHOW_MEM_FILTER_NODES (0x0001u) /* filter disallowed nodes */ | 867 | #define SHOW_MEM_FILTER_NODES (0x0001u) /* filter disallowed nodes */ |
869 | 868 | ||
870 | extern void show_free_areas(void); | 869 | extern void show_free_areas(unsigned int flags); |
871 | extern void __show_free_areas(unsigned int flags); | 870 | extern bool skip_free_areas_node(unsigned int flags, int nid); |
872 | 871 | ||
873 | int shmem_lock(struct file *file, int lock, struct user_struct *user); | 872 | int shmem_lock(struct file *file, int lock, struct user_struct *user); |
874 | struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags); | 873 | struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags); |
875 | int shmem_zero_setup(struct vm_area_struct *); | 874 | int shmem_zero_setup(struct vm_area_struct *); |
876 | 875 | ||
877 | #ifndef CONFIG_MMU | ||
878 | extern unsigned long shmem_get_unmapped_area(struct file *file, | ||
879 | unsigned long addr, | ||
880 | unsigned long len, | ||
881 | unsigned long pgoff, | ||
882 | unsigned long flags); | ||
883 | #endif | ||
884 | |||
885 | extern int can_do_mlock(void); | 876 | extern int can_do_mlock(void); |
886 | extern int user_shm_lock(size_t, struct user_struct *); | 877 | extern int user_shm_lock(size_t, struct user_struct *); |
887 | extern void user_shm_unlock(size_t, struct user_struct *); | 878 | extern void user_shm_unlock(size_t, struct user_struct *); |
@@ -894,8 +885,6 @@ struct zap_details { | |||
894 | struct address_space *check_mapping; /* Check page->mapping if set */ | 885 | struct address_space *check_mapping; /* Check page->mapping if set */ |
895 | pgoff_t first_index; /* Lowest page->index to unmap */ | 886 | pgoff_t first_index; /* Lowest page->index to unmap */ |
896 | pgoff_t last_index; /* Highest page->index to unmap */ | 887 | pgoff_t last_index; /* Highest page->index to unmap */ |
897 | spinlock_t *i_mmap_lock; /* For unmap_mapping_range: */ | ||
898 | unsigned long truncate_count; /* Compare vm_truncate_count */ | ||
899 | }; | 888 | }; |
900 | 889 | ||
901 | struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, | 890 | struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, |
@@ -905,7 +894,7 @@ int zap_vma_ptes(struct vm_area_struct *vma, unsigned long address, | |||
905 | unsigned long size); | 894 | unsigned long size); |
906 | unsigned long zap_page_range(struct vm_area_struct *vma, unsigned long address, | 895 | unsigned long zap_page_range(struct vm_area_struct *vma, unsigned long address, |
907 | unsigned long size, struct zap_details *); | 896 | unsigned long size, struct zap_details *); |
908 | unsigned long unmap_vmas(struct mmu_gather **tlb, | 897 | unsigned long unmap_vmas(struct mmu_gather *tlb, |
909 | struct vm_area_struct *start_vma, unsigned long start_addr, | 898 | struct vm_area_struct *start_vma, unsigned long start_addr, |
910 | unsigned long end_addr, unsigned long *nr_accounted, | 899 | unsigned long end_addr, unsigned long *nr_accounted, |
911 | struct zap_details *); | 900 | struct zap_details *); |
@@ -1056,65 +1045,35 @@ int __get_user_pages_fast(unsigned long start, int nr_pages, int write, | |||
1056 | /* | 1045 | /* |
1057 | * per-process(per-mm_struct) statistics. | 1046 | * per-process(per-mm_struct) statistics. |
1058 | */ | 1047 | */ |
1059 | #if defined(SPLIT_RSS_COUNTING) | ||
1060 | /* | ||
1061 | * The mm counters are not protected by its page_table_lock, | ||
1062 | * so must be incremented atomically. | ||
1063 | */ | ||
1064 | static inline void set_mm_counter(struct mm_struct *mm, int member, long value) | 1048 | static inline void set_mm_counter(struct mm_struct *mm, int member, long value) |
1065 | { | 1049 | { |
1066 | atomic_long_set(&mm->rss_stat.count[member], value); | 1050 | atomic_long_set(&mm->rss_stat.count[member], value); |
1067 | } | 1051 | } |
1068 | 1052 | ||
1053 | #if defined(SPLIT_RSS_COUNTING) | ||
1069 | unsigned long get_mm_counter(struct mm_struct *mm, int member); | 1054 | unsigned long get_mm_counter(struct mm_struct *mm, int member); |
1070 | 1055 | #else | |
1071 | static inline void add_mm_counter(struct mm_struct *mm, int member, long value) | ||
1072 | { | ||
1073 | atomic_long_add(value, &mm->rss_stat.count[member]); | ||
1074 | } | ||
1075 | |||
1076 | static inline void inc_mm_counter(struct mm_struct *mm, int member) | ||
1077 | { | ||
1078 | atomic_long_inc(&mm->rss_stat.count[member]); | ||
1079 | } | ||
1080 | |||
1081 | static inline void dec_mm_counter(struct mm_struct *mm, int member) | ||
1082 | { | ||
1083 | atomic_long_dec(&mm->rss_stat.count[member]); | ||
1084 | } | ||
1085 | |||
1086 | #else /* !USE_SPLIT_PTLOCKS */ | ||
1087 | /* | ||
1088 | * The mm counters are protected by its page_table_lock, | ||
1089 | * so can be incremented directly. | ||
1090 | */ | ||
1091 | static inline void set_mm_counter(struct mm_struct *mm, int member, long value) | ||
1092 | { | ||
1093 | mm->rss_stat.count[member] = value; | ||
1094 | } | ||
1095 | |||
1096 | static inline unsigned long get_mm_counter(struct mm_struct *mm, int member) | 1056 | static inline unsigned long get_mm_counter(struct mm_struct *mm, int member) |
1097 | { | 1057 | { |
1098 | return mm->rss_stat.count[member]; | 1058 | return atomic_long_read(&mm->rss_stat.count[member]); |
1099 | } | 1059 | } |
1060 | #endif | ||
1100 | 1061 | ||
1101 | static inline void add_mm_counter(struct mm_struct *mm, int member, long value) | 1062 | static inline void add_mm_counter(struct mm_struct *mm, int member, long value) |
1102 | { | 1063 | { |
1103 | mm->rss_stat.count[member] += value; | 1064 | atomic_long_add(value, &mm->rss_stat.count[member]); |
1104 | } | 1065 | } |
1105 | 1066 | ||
1106 | static inline void inc_mm_counter(struct mm_struct *mm, int member) | 1067 | static inline void inc_mm_counter(struct mm_struct *mm, int member) |
1107 | { | 1068 | { |
1108 | mm->rss_stat.count[member]++; | 1069 | atomic_long_inc(&mm->rss_stat.count[member]); |
1109 | } | 1070 | } |
1110 | 1071 | ||
1111 | static inline void dec_mm_counter(struct mm_struct *mm, int member) | 1072 | static inline void dec_mm_counter(struct mm_struct *mm, int member) |
1112 | { | 1073 | { |
1113 | mm->rss_stat.count[member]--; | 1074 | atomic_long_dec(&mm->rss_stat.count[member]); |
1114 | } | 1075 | } |
1115 | 1076 | ||
1116 | #endif /* !USE_SPLIT_PTLOCKS */ | ||
1117 | |||
1118 | static inline unsigned long get_mm_rss(struct mm_struct *mm) | 1077 | static inline unsigned long get_mm_rss(struct mm_struct *mm) |
1119 | { | 1078 | { |
1120 | return get_mm_counter(mm, MM_FILEPAGES) + | 1079 | return get_mm_counter(mm, MM_FILEPAGES) + |
@@ -1163,13 +1122,24 @@ static inline void sync_mm_rss(struct task_struct *task, struct mm_struct *mm) | |||
1163 | #endif | 1122 | #endif |
1164 | 1123 | ||
1165 | /* | 1124 | /* |
1125 | * This struct is used to pass information from page reclaim to the shrinkers. | ||
1126 | * We consolidate the values for easier extention later. | ||
1127 | */ | ||
1128 | struct shrink_control { | ||
1129 | gfp_t gfp_mask; | ||
1130 | |||
1131 | /* How many slab objects shrinker() should scan and try to reclaim */ | ||
1132 | unsigned long nr_to_scan; | ||
1133 | }; | ||
1134 | |||
1135 | /* | ||
1166 | * A callback you can register to apply pressure to ageable caches. | 1136 | * A callback you can register to apply pressure to ageable caches. |
1167 | * | 1137 | * |
1168 | * 'shrink' is passed a count 'nr_to_scan' and a 'gfpmask'. It should | 1138 | * 'sc' is passed shrink_control which includes a count 'nr_to_scan' |
1169 | * look through the least-recently-used 'nr_to_scan' entries and | 1139 | * and a 'gfpmask'. It should look through the least-recently-used |
1170 | * attempt to free them up. It should return the number of objects | 1140 | * 'nr_to_scan' entries and attempt to free them up. It should return |
1171 | * which remain in the cache. If it returns -1, it means it cannot do | 1141 | * the number of objects which remain in the cache. If it returns -1, it means |
1172 | * any scanning at this time (eg. there is a risk of deadlock). | 1142 | * it cannot do any scanning at this time (eg. there is a risk of deadlock). |
1173 | * | 1143 | * |
1174 | * The 'gfpmask' refers to the allocation we are currently trying to | 1144 | * The 'gfpmask' refers to the allocation we are currently trying to |
1175 | * fulfil. | 1145 | * fulfil. |
@@ -1178,7 +1148,7 @@ static inline void sync_mm_rss(struct task_struct *task, struct mm_struct *mm) | |||
1178 | * querying the cache size, so a fastpath for that case is appropriate. | 1148 | * querying the cache size, so a fastpath for that case is appropriate. |
1179 | */ | 1149 | */ |
1180 | struct shrinker { | 1150 | struct shrinker { |
1181 | int (*shrink)(struct shrinker *, int nr_to_scan, gfp_t gfp_mask); | 1151 | int (*shrink)(struct shrinker *, struct shrink_control *sc); |
1182 | int seeks; /* seeks to recreate an obj */ | 1152 | int seeks; /* seeks to recreate an obj */ |
1183 | 1153 | ||
1184 | /* These are for internal use */ | 1154 | /* These are for internal use */ |
@@ -1380,7 +1350,7 @@ extern void set_dma_reserve(unsigned long new_dma_reserve); | |||
1380 | extern void memmap_init_zone(unsigned long, int, unsigned long, | 1350 | extern void memmap_init_zone(unsigned long, int, unsigned long, |
1381 | unsigned long, enum memmap_context); | 1351 | unsigned long, enum memmap_context); |
1382 | extern void setup_per_zone_wmarks(void); | 1352 | extern void setup_per_zone_wmarks(void); |
1383 | extern void calculate_zone_inactive_ratio(struct zone *zone); | 1353 | extern int __meminit init_per_zone_wmark_min(void); |
1384 | extern void mem_init(void); | 1354 | extern void mem_init(void); |
1385 | extern void __init mmap_init(void); | 1355 | extern void __init mmap_init(void); |
1386 | extern void show_mem(unsigned int flags); | 1356 | extern void show_mem(unsigned int flags); |
@@ -1388,6 +1358,8 @@ extern void si_meminfo(struct sysinfo * val); | |||
1388 | extern void si_meminfo_node(struct sysinfo *val, int nid); | 1358 | extern void si_meminfo_node(struct sysinfo *val, int nid); |
1389 | extern int after_bootmem; | 1359 | extern int after_bootmem; |
1390 | 1360 | ||
1361 | extern void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...); | ||
1362 | |||
1391 | extern void setup_per_cpu_pageset(void); | 1363 | extern void setup_per_cpu_pageset(void); |
1392 | 1364 | ||
1393 | extern void zone_pcp_update(struct zone *zone); | 1365 | extern void zone_pcp_update(struct zone *zone); |
@@ -1517,15 +1489,17 @@ unsigned long ra_submit(struct file_ra_state *ra, | |||
1517 | struct address_space *mapping, | 1489 | struct address_space *mapping, |
1518 | struct file *filp); | 1490 | struct file *filp); |
1519 | 1491 | ||
1520 | /* Do stack extension */ | 1492 | /* Generic expand stack which grows the stack according to GROWS{UP,DOWN} */ |
1521 | extern int expand_stack(struct vm_area_struct *vma, unsigned long address); | 1493 | extern int expand_stack(struct vm_area_struct *vma, unsigned long address); |
1494 | |||
1495 | /* CONFIG_STACK_GROWSUP still needs to to grow downwards at some places */ | ||
1496 | extern int expand_downwards(struct vm_area_struct *vma, | ||
1497 | unsigned long address); | ||
1522 | #if VM_GROWSUP | 1498 | #if VM_GROWSUP |
1523 | extern int expand_upwards(struct vm_area_struct *vma, unsigned long address); | 1499 | extern int expand_upwards(struct vm_area_struct *vma, unsigned long address); |
1524 | #else | 1500 | #else |
1525 | #define expand_upwards(vma, address) do { } while (0) | 1501 | #define expand_upwards(vma, address) do { } while (0) |
1526 | #endif | 1502 | #endif |
1527 | extern int expand_stack_downwards(struct vm_area_struct *vma, | ||
1528 | unsigned long address); | ||
1529 | 1503 | ||
1530 | /* Look up the first VMA which satisfies addr < vm_end, NULL if none. */ | 1504 | /* Look up the first VMA which satisfies addr < vm_end, NULL if none. */ |
1531 | extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr); | 1505 | extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr); |
@@ -1627,8 +1601,9 @@ int in_gate_area_no_mm(unsigned long addr); | |||
1627 | 1601 | ||
1628 | int drop_caches_sysctl_handler(struct ctl_table *, int, | 1602 | int drop_caches_sysctl_handler(struct ctl_table *, int, |
1629 | void __user *, size_t *, loff_t *); | 1603 | void __user *, size_t *, loff_t *); |
1630 | unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask, | 1604 | unsigned long shrink_slab(struct shrink_control *shrink, |
1631 | unsigned long lru_pages); | 1605 | unsigned long nr_pages_scanned, |
1606 | unsigned long lru_pages); | ||
1632 | 1607 | ||
1633 | #ifndef CONFIG_MMU | 1608 | #ifndef CONFIG_MMU |
1634 | #define randomize_va_space 0 | 1609 | #define randomize_va_space 0 |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 02aa5619709b..071d459e866b 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -175,7 +175,6 @@ struct vm_area_struct { | |||
175 | units, *not* PAGE_CACHE_SIZE */ | 175 | units, *not* PAGE_CACHE_SIZE */ |
176 | struct file * vm_file; /* File we map to (can be NULL). */ | 176 | struct file * vm_file; /* File we map to (can be NULL). */ |
177 | void * vm_private_data; /* was vm_pte (shared mem) */ | 177 | void * vm_private_data; /* was vm_pte (shared mem) */ |
178 | unsigned long vm_truncate_count;/* truncate_count or restart_addr */ | ||
179 | 178 | ||
180 | #ifndef CONFIG_MMU | 179 | #ifndef CONFIG_MMU |
181 | struct vm_region *vm_region; /* NOMMU mapping region */ | 180 | struct vm_region *vm_region; /* NOMMU mapping region */ |
@@ -205,19 +204,16 @@ enum { | |||
205 | 204 | ||
206 | #if USE_SPLIT_PTLOCKS && defined(CONFIG_MMU) | 205 | #if USE_SPLIT_PTLOCKS && defined(CONFIG_MMU) |
207 | #define SPLIT_RSS_COUNTING | 206 | #define SPLIT_RSS_COUNTING |
208 | struct mm_rss_stat { | ||
209 | atomic_long_t count[NR_MM_COUNTERS]; | ||
210 | }; | ||
211 | /* per-thread cached information, */ | 207 | /* per-thread cached information, */ |
212 | struct task_rss_stat { | 208 | struct task_rss_stat { |
213 | int events; /* for synchronization threshold */ | 209 | int events; /* for synchronization threshold */ |
214 | int count[NR_MM_COUNTERS]; | 210 | int count[NR_MM_COUNTERS]; |
215 | }; | 211 | }; |
216 | #else /* !USE_SPLIT_PTLOCKS */ | 212 | #endif /* USE_SPLIT_PTLOCKS */ |
213 | |||
217 | struct mm_rss_stat { | 214 | struct mm_rss_stat { |
218 | unsigned long count[NR_MM_COUNTERS]; | 215 | atomic_long_t count[NR_MM_COUNTERS]; |
219 | }; | 216 | }; |
220 | #endif /* !USE_SPLIT_PTLOCKS */ | ||
221 | 217 | ||
222 | struct mm_struct { | 218 | struct mm_struct { |
223 | struct vm_area_struct * mmap; /* list of VMAs */ | 219 | struct vm_area_struct * mmap; /* list of VMAs */ |
@@ -266,8 +262,6 @@ struct mm_struct { | |||
266 | 262 | ||
267 | struct linux_binfmt *binfmt; | 263 | struct linux_binfmt *binfmt; |
268 | 264 | ||
269 | cpumask_t cpu_vm_mask; | ||
270 | |||
271 | /* Architecture-specific MM context */ | 265 | /* Architecture-specific MM context */ |
272 | mm_context_t context; | 266 | mm_context_t context; |
273 | 267 | ||
@@ -317,9 +311,14 @@ struct mm_struct { | |||
317 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 311 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
318 | pgtable_t pmd_huge_pte; /* protected by page_table_lock */ | 312 | pgtable_t pmd_huge_pte; /* protected by page_table_lock */ |
319 | #endif | 313 | #endif |
314 | |||
315 | cpumask_var_t cpu_vm_mask_var; | ||
320 | }; | 316 | }; |
321 | 317 | ||
322 | /* Future-safe accessor for struct mm_struct's cpu_vm_mask. */ | 318 | /* Future-safe accessor for struct mm_struct's cpu_vm_mask. */ |
323 | #define mm_cpumask(mm) (&(mm)->cpu_vm_mask) | 319 | static inline cpumask_t *mm_cpumask(struct mm_struct *mm) |
320 | { | ||
321 | return mm->cpu_vm_mask_var; | ||
322 | } | ||
324 | 323 | ||
325 | #endif /* _LINUX_MM_TYPES_H */ | 324 | #endif /* _LINUX_MM_TYPES_H */ |
diff --git a/include/linux/mmc/Kbuild b/include/linux/mmc/Kbuild new file mode 100644 index 000000000000..1fb26448faa9 --- /dev/null +++ b/include/linux/mmc/Kbuild | |||
@@ -0,0 +1 @@ | |||
header-y += ioctl.h | |||
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index adb4888248be..c6927a4d157f 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #define LINUX_MMC_CARD_H | 11 | #define LINUX_MMC_CARD_H |
12 | 12 | ||
13 | #include <linux/mmc/core.h> | 13 | #include <linux/mmc/core.h> |
14 | #include <linux/mod_devicetable.h> | ||
14 | 15 | ||
15 | struct mmc_cid { | 16 | struct mmc_cid { |
16 | unsigned int manfid; | 17 | unsigned int manfid; |
@@ -29,6 +30,7 @@ struct mmc_csd { | |||
29 | unsigned short cmdclass; | 30 | unsigned short cmdclass; |
30 | unsigned short tacc_clks; | 31 | unsigned short tacc_clks; |
31 | unsigned int tacc_ns; | 32 | unsigned int tacc_ns; |
33 | unsigned int c_size; | ||
32 | unsigned int r2w_factor; | 34 | unsigned int r2w_factor; |
33 | unsigned int max_dtr; | 35 | unsigned int max_dtr; |
34 | unsigned int erase_size; /* In sectors */ | 36 | unsigned int erase_size; /* In sectors */ |
@@ -45,6 +47,10 @@ struct mmc_ext_csd { | |||
45 | u8 rev; | 47 | u8 rev; |
46 | u8 erase_group_def; | 48 | u8 erase_group_def; |
47 | u8 sec_feature_support; | 49 | u8 sec_feature_support; |
50 | u8 rel_sectors; | ||
51 | u8 rel_param; | ||
52 | u8 part_config; | ||
53 | unsigned int part_time; /* Units: ms */ | ||
48 | unsigned int sa_timeout; /* Units: 100ns */ | 54 | unsigned int sa_timeout; /* Units: 100ns */ |
49 | unsigned int hs_max_dtr; | 55 | unsigned int hs_max_dtr; |
50 | unsigned int sectors; | 56 | unsigned int sectors; |
@@ -57,13 +63,18 @@ struct mmc_ext_csd { | |||
57 | bool enhanced_area_en; /* enable bit */ | 63 | bool enhanced_area_en; /* enable bit */ |
58 | unsigned long long enhanced_area_offset; /* Units: Byte */ | 64 | unsigned long long enhanced_area_offset; /* Units: Byte */ |
59 | unsigned int enhanced_area_size; /* Units: KB */ | 65 | unsigned int enhanced_area_size; /* Units: KB */ |
66 | unsigned int boot_size; /* in bytes */ | ||
60 | }; | 67 | }; |
61 | 68 | ||
62 | struct sd_scr { | 69 | struct sd_scr { |
63 | unsigned char sda_vsn; | 70 | unsigned char sda_vsn; |
71 | unsigned char sda_spec3; | ||
64 | unsigned char bus_widths; | 72 | unsigned char bus_widths; |
65 | #define SD_SCR_BUS_WIDTH_1 (1<<0) | 73 | #define SD_SCR_BUS_WIDTH_1 (1<<0) |
66 | #define SD_SCR_BUS_WIDTH_4 (1<<2) | 74 | #define SD_SCR_BUS_WIDTH_4 (1<<2) |
75 | unsigned char cmds; | ||
76 | #define SD_SCR_CMD20_SUPPORT (1<<0) | ||
77 | #define SD_SCR_CMD23_SUPPORT (1<<1) | ||
67 | }; | 78 | }; |
68 | 79 | ||
69 | struct sd_ssr { | 80 | struct sd_ssr { |
@@ -74,6 +85,39 @@ struct sd_ssr { | |||
74 | 85 | ||
75 | struct sd_switch_caps { | 86 | struct sd_switch_caps { |
76 | unsigned int hs_max_dtr; | 87 | unsigned int hs_max_dtr; |
88 | unsigned int uhs_max_dtr; | ||
89 | #define UHS_SDR104_MAX_DTR 208000000 | ||
90 | #define UHS_SDR50_MAX_DTR 100000000 | ||
91 | #define UHS_DDR50_MAX_DTR 50000000 | ||
92 | #define UHS_SDR25_MAX_DTR UHS_DDR50_MAX_DTR | ||
93 | #define UHS_SDR12_MAX_DTR 25000000 | ||
94 | unsigned int sd3_bus_mode; | ||
95 | #define UHS_SDR12_BUS_SPEED 0 | ||
96 | #define UHS_SDR25_BUS_SPEED 1 | ||
97 | #define UHS_SDR50_BUS_SPEED 2 | ||
98 | #define UHS_SDR104_BUS_SPEED 3 | ||
99 | #define UHS_DDR50_BUS_SPEED 4 | ||
100 | |||
101 | #define SD_MODE_UHS_SDR12 (1 << UHS_SDR12_BUS_SPEED) | ||
102 | #define SD_MODE_UHS_SDR25 (1 << UHS_SDR25_BUS_SPEED) | ||
103 | #define SD_MODE_UHS_SDR50 (1 << UHS_SDR50_BUS_SPEED) | ||
104 | #define SD_MODE_UHS_SDR104 (1 << UHS_SDR104_BUS_SPEED) | ||
105 | #define SD_MODE_UHS_DDR50 (1 << UHS_DDR50_BUS_SPEED) | ||
106 | unsigned int sd3_drv_type; | ||
107 | #define SD_DRIVER_TYPE_B 0x01 | ||
108 | #define SD_DRIVER_TYPE_A 0x02 | ||
109 | #define SD_DRIVER_TYPE_C 0x04 | ||
110 | #define SD_DRIVER_TYPE_D 0x08 | ||
111 | unsigned int sd3_curr_limit; | ||
112 | #define SD_SET_CURRENT_LIMIT_200 0 | ||
113 | #define SD_SET_CURRENT_LIMIT_400 1 | ||
114 | #define SD_SET_CURRENT_LIMIT_600 2 | ||
115 | #define SD_SET_CURRENT_LIMIT_800 3 | ||
116 | |||
117 | #define SD_MAX_CURRENT_200 (1 << SD_SET_CURRENT_LIMIT_200) | ||
118 | #define SD_MAX_CURRENT_400 (1 << SD_SET_CURRENT_LIMIT_400) | ||
119 | #define SD_MAX_CURRENT_600 (1 << SD_SET_CURRENT_LIMIT_600) | ||
120 | #define SD_MAX_CURRENT_800 (1 << SD_SET_CURRENT_LIMIT_800) | ||
77 | }; | 121 | }; |
78 | 122 | ||
79 | struct sdio_cccr { | 123 | struct sdio_cccr { |
@@ -118,6 +162,8 @@ struct mmc_card { | |||
118 | #define MMC_STATE_HIGHSPEED (1<<2) /* card is in high speed mode */ | 162 | #define MMC_STATE_HIGHSPEED (1<<2) /* card is in high speed mode */ |
119 | #define MMC_STATE_BLOCKADDR (1<<3) /* card uses block-addressing */ | 163 | #define MMC_STATE_BLOCKADDR (1<<3) /* card uses block-addressing */ |
120 | #define MMC_STATE_HIGHSPEED_DDR (1<<4) /* card is in high speed mode */ | 164 | #define MMC_STATE_HIGHSPEED_DDR (1<<4) /* card is in high speed mode */ |
165 | #define MMC_STATE_ULTRAHIGHSPEED (1<<5) /* card is in ultra high speed mode */ | ||
166 | #define MMC_CARD_SDXC (1<<6) /* card is SDXC */ | ||
121 | unsigned int quirks; /* card quirks */ | 167 | unsigned int quirks; /* card quirks */ |
122 | #define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */ | 168 | #define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */ |
123 | #define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1) /* use func->cur_blksize */ | 169 | #define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1) /* use func->cur_blksize */ |
@@ -125,6 +171,10 @@ struct mmc_card { | |||
125 | #define MMC_QUIRK_NONSTD_SDIO (1<<2) /* non-standard SDIO card attached */ | 171 | #define MMC_QUIRK_NONSTD_SDIO (1<<2) /* non-standard SDIO card attached */ |
126 | /* (missing CIA registers) */ | 172 | /* (missing CIA registers) */ |
127 | #define MMC_QUIRK_BROKEN_CLK_GATING (1<<3) /* clock gating the sdio bus will make card fail */ | 173 | #define MMC_QUIRK_BROKEN_CLK_GATING (1<<3) /* clock gating the sdio bus will make card fail */ |
174 | #define MMC_QUIRK_NONSTD_FUNC_IF (1<<4) /* SDIO card has nonstd function interfaces */ | ||
175 | #define MMC_QUIRK_DISABLE_CD (1<<5) /* disconnect CD/DAT[3] resistor */ | ||
176 | #define MMC_QUIRK_INAND_CMD38 (1<<6) /* iNAND devices have broken CMD38 */ | ||
177 | #define MMC_QUIRK_BLK_NO_CMD23 (1<<7) /* Avoid CMD23 for regular multiblock */ | ||
128 | 178 | ||
129 | unsigned int erase_size; /* erase size in sectors */ | 179 | unsigned int erase_size; /* erase size in sectors */ |
130 | unsigned int erase_shift; /* if erase unit is power 2 */ | 180 | unsigned int erase_shift; /* if erase unit is power 2 */ |
@@ -145,14 +195,100 @@ struct mmc_card { | |||
145 | struct sdio_cccr cccr; /* common card info */ | 195 | struct sdio_cccr cccr; /* common card info */ |
146 | struct sdio_cis cis; /* common tuple info */ | 196 | struct sdio_cis cis; /* common tuple info */ |
147 | struct sdio_func *sdio_func[SDIO_MAX_FUNCS]; /* SDIO functions (devices) */ | 197 | struct sdio_func *sdio_func[SDIO_MAX_FUNCS]; /* SDIO functions (devices) */ |
198 | struct sdio_func *sdio_single_irq; /* SDIO function when only one IRQ active */ | ||
148 | unsigned num_info; /* number of info strings */ | 199 | unsigned num_info; /* number of info strings */ |
149 | const char **info; /* info strings */ | 200 | const char **info; /* info strings */ |
150 | struct sdio_func_tuple *tuples; /* unknown common tuples */ | 201 | struct sdio_func_tuple *tuples; /* unknown common tuples */ |
151 | 202 | ||
203 | unsigned int sd_bus_speed; /* Bus Speed Mode set for the card */ | ||
204 | |||
152 | struct dentry *debugfs_root; | 205 | struct dentry *debugfs_root; |
153 | }; | 206 | }; |
154 | 207 | ||
155 | void mmc_fixup_device(struct mmc_card *dev); | 208 | /* |
209 | * The world is not perfect and supplies us with broken mmc/sdio devices. | ||
210 | * For at least some of these bugs we need a work-around. | ||
211 | */ | ||
212 | |||
213 | struct mmc_fixup { | ||
214 | /* CID-specific fields. */ | ||
215 | const char *name; | ||
216 | |||
217 | /* Valid revision range */ | ||
218 | u64 rev_start, rev_end; | ||
219 | |||
220 | unsigned int manfid; | ||
221 | unsigned short oemid; | ||
222 | |||
223 | /* SDIO-specfic fields. You can use SDIO_ANY_ID here of course */ | ||
224 | u16 cis_vendor, cis_device; | ||
225 | |||
226 | void (*vendor_fixup)(struct mmc_card *card, int data); | ||
227 | int data; | ||
228 | }; | ||
229 | |||
230 | #define CID_MANFID_ANY (-1u) | ||
231 | #define CID_OEMID_ANY ((unsigned short) -1) | ||
232 | #define CID_NAME_ANY (NULL) | ||
233 | |||
234 | #define END_FIXUP { 0 } | ||
235 | |||
236 | #define _FIXUP_EXT(_name, _manfid, _oemid, _rev_start, _rev_end, \ | ||
237 | _cis_vendor, _cis_device, \ | ||
238 | _fixup, _data) \ | ||
239 | { \ | ||
240 | .name = (_name), \ | ||
241 | .manfid = (_manfid), \ | ||
242 | .oemid = (_oemid), \ | ||
243 | .rev_start = (_rev_start), \ | ||
244 | .rev_end = (_rev_end), \ | ||
245 | .cis_vendor = (_cis_vendor), \ | ||
246 | .cis_device = (_cis_device), \ | ||
247 | .vendor_fixup = (_fixup), \ | ||
248 | .data = (_data), \ | ||
249 | } | ||
250 | |||
251 | #define MMC_FIXUP_REV(_name, _manfid, _oemid, _rev_start, _rev_end, \ | ||
252 | _fixup, _data) \ | ||
253 | _FIXUP_EXT(_name, _manfid, \ | ||
254 | _oemid, _rev_start, _rev_end, \ | ||
255 | SDIO_ANY_ID, SDIO_ANY_ID, \ | ||
256 | _fixup, _data) \ | ||
257 | |||
258 | #define MMC_FIXUP(_name, _manfid, _oemid, _fixup, _data) \ | ||
259 | MMC_FIXUP_REV(_name, _manfid, _oemid, 0, -1ull, _fixup, _data) | ||
260 | |||
261 | #define SDIO_FIXUP(_vendor, _device, _fixup, _data) \ | ||
262 | _FIXUP_EXT(CID_NAME_ANY, CID_MANFID_ANY, \ | ||
263 | CID_OEMID_ANY, 0, -1ull, \ | ||
264 | _vendor, _device, \ | ||
265 | _fixup, _data) \ | ||
266 | |||
267 | #define cid_rev(hwrev, fwrev, year, month) \ | ||
268 | (((u64) hwrev) << 40 | \ | ||
269 | ((u64) fwrev) << 32 | \ | ||
270 | ((u64) year) << 16 | \ | ||
271 | ((u64) month)) | ||
272 | |||
273 | #define cid_rev_card(card) \ | ||
274 | cid_rev(card->cid.hwrev, \ | ||
275 | card->cid.fwrev, \ | ||
276 | card->cid.year, \ | ||
277 | card->cid.month) | ||
278 | |||
279 | /* | ||
280 | * Unconditionally quirk add/remove. | ||
281 | */ | ||
282 | |||
283 | static inline void __maybe_unused add_quirk(struct mmc_card *card, int data) | ||
284 | { | ||
285 | card->quirks |= data; | ||
286 | } | ||
287 | |||
288 | static inline void __maybe_unused remove_quirk(struct mmc_card *card, int data) | ||
289 | { | ||
290 | card->quirks &= ~data; | ||
291 | } | ||
156 | 292 | ||
157 | #define mmc_card_mmc(c) ((c)->type == MMC_TYPE_MMC) | 293 | #define mmc_card_mmc(c) ((c)->type == MMC_TYPE_MMC) |
158 | #define mmc_card_sd(c) ((c)->type == MMC_TYPE_SD) | 294 | #define mmc_card_sd(c) ((c)->type == MMC_TYPE_SD) |
@@ -163,12 +299,50 @@ void mmc_fixup_device(struct mmc_card *dev); | |||
163 | #define mmc_card_highspeed(c) ((c)->state & MMC_STATE_HIGHSPEED) | 299 | #define mmc_card_highspeed(c) ((c)->state & MMC_STATE_HIGHSPEED) |
164 | #define mmc_card_blockaddr(c) ((c)->state & MMC_STATE_BLOCKADDR) | 300 | #define mmc_card_blockaddr(c) ((c)->state & MMC_STATE_BLOCKADDR) |
165 | #define mmc_card_ddr_mode(c) ((c)->state & MMC_STATE_HIGHSPEED_DDR) | 301 | #define mmc_card_ddr_mode(c) ((c)->state & MMC_STATE_HIGHSPEED_DDR) |
302 | #define mmc_sd_card_uhs(c) ((c)->state & MMC_STATE_ULTRAHIGHSPEED) | ||
303 | #define mmc_card_ext_capacity(c) ((c)->state & MMC_CARD_SDXC) | ||
166 | 304 | ||
167 | #define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT) | 305 | #define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT) |
168 | #define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY) | 306 | #define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY) |
169 | #define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED) | 307 | #define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED) |
170 | #define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR) | 308 | #define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR) |
171 | #define mmc_card_set_ddr_mode(c) ((c)->state |= MMC_STATE_HIGHSPEED_DDR) | 309 | #define mmc_card_set_ddr_mode(c) ((c)->state |= MMC_STATE_HIGHSPEED_DDR) |
310 | #define mmc_sd_card_set_uhs(c) ((c)->state |= MMC_STATE_ULTRAHIGHSPEED) | ||
311 | #define mmc_card_set_ext_capacity(c) ((c)->state |= MMC_CARD_SDXC) | ||
312 | |||
313 | /* | ||
314 | * Quirk add/remove for MMC products. | ||
315 | */ | ||
316 | |||
317 | static inline void __maybe_unused add_quirk_mmc(struct mmc_card *card, int data) | ||
318 | { | ||
319 | if (mmc_card_mmc(card)) | ||
320 | card->quirks |= data; | ||
321 | } | ||
322 | |||
323 | static inline void __maybe_unused remove_quirk_mmc(struct mmc_card *card, | ||
324 | int data) | ||
325 | { | ||
326 | if (mmc_card_mmc(card)) | ||
327 | card->quirks &= ~data; | ||
328 | } | ||
329 | |||
330 | /* | ||
331 | * Quirk add/remove for SD products. | ||
332 | */ | ||
333 | |||
334 | static inline void __maybe_unused add_quirk_sd(struct mmc_card *card, int data) | ||
335 | { | ||
336 | if (mmc_card_sd(card)) | ||
337 | card->quirks |= data; | ||
338 | } | ||
339 | |||
340 | static inline void __maybe_unused remove_quirk_sd(struct mmc_card *card, | ||
341 | int data) | ||
342 | { | ||
343 | if (mmc_card_sd(card)) | ||
344 | card->quirks &= ~data; | ||
345 | } | ||
172 | 346 | ||
173 | static inline int mmc_card_lenient_fn0(const struct mmc_card *c) | 347 | static inline int mmc_card_lenient_fn0(const struct mmc_card *c) |
174 | { | 348 | { |
@@ -180,6 +354,16 @@ static inline int mmc_blksz_for_byte_mode(const struct mmc_card *c) | |||
180 | return c->quirks & MMC_QUIRK_BLKSZ_FOR_BYTE_MODE; | 354 | return c->quirks & MMC_QUIRK_BLKSZ_FOR_BYTE_MODE; |
181 | } | 355 | } |
182 | 356 | ||
357 | static inline int mmc_card_disable_cd(const struct mmc_card *c) | ||
358 | { | ||
359 | return c->quirks & MMC_QUIRK_DISABLE_CD; | ||
360 | } | ||
361 | |||
362 | static inline int mmc_card_nonstd_func_interface(const struct mmc_card *c) | ||
363 | { | ||
364 | return c->quirks & MMC_QUIRK_NONSTD_FUNC_IF; | ||
365 | } | ||
366 | |||
183 | #define mmc_card_name(c) ((c)->cid.prod_name) | 367 | #define mmc_card_name(c) ((c)->cid.prod_name) |
184 | #define mmc_card_id(c) (dev_name(&(c)->dev)) | 368 | #define mmc_card_id(c) (dev_name(&(c)->dev)) |
185 | 369 | ||
@@ -203,4 +387,7 @@ struct mmc_driver { | |||
203 | extern int mmc_register_driver(struct mmc_driver *); | 387 | extern int mmc_register_driver(struct mmc_driver *); |
204 | extern void mmc_unregister_driver(struct mmc_driver *); | 388 | extern void mmc_unregister_driver(struct mmc_driver *); |
205 | 389 | ||
390 | extern void mmc_fixup_device(struct mmc_card *card, | ||
391 | const struct mmc_fixup *table); | ||
392 | |||
206 | #endif | 393 | #endif |
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index 07f27af4dba5..b6718e549a51 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h | |||
@@ -92,7 +92,7 @@ struct mmc_command { | |||
92 | * actively failing requests | 92 | * actively failing requests |
93 | */ | 93 | */ |
94 | 94 | ||
95 | unsigned int erase_timeout; /* in milliseconds */ | 95 | unsigned int cmd_timeout_ms; /* in milliseconds */ |
96 | 96 | ||
97 | struct mmc_data *data; /* data segment associated with cmd */ | 97 | struct mmc_data *data; /* data segment associated with cmd */ |
98 | struct mmc_request *mrq; /* associated request */ | 98 | struct mmc_request *mrq; /* associated request */ |
@@ -120,6 +120,7 @@ struct mmc_data { | |||
120 | }; | 120 | }; |
121 | 121 | ||
122 | struct mmc_request { | 122 | struct mmc_request { |
123 | struct mmc_command *sbc; /* SET_BLOCK_COUNT for multiblock */ | ||
123 | struct mmc_command *cmd; | 124 | struct mmc_command *cmd; |
124 | struct mmc_data *data; | 125 | struct mmc_data *data; |
125 | struct mmc_command *stop; | 126 | struct mmc_command *stop; |
@@ -133,8 +134,10 @@ struct mmc_card; | |||
133 | 134 | ||
134 | extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *); | 135 | extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *); |
135 | extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int); | 136 | extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int); |
137 | extern int mmc_app_cmd(struct mmc_host *, struct mmc_card *); | ||
136 | extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *, | 138 | extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *, |
137 | struct mmc_command *, int); | 139 | struct mmc_command *, int); |
140 | extern int mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int); | ||
138 | 141 | ||
139 | #define MMC_ERASE_ARG 0x00000000 | 142 | #define MMC_ERASE_ARG 0x00000000 |
140 | #define MMC_SECURE_ERASE_ARG 0x80000000 | 143 | #define MMC_SECURE_ERASE_ARG 0x80000000 |
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index bcb793ec7374..1ee4424462eb 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -50,12 +50,30 @@ struct mmc_ios { | |||
50 | #define MMC_TIMING_LEGACY 0 | 50 | #define MMC_TIMING_LEGACY 0 |
51 | #define MMC_TIMING_MMC_HS 1 | 51 | #define MMC_TIMING_MMC_HS 1 |
52 | #define MMC_TIMING_SD_HS 2 | 52 | #define MMC_TIMING_SD_HS 2 |
53 | #define MMC_TIMING_UHS_SDR12 MMC_TIMING_LEGACY | ||
54 | #define MMC_TIMING_UHS_SDR25 MMC_TIMING_SD_HS | ||
55 | #define MMC_TIMING_UHS_SDR50 3 | ||
56 | #define MMC_TIMING_UHS_SDR104 4 | ||
57 | #define MMC_TIMING_UHS_DDR50 5 | ||
53 | 58 | ||
54 | unsigned char ddr; /* dual data rate used */ | 59 | unsigned char ddr; /* dual data rate used */ |
55 | 60 | ||
56 | #define MMC_SDR_MODE 0 | 61 | #define MMC_SDR_MODE 0 |
57 | #define MMC_1_2V_DDR_MODE 1 | 62 | #define MMC_1_2V_DDR_MODE 1 |
58 | #define MMC_1_8V_DDR_MODE 2 | 63 | #define MMC_1_8V_DDR_MODE 2 |
64 | |||
65 | unsigned char signal_voltage; /* signalling voltage (1.8V or 3.3V) */ | ||
66 | |||
67 | #define MMC_SIGNAL_VOLTAGE_330 0 | ||
68 | #define MMC_SIGNAL_VOLTAGE_180 1 | ||
69 | #define MMC_SIGNAL_VOLTAGE_120 2 | ||
70 | |||
71 | unsigned char drv_type; /* driver type (A, B, C, D) */ | ||
72 | |||
73 | #define MMC_SET_DRIVER_TYPE_B 0 | ||
74 | #define MMC_SET_DRIVER_TYPE_A 1 | ||
75 | #define MMC_SET_DRIVER_TYPE_C 2 | ||
76 | #define MMC_SET_DRIVER_TYPE_D 3 | ||
59 | }; | 77 | }; |
60 | 78 | ||
61 | struct mmc_host_ops { | 79 | struct mmc_host_ops { |
@@ -117,6 +135,10 @@ struct mmc_host_ops { | |||
117 | 135 | ||
118 | /* optional callback for HC quirks */ | 136 | /* optional callback for HC quirks */ |
119 | void (*init_card)(struct mmc_host *host, struct mmc_card *card); | 137 | void (*init_card)(struct mmc_host *host, struct mmc_card *card); |
138 | |||
139 | int (*start_signal_voltage_switch)(struct mmc_host *host, struct mmc_ios *ios); | ||
140 | int (*execute_tuning)(struct mmc_host *host); | ||
141 | void (*enable_preset_value)(struct mmc_host *host, bool enable); | ||
120 | }; | 142 | }; |
121 | 143 | ||
122 | struct mmc_card; | 144 | struct mmc_card; |
@@ -173,6 +195,22 @@ struct mmc_host { | |||
173 | /* DDR mode at 1.2V */ | 195 | /* DDR mode at 1.2V */ |
174 | #define MMC_CAP_POWER_OFF_CARD (1 << 13) /* Can power off after boot */ | 196 | #define MMC_CAP_POWER_OFF_CARD (1 << 13) /* Can power off after boot */ |
175 | #define MMC_CAP_BUS_WIDTH_TEST (1 << 14) /* CMD14/CMD19 bus width ok */ | 197 | #define MMC_CAP_BUS_WIDTH_TEST (1 << 14) /* CMD14/CMD19 bus width ok */ |
198 | #define MMC_CAP_UHS_SDR12 (1 << 15) /* Host supports UHS SDR12 mode */ | ||
199 | #define MMC_CAP_UHS_SDR25 (1 << 16) /* Host supports UHS SDR25 mode */ | ||
200 | #define MMC_CAP_UHS_SDR50 (1 << 17) /* Host supports UHS SDR50 mode */ | ||
201 | #define MMC_CAP_UHS_SDR104 (1 << 18) /* Host supports UHS SDR104 mode */ | ||
202 | #define MMC_CAP_UHS_DDR50 (1 << 19) /* Host supports UHS DDR50 mode */ | ||
203 | #define MMC_CAP_SET_XPC_330 (1 << 20) /* Host supports >150mA current at 3.3V */ | ||
204 | #define MMC_CAP_SET_XPC_300 (1 << 21) /* Host supports >150mA current at 3.0V */ | ||
205 | #define MMC_CAP_SET_XPC_180 (1 << 22) /* Host supports >150mA current at 1.8V */ | ||
206 | #define MMC_CAP_DRIVER_TYPE_A (1 << 23) /* Host supports Driver Type A */ | ||
207 | #define MMC_CAP_DRIVER_TYPE_C (1 << 24) /* Host supports Driver Type C */ | ||
208 | #define MMC_CAP_DRIVER_TYPE_D (1 << 25) /* Host supports Driver Type D */ | ||
209 | #define MMC_CAP_MAX_CURRENT_200 (1 << 26) /* Host max current limit is 200mA */ | ||
210 | #define MMC_CAP_MAX_CURRENT_400 (1 << 27) /* Host max current limit is 400mA */ | ||
211 | #define MMC_CAP_MAX_CURRENT_600 (1 << 28) /* Host max current limit is 600mA */ | ||
212 | #define MMC_CAP_MAX_CURRENT_800 (1 << 29) /* Host max current limit is 800mA */ | ||
213 | #define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */ | ||
176 | 214 | ||
177 | mmc_pm_flag_t pm_caps; /* supported pm features */ | 215 | mmc_pm_flag_t pm_caps; /* supported pm features */ |
178 | 216 | ||
@@ -321,10 +359,19 @@ static inline int mmc_card_is_removable(struct mmc_host *host) | |||
321 | return !(host->caps & MMC_CAP_NONREMOVABLE) && mmc_assume_removable; | 359 | return !(host->caps & MMC_CAP_NONREMOVABLE) && mmc_assume_removable; |
322 | } | 360 | } |
323 | 361 | ||
324 | static inline int mmc_card_is_powered_resumed(struct mmc_host *host) | 362 | static inline int mmc_card_keep_power(struct mmc_host *host) |
325 | { | 363 | { |
326 | return host->pm_flags & MMC_PM_KEEP_POWER; | 364 | return host->pm_flags & MMC_PM_KEEP_POWER; |
327 | } | 365 | } |
328 | 366 | ||
367 | static inline int mmc_card_wake_sdio_irq(struct mmc_host *host) | ||
368 | { | ||
369 | return host->pm_flags & MMC_PM_WAKE_SDIO_IRQ; | ||
370 | } | ||
371 | |||
372 | static inline int mmc_host_cmd23(struct mmc_host *host) | ||
373 | { | ||
374 | return host->caps & MMC_CAP_CMD23; | ||
375 | } | ||
329 | #endif | 376 | #endif |
330 | 377 | ||
diff --git a/include/linux/mmc/ioctl.h b/include/linux/mmc/ioctl.h new file mode 100644 index 000000000000..5baf2983a12f --- /dev/null +++ b/include/linux/mmc/ioctl.h | |||
@@ -0,0 +1,54 @@ | |||
1 | #ifndef LINUX_MMC_IOCTL_H | ||
2 | #define LINUX_MMC_IOCTL_H | ||
3 | struct mmc_ioc_cmd { | ||
4 | /* Implies direction of data. true = write, false = read */ | ||
5 | int write_flag; | ||
6 | |||
7 | /* Application-specific command. true = precede with CMD55 */ | ||
8 | int is_acmd; | ||
9 | |||
10 | __u32 opcode; | ||
11 | __u32 arg; | ||
12 | __u32 response[4]; /* CMD response */ | ||
13 | unsigned int flags; | ||
14 | unsigned int blksz; | ||
15 | unsigned int blocks; | ||
16 | |||
17 | /* | ||
18 | * Sleep at least postsleep_min_us useconds, and at most | ||
19 | * postsleep_max_us useconds *after* issuing command. Needed for | ||
20 | * some read commands for which cards have no other way of indicating | ||
21 | * they're ready for the next command (i.e. there is no equivalent of | ||
22 | * a "busy" indicator for read operations). | ||
23 | */ | ||
24 | unsigned int postsleep_min_us; | ||
25 | unsigned int postsleep_max_us; | ||
26 | |||
27 | /* | ||
28 | * Override driver-computed timeouts. Note the difference in units! | ||
29 | */ | ||
30 | unsigned int data_timeout_ns; | ||
31 | unsigned int cmd_timeout_ms; | ||
32 | |||
33 | /* | ||
34 | * For 64-bit machines, the next member, ``__u64 data_ptr``, wants to | ||
35 | * be 8-byte aligned. Make sure this struct is the same size when | ||
36 | * built for 32-bit. | ||
37 | */ | ||
38 | __u32 __pad; | ||
39 | |||
40 | /* DAT buffer */ | ||
41 | __u64 data_ptr; | ||
42 | }; | ||
43 | #define mmc_ioc_cmd_set_data(ic, ptr) ic.data_ptr = (__u64)(unsigned long) ptr | ||
44 | |||
45 | #define MMC_IOC_CMD _IOWR(MMC_BLOCK_MAJOR, 0, struct mmc_ioc_cmd) | ||
46 | |||
47 | /* | ||
48 | * Since this ioctl is only meant to enhance (and not replace) normal access | ||
49 | * to the mmc bus device, an upper data transfer limit of MMC_IOC_MAX_BYTES | ||
50 | * is enforced per ioctl call. For larger data transfers, use the normal | ||
51 | * block device operations. | ||
52 | */ | ||
53 | #define MMC_IOC_MAX_BYTES (512L * 256) | ||
54 | #endif /* LINUX_MMC_IOCTL_H */ | ||
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 264ba5451e3b..ac26a685cca8 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
@@ -50,6 +50,7 @@ | |||
50 | #define MMC_SET_BLOCKLEN 16 /* ac [31:0] block len R1 */ | 50 | #define MMC_SET_BLOCKLEN 16 /* ac [31:0] block len R1 */ |
51 | #define MMC_READ_SINGLE_BLOCK 17 /* adtc [31:0] data addr R1 */ | 51 | #define MMC_READ_SINGLE_BLOCK 17 /* adtc [31:0] data addr R1 */ |
52 | #define MMC_READ_MULTIPLE_BLOCK 18 /* adtc [31:0] data addr R1 */ | 52 | #define MMC_READ_MULTIPLE_BLOCK 18 /* adtc [31:0] data addr R1 */ |
53 | #define MMC_SEND_TUNING_BLOCK 19 /* adtc R1 */ | ||
53 | 54 | ||
54 | /* class 3 */ | 55 | /* class 3 */ |
55 | #define MMC_WRITE_DAT_UNTIL_STOP 20 /* adtc [31:0] data addr R1 */ | 56 | #define MMC_WRITE_DAT_UNTIL_STOP 20 /* adtc [31:0] data addr R1 */ |
@@ -82,6 +83,12 @@ | |||
82 | #define MMC_APP_CMD 55 /* ac [31:16] RCA R1 */ | 83 | #define MMC_APP_CMD 55 /* ac [31:16] RCA R1 */ |
83 | #define MMC_GEN_CMD 56 /* adtc [0] RD/WR R1 */ | 84 | #define MMC_GEN_CMD 56 /* adtc [0] RD/WR R1 */ |
84 | 85 | ||
86 | static inline bool mmc_op_multi(u32 opcode) | ||
87 | { | ||
88 | return opcode == MMC_WRITE_MULTIPLE_BLOCK || | ||
89 | opcode == MMC_READ_MULTIPLE_BLOCK; | ||
90 | } | ||
91 | |||
85 | /* | 92 | /* |
86 | * MMC_SWITCH argument format: | 93 | * MMC_SWITCH argument format: |
87 | * | 94 | * |
@@ -255,18 +262,23 @@ struct _mmc_csd { | |||
255 | 262 | ||
256 | #define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */ | 263 | #define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */ |
257 | #define EXT_CSD_PARTITION_SUPPORT 160 /* RO */ | 264 | #define EXT_CSD_PARTITION_SUPPORT 160 /* RO */ |
265 | #define EXT_CSD_WR_REL_PARAM 166 /* RO */ | ||
258 | #define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ | 266 | #define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ |
267 | #define EXT_CSD_PART_CONFIG 179 /* R/W */ | ||
259 | #define EXT_CSD_ERASED_MEM_CONT 181 /* RO */ | 268 | #define EXT_CSD_ERASED_MEM_CONT 181 /* RO */ |
260 | #define EXT_CSD_BUS_WIDTH 183 /* R/W */ | 269 | #define EXT_CSD_BUS_WIDTH 183 /* R/W */ |
261 | #define EXT_CSD_HS_TIMING 185 /* R/W */ | 270 | #define EXT_CSD_HS_TIMING 185 /* R/W */ |
262 | #define EXT_CSD_REV 192 /* RO */ | 271 | #define EXT_CSD_REV 192 /* RO */ |
263 | #define EXT_CSD_STRUCTURE 194 /* RO */ | 272 | #define EXT_CSD_STRUCTURE 194 /* RO */ |
264 | #define EXT_CSD_CARD_TYPE 196 /* RO */ | 273 | #define EXT_CSD_CARD_TYPE 196 /* RO */ |
274 | #define EXT_CSD_PART_SWITCH_TIME 199 /* RO */ | ||
265 | #define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ | 275 | #define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ |
266 | #define EXT_CSD_S_A_TIMEOUT 217 /* RO */ | 276 | #define EXT_CSD_S_A_TIMEOUT 217 /* RO */ |
277 | #define EXT_CSD_REL_WR_SEC_C 222 /* RO */ | ||
267 | #define EXT_CSD_HC_WP_GRP_SIZE 221 /* RO */ | 278 | #define EXT_CSD_HC_WP_GRP_SIZE 221 /* RO */ |
268 | #define EXT_CSD_ERASE_TIMEOUT_MULT 223 /* RO */ | 279 | #define EXT_CSD_ERASE_TIMEOUT_MULT 223 /* RO */ |
269 | #define EXT_CSD_HC_ERASE_GRP_SIZE 224 /* RO */ | 280 | #define EXT_CSD_HC_ERASE_GRP_SIZE 224 /* RO */ |
281 | #define EXT_CSD_BOOT_MULT 226 /* RO */ | ||
270 | #define EXT_CSD_SEC_TRIM_MULT 229 /* RO */ | 282 | #define EXT_CSD_SEC_TRIM_MULT 229 /* RO */ |
271 | #define EXT_CSD_SEC_ERASE_MULT 230 /* RO */ | 283 | #define EXT_CSD_SEC_ERASE_MULT 230 /* RO */ |
272 | #define EXT_CSD_SEC_FEATURE_SUPPORT 231 /* RO */ | 284 | #define EXT_CSD_SEC_FEATURE_SUPPORT 231 /* RO */ |
@@ -276,6 +288,12 @@ struct _mmc_csd { | |||
276 | * EXT_CSD field definitions | 288 | * EXT_CSD field definitions |
277 | */ | 289 | */ |
278 | 290 | ||
291 | #define EXT_CSD_WR_REL_PARAM_EN (1<<2) | ||
292 | |||
293 | #define EXT_CSD_PART_CONFIG_ACC_MASK (0x7) | ||
294 | #define EXT_CSD_PART_CONFIG_ACC_BOOT0 (0x1) | ||
295 | #define EXT_CSD_PART_CONFIG_ACC_BOOT1 (0x2) | ||
296 | |||
279 | #define EXT_CSD_CMD_SET_NORMAL (1<<0) | 297 | #define EXT_CSD_CMD_SET_NORMAL (1<<0) |
280 | #define EXT_CSD_CMD_SET_SECURE (1<<1) | 298 | #define EXT_CSD_CMD_SET_SECURE (1<<1) |
281 | #define EXT_CSD_CMD_SET_CPSECURE (1<<2) | 299 | #define EXT_CSD_CMD_SET_CPSECURE (1<<2) |
diff --git a/include/linux/mmc/sd.h b/include/linux/mmc/sd.h index 3fd85e088cc3..7d35d52c3df3 100644 --- a/include/linux/mmc/sd.h +++ b/include/linux/mmc/sd.h | |||
@@ -17,6 +17,7 @@ | |||
17 | /* This is basically the same command as for MMC with some quirks. */ | 17 | /* This is basically the same command as for MMC with some quirks. */ |
18 | #define SD_SEND_RELATIVE_ADDR 3 /* bcr R6 */ | 18 | #define SD_SEND_RELATIVE_ADDR 3 /* bcr R6 */ |
19 | #define SD_SEND_IF_COND 8 /* bcr [11:0] See below R7 */ | 19 | #define SD_SEND_IF_COND 8 /* bcr [11:0] See below R7 */ |
20 | #define SD_SWITCH_VOLTAGE 11 /* ac R1 */ | ||
20 | 21 | ||
21 | /* class 10 */ | 22 | /* class 10 */ |
22 | #define SD_SWITCH 6 /* adtc [31:0] See below R1 */ | 23 | #define SD_SWITCH 6 /* adtc [31:0] See below R1 */ |
@@ -32,6 +33,12 @@ | |||
32 | #define SD_APP_OP_COND 41 /* bcr [31:0] OCR R3 */ | 33 | #define SD_APP_OP_COND 41 /* bcr [31:0] OCR R3 */ |
33 | #define SD_APP_SEND_SCR 51 /* adtc R1 */ | 34 | #define SD_APP_SEND_SCR 51 /* adtc R1 */ |
34 | 35 | ||
36 | /* OCR bit definitions */ | ||
37 | #define SD_OCR_S18R (1 << 24) /* 1.8V switching request */ | ||
38 | #define SD_ROCR_S18A SD_OCR_S18R /* 1.8V switching accepted by card */ | ||
39 | #define SD_OCR_XPC (1 << 28) /* SDXC power control */ | ||
40 | #define SD_OCR_CCS (1 << 30) /* Card Capacity Status */ | ||
41 | |||
35 | /* | 42 | /* |
36 | * SD_SWITCH argument format: | 43 | * SD_SWITCH argument format: |
37 | * | 44 | * |
@@ -59,7 +66,7 @@ | |||
59 | 66 | ||
60 | #define SCR_SPEC_VER_0 0 /* Implements system specification 1.0 - 1.01 */ | 67 | #define SCR_SPEC_VER_0 0 /* Implements system specification 1.0 - 1.01 */ |
61 | #define SCR_SPEC_VER_1 1 /* Implements system specification 1.10 */ | 68 | #define SCR_SPEC_VER_1 1 /* Implements system specification 1.10 */ |
62 | #define SCR_SPEC_VER_2 2 /* Implements system specification 2.00 */ | 69 | #define SCR_SPEC_VER_2 2 /* Implements system specification 2.00-3.0X */ |
63 | 70 | ||
64 | /* | 71 | /* |
65 | * SD bus widths | 72 | * SD bus widths |
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index 83bd9f76709a..6a68c4eb4e44 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h | |||
@@ -85,6 +85,8 @@ struct sdhci_host { | |||
85 | #define SDHCI_QUIRK_NO_HISPD_BIT (1<<29) | 85 | #define SDHCI_QUIRK_NO_HISPD_BIT (1<<29) |
86 | /* Controller treats ADMA descriptors with length 0000h incorrectly */ | 86 | /* Controller treats ADMA descriptors with length 0000h incorrectly */ |
87 | #define SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC (1<<30) | 87 | #define SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC (1<<30) |
88 | /* The read-only detection via SDHCI_PRESENT_STATE register is unstable */ | ||
89 | #define SDHCI_QUIRK_UNSTABLE_RO_DETECT (1<<31) | ||
88 | 90 | ||
89 | int irq; /* Device IRQ */ | 91 | int irq; /* Device IRQ */ |
90 | void __iomem *ioaddr; /* Mapped address */ | 92 | void __iomem *ioaddr; /* Mapped address */ |
@@ -109,11 +111,16 @@ struct sdhci_host { | |||
109 | #define SDHCI_USE_ADMA (1<<1) /* Host is ADMA capable */ | 111 | #define SDHCI_USE_ADMA (1<<1) /* Host is ADMA capable */ |
110 | #define SDHCI_REQ_USE_DMA (1<<2) /* Use DMA for this req. */ | 112 | #define SDHCI_REQ_USE_DMA (1<<2) /* Use DMA for this req. */ |
111 | #define SDHCI_DEVICE_DEAD (1<<3) /* Device unresponsive */ | 113 | #define SDHCI_DEVICE_DEAD (1<<3) /* Device unresponsive */ |
114 | #define SDHCI_SDR50_NEEDS_TUNING (1<<4) /* SDR50 needs tuning */ | ||
115 | #define SDHCI_NEEDS_RETUNING (1<<5) /* Host needs retuning */ | ||
116 | #define SDHCI_AUTO_CMD12 (1<<6) /* Auto CMD12 support */ | ||
117 | #define SDHCI_AUTO_CMD23 (1<<7) /* Auto CMD23 support */ | ||
112 | 118 | ||
113 | unsigned int version; /* SDHCI spec. version */ | 119 | unsigned int version; /* SDHCI spec. version */ |
114 | 120 | ||
115 | unsigned int max_clk; /* Max possible freq (MHz) */ | 121 | unsigned int max_clk; /* Max possible freq (MHz) */ |
116 | unsigned int timeout_clk; /* Timeout freq (KHz) */ | 122 | unsigned int timeout_clk; /* Timeout freq (KHz) */ |
123 | unsigned int clk_mul; /* Clock Muliplier value */ | ||
117 | 124 | ||
118 | unsigned int clock; /* Current clock (MHz) */ | 125 | unsigned int clock; /* Current clock (MHz) */ |
119 | u8 pwr; /* Current voltage */ | 126 | u8 pwr; /* Current voltage */ |
@@ -145,6 +152,14 @@ struct sdhci_host { | |||
145 | unsigned int ocr_avail_sd; | 152 | unsigned int ocr_avail_sd; |
146 | unsigned int ocr_avail_mmc; | 153 | unsigned int ocr_avail_mmc; |
147 | 154 | ||
155 | wait_queue_head_t buf_ready_int; /* Waitqueue for Buffer Read Ready interrupt */ | ||
156 | unsigned int tuning_done; /* Condition flag set when CMD19 succeeds */ | ||
157 | |||
158 | unsigned int tuning_count; /* Timer count for re-tuning */ | ||
159 | unsigned int tuning_mode; /* Re-tuning mode supported by host */ | ||
160 | #define SDHCI_TUNING_MODE_1 0 | ||
161 | struct timer_list tuning_timer; /* Timer for tuning */ | ||
162 | |||
148 | unsigned long private[0] ____cacheline_aligned; | 163 | unsigned long private[0] ____cacheline_aligned; |
149 | }; | 164 | }; |
150 | #endif /* __SDHCI_H */ | 165 | #endif /* __SDHCI_H */ |
diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h index c981b959760f..faf32b6ec185 100644 --- a/include/linux/mmc/sh_mobile_sdhi.h +++ b/include/linux/mmc/sh_mobile_sdhi.h | |||
@@ -3,12 +3,16 @@ | |||
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | 5 | ||
6 | struct platform_device; | ||
7 | struct tmio_mmc_data; | ||
8 | |||
6 | struct sh_mobile_sdhi_info { | 9 | struct sh_mobile_sdhi_info { |
7 | int dma_slave_tx; | 10 | int dma_slave_tx; |
8 | int dma_slave_rx; | 11 | int dma_slave_rx; |
9 | unsigned long tmio_flags; | 12 | unsigned long tmio_flags; |
10 | unsigned long tmio_caps; | 13 | unsigned long tmio_caps; |
11 | u32 tmio_ocr_mask; /* available MMC voltages */ | 14 | u32 tmio_ocr_mask; /* available MMC voltages */ |
15 | struct tmio_mmc_data *pdata; | ||
12 | void (*set_pwr)(struct platform_device *pdev, int state); | 16 | void (*set_pwr)(struct platform_device *pdev, int state); |
13 | int (*get_cd)(struct platform_device *pdev); | 17 | int (*get_cd)(struct platform_device *pdev); |
14 | }; | 18 | }; |
diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h index cc2e7dfea9d7..1d1b1e13f79f 100644 --- a/include/linux/mmu_notifier.h +++ b/include/linux/mmu_notifier.h | |||
@@ -150,7 +150,7 @@ struct mmu_notifier_ops { | |||
150 | * Therefore notifier chains can only be traversed when either | 150 | * Therefore notifier chains can only be traversed when either |
151 | * | 151 | * |
152 | * 1. mmap_sem is held. | 152 | * 1. mmap_sem is held. |
153 | * 2. One of the reverse map locks is held (i_mmap_lock or anon_vma->lock). | 153 | * 2. One of the reverse map locks is held (i_mmap_mutex or anon_vma->mutex). |
154 | * 3. No other concurrent thread can access the list (release) | 154 | * 3. No other concurrent thread can access the list (release) |
155 | */ | 155 | */ |
156 | struct mmu_notifier { | 156 | struct mmu_notifier { |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index e56f835274c9..217bcf6bca77 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -928,9 +928,6 @@ static inline unsigned long early_pfn_to_nid(unsigned long pfn) | |||
928 | #define pfn_to_nid(pfn) (0) | 928 | #define pfn_to_nid(pfn) (0) |
929 | #endif | 929 | #endif |
930 | 930 | ||
931 | #define pfn_to_section_nr(pfn) ((pfn) >> PFN_SECTION_SHIFT) | ||
932 | #define section_nr_to_pfn(sec) ((sec) << PFN_SECTION_SHIFT) | ||
933 | |||
934 | #ifdef CONFIG_SPARSEMEM | 931 | #ifdef CONFIG_SPARSEMEM |
935 | 932 | ||
936 | /* | 933 | /* |
@@ -956,6 +953,12 @@ static inline unsigned long early_pfn_to_nid(unsigned long pfn) | |||
956 | #error Allocator MAX_ORDER exceeds SECTION_SIZE | 953 | #error Allocator MAX_ORDER exceeds SECTION_SIZE |
957 | #endif | 954 | #endif |
958 | 955 | ||
956 | #define pfn_to_section_nr(pfn) ((pfn) >> PFN_SECTION_SHIFT) | ||
957 | #define section_nr_to_pfn(sec) ((sec) << PFN_SECTION_SHIFT) | ||
958 | |||
959 | #define SECTION_ALIGN_UP(pfn) (((pfn) + PAGES_PER_SECTION - 1) & PAGE_SECTION_MASK) | ||
960 | #define SECTION_ALIGN_DOWN(pfn) ((pfn) & PAGE_SECTION_MASK) | ||
961 | |||
959 | struct page; | 962 | struct page; |
960 | struct page_cgroup; | 963 | struct page_cgroup; |
961 | struct mem_section { | 964 | struct mem_section { |
diff --git a/include/linux/mutex.h b/include/linux/mutex.h index c75471db576e..a940fe435aca 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h | |||
@@ -132,6 +132,7 @@ static inline int mutex_is_locked(struct mutex *lock) | |||
132 | */ | 132 | */ |
133 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 133 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
134 | extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass); | 134 | extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass); |
135 | extern void _mutex_lock_nest_lock(struct mutex *lock, struct lockdep_map *nest_lock); | ||
135 | extern int __must_check mutex_lock_interruptible_nested(struct mutex *lock, | 136 | extern int __must_check mutex_lock_interruptible_nested(struct mutex *lock, |
136 | unsigned int subclass); | 137 | unsigned int subclass); |
137 | extern int __must_check mutex_lock_killable_nested(struct mutex *lock, | 138 | extern int __must_check mutex_lock_killable_nested(struct mutex *lock, |
@@ -140,6 +141,13 @@ extern int __must_check mutex_lock_killable_nested(struct mutex *lock, | |||
140 | #define mutex_lock(lock) mutex_lock_nested(lock, 0) | 141 | #define mutex_lock(lock) mutex_lock_nested(lock, 0) |
141 | #define mutex_lock_interruptible(lock) mutex_lock_interruptible_nested(lock, 0) | 142 | #define mutex_lock_interruptible(lock) mutex_lock_interruptible_nested(lock, 0) |
142 | #define mutex_lock_killable(lock) mutex_lock_killable_nested(lock, 0) | 143 | #define mutex_lock_killable(lock) mutex_lock_killable_nested(lock, 0) |
144 | |||
145 | #define mutex_lock_nest_lock(lock, nest_lock) \ | ||
146 | do { \ | ||
147 | typecheck(struct lockdep_map *, &(nest_lock)->dep_map); \ | ||
148 | _mutex_lock_nest_lock(lock, &(nest_lock)->dep_map); \ | ||
149 | } while (0) | ||
150 | |||
143 | #else | 151 | #else |
144 | extern void mutex_lock(struct mutex *lock); | 152 | extern void mutex_lock(struct mutex *lock); |
145 | extern int __must_check mutex_lock_interruptible(struct mutex *lock); | 153 | extern int __must_check mutex_lock_interruptible(struct mutex *lock); |
@@ -148,6 +156,7 @@ extern int __must_check mutex_lock_killable(struct mutex *lock); | |||
148 | # define mutex_lock_nested(lock, subclass) mutex_lock(lock) | 156 | # define mutex_lock_nested(lock, subclass) mutex_lock(lock) |
149 | # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock) | 157 | # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock) |
150 | # define mutex_lock_killable_nested(lock, subclass) mutex_lock_killable(lock) | 158 | # define mutex_lock_killable_nested(lock, subclass) mutex_lock_killable(lock) |
159 | # define mutex_lock_nest_lock(lock, nest_lock) mutex_lock(lock) | ||
151 | #endif | 160 | #endif |
152 | 161 | ||
153 | /* | 162 | /* |
diff --git a/include/linux/oom.h b/include/linux/oom.h index 5e3aa8311c5e..4952fb874ad3 100644 --- a/include/linux/oom.h +++ b/include/linux/oom.h | |||
@@ -40,6 +40,8 @@ enum oom_constraint { | |||
40 | CONSTRAINT_MEMCG, | 40 | CONSTRAINT_MEMCG, |
41 | }; | 41 | }; |
42 | 42 | ||
43 | extern int test_set_oom_score_adj(int new_val); | ||
44 | |||
43 | extern unsigned int oom_badness(struct task_struct *p, struct mem_cgroup *mem, | 45 | extern unsigned int oom_badness(struct task_struct *p, struct mem_cgroup *mem, |
44 | const nodemask_t *nodemask, unsigned long totalpages); | 46 | const nodemask_t *nodemask, unsigned long totalpages); |
45 | extern int try_set_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags); | 47 | extern int try_set_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags); |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index c11950652646..716875e53520 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -219,6 +219,12 @@ static inline struct page *page_cache_alloc_cold(struct address_space *x) | |||
219 | return __page_cache_alloc(mapping_gfp_mask(x)|__GFP_COLD); | 219 | return __page_cache_alloc(mapping_gfp_mask(x)|__GFP_COLD); |
220 | } | 220 | } |
221 | 221 | ||
222 | static inline struct page *page_cache_alloc_readahead(struct address_space *x) | ||
223 | { | ||
224 | return __page_cache_alloc(mapping_gfp_mask(x) | | ||
225 | __GFP_COLD | __GFP_NORETRY | __GFP_NOWARN); | ||
226 | } | ||
227 | |||
222 | typedef int filler_t(void *, struct page *); | 228 | typedef int filler_t(void *, struct page *); |
223 | 229 | ||
224 | extern struct page * find_get_page(struct address_space *mapping, | 230 | extern struct page * find_get_page(struct address_space *mapping, |
@@ -357,6 +363,15 @@ static inline int lock_page_or_retry(struct page *page, struct mm_struct *mm, | |||
357 | */ | 363 | */ |
358 | extern void wait_on_page_bit(struct page *page, int bit_nr); | 364 | extern void wait_on_page_bit(struct page *page, int bit_nr); |
359 | 365 | ||
366 | extern int wait_on_page_bit_killable(struct page *page, int bit_nr); | ||
367 | |||
368 | static inline int wait_on_page_locked_killable(struct page *page) | ||
369 | { | ||
370 | if (PageLocked(page)) | ||
371 | return wait_on_page_bit_killable(page, PG_locked); | ||
372 | return 0; | ||
373 | } | ||
374 | |||
360 | /* | 375 | /* |
361 | * Wait for a page to be unlocked. | 376 | * Wait for a page to be unlocked. |
362 | * | 377 | * |
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h index 46f6ba56fa91..5edc9014263a 100644 --- a/include/linux/percpu_counter.h +++ b/include/linux/percpu_counter.h | |||
@@ -75,7 +75,7 @@ static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc) | |||
75 | barrier(); /* Prevent reloads of fbc->count */ | 75 | barrier(); /* Prevent reloads of fbc->count */ |
76 | if (ret >= 0) | 76 | if (ret >= 0) |
77 | return ret; | 77 | return ret; |
78 | return 1; | 78 | return 0; |
79 | } | 79 | } |
80 | 80 | ||
81 | static inline int percpu_counter_initialized(struct percpu_counter *fbc) | 81 | static inline int percpu_counter_initialized(struct percpu_counter *fbc) |
@@ -133,6 +133,10 @@ static inline s64 percpu_counter_read(struct percpu_counter *fbc) | |||
133 | return fbc->count; | 133 | return fbc->count; |
134 | } | 134 | } |
135 | 135 | ||
136 | /* | ||
137 | * percpu_counter is intended to track positive numbers. In the UP case the | ||
138 | * number should never be negative. | ||
139 | */ | ||
136 | static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc) | 140 | static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc) |
137 | { | 141 | { |
138 | return fbc->count; | 142 | return fbc->count; |
diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h index 808227d40a64..959c14132f46 100644 --- a/include/linux/posix-timers.h +++ b/include/linux/posix-timers.h | |||
@@ -82,6 +82,7 @@ struct k_itimer { | |||
82 | unsigned long expires; | 82 | unsigned long expires; |
83 | } mmtimer; | 83 | } mmtimer; |
84 | struct alarm alarmtimer; | 84 | struct alarm alarmtimer; |
85 | struct rcu_head rcu; | ||
85 | } it; | 86 | } it; |
86 | }; | 87 | }; |
87 | 88 | ||
diff --git a/include/linux/printk.h b/include/linux/printk.h index ee048e77e1ae..0101d55d9651 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef __KERNEL_PRINTK__ | 1 | #ifndef __KERNEL_PRINTK__ |
2 | #define __KERNEL_PRINTK__ | 2 | #define __KERNEL_PRINTK__ |
3 | 3 | ||
4 | #include <linux/init.h> | ||
5 | |||
4 | extern const char linux_banner[]; | 6 | extern const char linux_banner[]; |
5 | extern const char linux_proc_banner[]; | 7 | extern const char linux_proc_banner[]; |
6 | 8 | ||
@@ -113,6 +115,7 @@ extern int dmesg_restrict; | |||
113 | extern int kptr_restrict; | 115 | extern int kptr_restrict; |
114 | 116 | ||
115 | void log_buf_kexec_setup(void); | 117 | void log_buf_kexec_setup(void); |
118 | void __init setup_log_buf(int early); | ||
116 | #else | 119 | #else |
117 | static inline __attribute__ ((format (printf, 1, 0))) | 120 | static inline __attribute__ ((format (printf, 1, 0))) |
118 | int vprintk(const char *s, va_list args) | 121 | int vprintk(const char *s, va_list args) |
@@ -137,6 +140,10 @@ static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, | |||
137 | static inline void log_buf_kexec_setup(void) | 140 | static inline void log_buf_kexec_setup(void) |
138 | { | 141 | { |
139 | } | 142 | } |
143 | |||
144 | static inline void setup_log_buf(int early) | ||
145 | { | ||
146 | } | ||
140 | #endif | 147 | #endif |
141 | 148 | ||
142 | extern void dump_stack(void) __cold; | 149 | extern void dump_stack(void) __cold; |
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index eaf4350c0f90..648c9c58add7 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
@@ -179,6 +179,8 @@ extern void set_mm_exe_file(struct mm_struct *mm, struct file *new_exe_file); | |||
179 | extern struct file *get_mm_exe_file(struct mm_struct *mm); | 179 | extern struct file *get_mm_exe_file(struct mm_struct *mm); |
180 | extern void dup_mm_exe_file(struct mm_struct *oldmm, struct mm_struct *newmm); | 180 | extern void dup_mm_exe_file(struct mm_struct *oldmm, struct mm_struct *newmm); |
181 | 181 | ||
182 | extern struct file *proc_ns_fget(int fd); | ||
183 | |||
182 | #else | 184 | #else |
183 | 185 | ||
184 | #define proc_net_fops_create(net, name, mode, fops) ({ (void)(mode), NULL; }) | 186 | #define proc_net_fops_create(net, name, mode, fops) ({ (void)(mode), NULL; }) |
@@ -241,6 +243,11 @@ static inline void dup_mm_exe_file(struct mm_struct *oldmm, | |||
241 | struct mm_struct *newmm) | 243 | struct mm_struct *newmm) |
242 | {} | 244 | {} |
243 | 245 | ||
246 | static inline struct file *proc_ns_fget(int fd) | ||
247 | { | ||
248 | return ERR_PTR(-EINVAL); | ||
249 | } | ||
250 | |||
244 | #endif /* CONFIG_PROC_FS */ | 251 | #endif /* CONFIG_PROC_FS */ |
245 | 252 | ||
246 | #if !defined(CONFIG_PROC_KCORE) | 253 | #if !defined(CONFIG_PROC_KCORE) |
@@ -252,6 +259,18 @@ kclist_add(struct kcore_list *new, void *addr, size_t size, int type) | |||
252 | extern void kclist_add(struct kcore_list *, void *, size_t, int type); | 259 | extern void kclist_add(struct kcore_list *, void *, size_t, int type); |
253 | #endif | 260 | #endif |
254 | 261 | ||
262 | struct nsproxy; | ||
263 | struct proc_ns_operations { | ||
264 | const char *name; | ||
265 | int type; | ||
266 | void *(*get)(struct task_struct *task); | ||
267 | void (*put)(void *ns); | ||
268 | int (*install)(struct nsproxy *nsproxy, void *ns); | ||
269 | }; | ||
270 | extern const struct proc_ns_operations netns_operations; | ||
271 | extern const struct proc_ns_operations utsns_operations; | ||
272 | extern const struct proc_ns_operations ipcns_operations; | ||
273 | |||
255 | union proc_op { | 274 | union proc_op { |
256 | int (*proc_get_link)(struct inode *, struct path *); | 275 | int (*proc_get_link)(struct inode *, struct path *); |
257 | int (*proc_read)(struct task_struct *task, char *page); | 276 | int (*proc_read)(struct task_struct *task, char *page); |
@@ -270,6 +289,8 @@ struct proc_inode { | |||
270 | struct proc_dir_entry *pde; | 289 | struct proc_dir_entry *pde; |
271 | struct ctl_table_header *sysctl; | 290 | struct ctl_table_header *sysctl; |
272 | struct ctl_table *sysctl_entry; | 291 | struct ctl_table *sysctl_entry; |
292 | void *ns; | ||
293 | const struct proc_ns_operations *ns_ops; | ||
273 | struct inode vfs_inode; | 294 | struct inode vfs_inode; |
274 | }; | 295 | }; |
275 | 296 | ||
@@ -288,12 +309,4 @@ static inline struct net *PDE_NET(struct proc_dir_entry *pde) | |||
288 | return pde->parent->data; | 309 | return pde->parent->data; |
289 | } | 310 | } |
290 | 311 | ||
291 | struct proc_maps_private { | ||
292 | struct pid *pid; | ||
293 | struct task_struct *task; | ||
294 | #ifdef CONFIG_MMU | ||
295 | struct vm_area_struct *tail_vma; | ||
296 | #endif | ||
297 | }; | ||
298 | |||
299 | #endif /* _LINUX_PROC_FS_H */ | 312 | #endif /* _LINUX_PROC_FS_H */ |
diff --git a/include/linux/ptp_classify.h b/include/linux/ptp_classify.h index 943a85ab0020..e07e2742a865 100644 --- a/include/linux/ptp_classify.h +++ b/include/linux/ptp_classify.h | |||
@@ -25,6 +25,7 @@ | |||
25 | 25 | ||
26 | #include <linux/if_ether.h> | 26 | #include <linux/if_ether.h> |
27 | #include <linux/if_vlan.h> | 27 | #include <linux/if_vlan.h> |
28 | #include <linux/ip.h> | ||
28 | #include <linux/filter.h> | 29 | #include <linux/filter.h> |
29 | #ifdef __KERNEL__ | 30 | #ifdef __KERNEL__ |
30 | #include <linux/in.h> | 31 | #include <linux/in.h> |
@@ -58,6 +59,12 @@ | |||
58 | #define OFF_NEXT 6 | 59 | #define OFF_NEXT 6 |
59 | #define OFF_UDP_DST 2 | 60 | #define OFF_UDP_DST 2 |
60 | 61 | ||
62 | #define OFF_PTP_SOURCE_UUID 22 /* PTPv1 only */ | ||
63 | #define OFF_PTP_SEQUENCE_ID 30 | ||
64 | #define OFF_PTP_CONTROL 32 /* PTPv1 only */ | ||
65 | |||
66 | #define IPV4_HLEN(data) (((struct iphdr *)(data + OFF_IHL))->ihl << 2) | ||
67 | |||
61 | #define IP6_HLEN 40 | 68 | #define IP6_HLEN 40 |
62 | #define UDP_HLEN 8 | 69 | #define UDP_HLEN 8 |
63 | 70 | ||
diff --git a/include/linux/ptp_clock.h b/include/linux/ptp_clock.h new file mode 100644 index 000000000000..94e981f810a2 --- /dev/null +++ b/include/linux/ptp_clock.h | |||
@@ -0,0 +1,84 @@ | |||
1 | /* | ||
2 | * PTP 1588 clock support - user space interface | ||
3 | * | ||
4 | * Copyright (C) 2010 OMICRON electronics GmbH | ||
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; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
19 | */ | ||
20 | |||
21 | #ifndef _PTP_CLOCK_H_ | ||
22 | #define _PTP_CLOCK_H_ | ||
23 | |||
24 | #include <linux/ioctl.h> | ||
25 | #include <linux/types.h> | ||
26 | |||
27 | /* PTP_xxx bits, for the flags field within the request structures. */ | ||
28 | #define PTP_ENABLE_FEATURE (1<<0) | ||
29 | #define PTP_RISING_EDGE (1<<1) | ||
30 | #define PTP_FALLING_EDGE (1<<2) | ||
31 | |||
32 | /* | ||
33 | * struct ptp_clock_time - represents a time value | ||
34 | * | ||
35 | * The sign of the seconds field applies to the whole value. The | ||
36 | * nanoseconds field is always unsigned. The reserved field is | ||
37 | * included for sub-nanosecond resolution, should the demand for | ||
38 | * this ever appear. | ||
39 | * | ||
40 | */ | ||
41 | struct ptp_clock_time { | ||
42 | __s64 sec; /* seconds */ | ||
43 | __u32 nsec; /* nanoseconds */ | ||
44 | __u32 reserved; | ||
45 | }; | ||
46 | |||
47 | struct ptp_clock_caps { | ||
48 | int max_adj; /* Maximum frequency adjustment in parts per billon. */ | ||
49 | int n_alarm; /* Number of programmable alarms. */ | ||
50 | int n_ext_ts; /* Number of external time stamp channels. */ | ||
51 | int n_per_out; /* Number of programmable periodic signals. */ | ||
52 | int pps; /* Whether the clock supports a PPS callback. */ | ||
53 | int rsv[15]; /* Reserved for future use. */ | ||
54 | }; | ||
55 | |||
56 | struct ptp_extts_request { | ||
57 | unsigned int index; /* Which channel to configure. */ | ||
58 | unsigned int flags; /* Bit field for PTP_xxx flags. */ | ||
59 | unsigned int rsv[2]; /* Reserved for future use. */ | ||
60 | }; | ||
61 | |||
62 | struct ptp_perout_request { | ||
63 | struct ptp_clock_time start; /* Absolute start time. */ | ||
64 | struct ptp_clock_time period; /* Desired period, zero means disable. */ | ||
65 | unsigned int index; /* Which channel to configure. */ | ||
66 | unsigned int flags; /* Reserved for future use. */ | ||
67 | unsigned int rsv[4]; /* Reserved for future use. */ | ||
68 | }; | ||
69 | |||
70 | #define PTP_CLK_MAGIC '=' | ||
71 | |||
72 | #define PTP_CLOCK_GETCAPS _IOR(PTP_CLK_MAGIC, 1, struct ptp_clock_caps) | ||
73 | #define PTP_EXTTS_REQUEST _IOW(PTP_CLK_MAGIC, 2, struct ptp_extts_request) | ||
74 | #define PTP_PEROUT_REQUEST _IOW(PTP_CLK_MAGIC, 3, struct ptp_perout_request) | ||
75 | #define PTP_ENABLE_PPS _IOW(PTP_CLK_MAGIC, 4, int) | ||
76 | |||
77 | struct ptp_extts_event { | ||
78 | struct ptp_clock_time t; /* Time event occured. */ | ||
79 | unsigned int index; /* Which channel produced the event. */ | ||
80 | unsigned int flags; /* Reserved for future use. */ | ||
81 | unsigned int rsv[2]; /* Reserved for future use. */ | ||
82 | }; | ||
83 | |||
84 | #endif | ||
diff --git a/include/linux/ptp_clock_kernel.h b/include/linux/ptp_clock_kernel.h new file mode 100644 index 000000000000..dd2e44fba63e --- /dev/null +++ b/include/linux/ptp_clock_kernel.h | |||
@@ -0,0 +1,139 @@ | |||
1 | /* | ||
2 | * PTP 1588 clock support | ||
3 | * | ||
4 | * Copyright (C) 2010 OMICRON electronics GmbH | ||
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; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
19 | */ | ||
20 | |||
21 | #ifndef _PTP_CLOCK_KERNEL_H_ | ||
22 | #define _PTP_CLOCK_KERNEL_H_ | ||
23 | |||
24 | #include <linux/ptp_clock.h> | ||
25 | |||
26 | |||
27 | struct ptp_clock_request { | ||
28 | enum { | ||
29 | PTP_CLK_REQ_EXTTS, | ||
30 | PTP_CLK_REQ_PEROUT, | ||
31 | PTP_CLK_REQ_PPS, | ||
32 | } type; | ||
33 | union { | ||
34 | struct ptp_extts_request extts; | ||
35 | struct ptp_perout_request perout; | ||
36 | }; | ||
37 | }; | ||
38 | |||
39 | /** | ||
40 | * struct ptp_clock_info - decribes a PTP hardware clock | ||
41 | * | ||
42 | * @owner: The clock driver should set to THIS_MODULE. | ||
43 | * @name: A short name to identify the clock. | ||
44 | * @max_adj: The maximum possible frequency adjustment, in parts per billon. | ||
45 | * @n_alarm: The number of programmable alarms. | ||
46 | * @n_ext_ts: The number of external time stamp channels. | ||
47 | * @n_per_out: The number of programmable periodic signals. | ||
48 | * @pps: Indicates whether the clock supports a PPS callback. | ||
49 | * | ||
50 | * clock operations | ||
51 | * | ||
52 | * @adjfreq: Adjusts the frequency of the hardware clock. | ||
53 | * parameter delta: Desired period change in parts per billion. | ||
54 | * | ||
55 | * @adjtime: Shifts the time of the hardware clock. | ||
56 | * parameter delta: Desired change in nanoseconds. | ||
57 | * | ||
58 | * @gettime: Reads the current time from the hardware clock. | ||
59 | * parameter ts: Holds the result. | ||
60 | * | ||
61 | * @settime: Set the current time on the hardware clock. | ||
62 | * parameter ts: Time value to set. | ||
63 | * | ||
64 | * @enable: Request driver to enable or disable an ancillary feature. | ||
65 | * parameter request: Desired resource to enable or disable. | ||
66 | * parameter on: Caller passes one to enable or zero to disable. | ||
67 | * | ||
68 | * Drivers should embed their ptp_clock_info within a private | ||
69 | * structure, obtaining a reference to it using container_of(). | ||
70 | * | ||
71 | * The callbacks must all return zero on success, non-zero otherwise. | ||
72 | */ | ||
73 | |||
74 | struct ptp_clock_info { | ||
75 | struct module *owner; | ||
76 | char name[16]; | ||
77 | s32 max_adj; | ||
78 | int n_alarm; | ||
79 | int n_ext_ts; | ||
80 | int n_per_out; | ||
81 | int pps; | ||
82 | int (*adjfreq)(struct ptp_clock_info *ptp, s32 delta); | ||
83 | int (*adjtime)(struct ptp_clock_info *ptp, s64 delta); | ||
84 | int (*gettime)(struct ptp_clock_info *ptp, struct timespec *ts); | ||
85 | int (*settime)(struct ptp_clock_info *ptp, const struct timespec *ts); | ||
86 | int (*enable)(struct ptp_clock_info *ptp, | ||
87 | struct ptp_clock_request *request, int on); | ||
88 | }; | ||
89 | |||
90 | struct ptp_clock; | ||
91 | |||
92 | /** | ||
93 | * ptp_clock_register() - register a PTP hardware clock driver | ||
94 | * | ||
95 | * @info: Structure describing the new clock. | ||
96 | */ | ||
97 | |||
98 | extern struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info); | ||
99 | |||
100 | /** | ||
101 | * ptp_clock_unregister() - unregister a PTP hardware clock driver | ||
102 | * | ||
103 | * @ptp: The clock to remove from service. | ||
104 | */ | ||
105 | |||
106 | extern int ptp_clock_unregister(struct ptp_clock *ptp); | ||
107 | |||
108 | |||
109 | enum ptp_clock_events { | ||
110 | PTP_CLOCK_ALARM, | ||
111 | PTP_CLOCK_EXTTS, | ||
112 | PTP_CLOCK_PPS, | ||
113 | }; | ||
114 | |||
115 | /** | ||
116 | * struct ptp_clock_event - decribes a PTP hardware clock event | ||
117 | * | ||
118 | * @type: One of the ptp_clock_events enumeration values. | ||
119 | * @index: Identifies the source of the event. | ||
120 | * @timestamp: When the event occured. | ||
121 | */ | ||
122 | |||
123 | struct ptp_clock_event { | ||
124 | int type; | ||
125 | int index; | ||
126 | u64 timestamp; | ||
127 | }; | ||
128 | |||
129 | /** | ||
130 | * ptp_clock_event() - notify the PTP layer about an event | ||
131 | * | ||
132 | * @ptp: The clock obtained from ptp_clock_register(). | ||
133 | * @event: Message structure describing the event. | ||
134 | */ | ||
135 | |||
136 | extern void ptp_clock_event(struct ptp_clock *ptp, | ||
137 | struct ptp_clock_event *event); | ||
138 | |||
139 | #endif | ||
diff --git a/include/linux/regulator/db8500-prcmu.h b/include/linux/regulator/db8500-prcmu.h new file mode 100644 index 000000000000..612062313b68 --- /dev/null +++ b/include/linux/regulator/db8500-prcmu.h | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * License Terms: GNU General Public License v2 | ||
5 | * | ||
6 | * Author: Bengt Jonsson <bengt.g.jonsson@stericsson.com> for ST-Ericsson | ||
7 | * | ||
8 | * Interface to power domain regulators on DB8500 | ||
9 | */ | ||
10 | |||
11 | #ifndef __REGULATOR_H__ | ||
12 | #define __REGULATOR_H__ | ||
13 | |||
14 | /* Number of DB8500 regulators and regulator enumeration */ | ||
15 | enum db8500_regulator_id { | ||
16 | DB8500_REGULATOR_VAPE, | ||
17 | DB8500_REGULATOR_VARM, | ||
18 | DB8500_REGULATOR_VMODEM, | ||
19 | DB8500_REGULATOR_VPLL, | ||
20 | DB8500_REGULATOR_VSMPS1, | ||
21 | DB8500_REGULATOR_VSMPS2, | ||
22 | DB8500_REGULATOR_VSMPS3, | ||
23 | DB8500_REGULATOR_VRF1, | ||
24 | DB8500_REGULATOR_SWITCH_SVAMMDSP, | ||
25 | DB8500_REGULATOR_SWITCH_SVAMMDSPRET, | ||
26 | DB8500_REGULATOR_SWITCH_SVAPIPE, | ||
27 | DB8500_REGULATOR_SWITCH_SIAMMDSP, | ||
28 | DB8500_REGULATOR_SWITCH_SIAMMDSPRET, | ||
29 | DB8500_REGULATOR_SWITCH_SIAPIPE, | ||
30 | DB8500_REGULATOR_SWITCH_SGA, | ||
31 | DB8500_REGULATOR_SWITCH_B2R2_MCDE, | ||
32 | DB8500_REGULATOR_SWITCH_ESRAM12, | ||
33 | DB8500_REGULATOR_SWITCH_ESRAM12RET, | ||
34 | DB8500_REGULATOR_SWITCH_ESRAM34, | ||
35 | DB8500_REGULATOR_SWITCH_ESRAM34RET, | ||
36 | DB8500_NUM_REGULATORS | ||
37 | }; | ||
38 | |||
39 | /* | ||
40 | * Exported interface for CPUIdle only. This function is called with all | ||
41 | * interrupts turned off. | ||
42 | */ | ||
43 | int power_state_active_is_enabled(void); | ||
44 | |||
45 | #endif | ||
diff --git a/include/linux/rfkill-gpio.h b/include/linux/rfkill-gpio.h new file mode 100644 index 000000000000..a175d0598033 --- /dev/null +++ b/include/linux/rfkill-gpio.h | |||
@@ -0,0 +1,43 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2011, NVIDIA Corporation. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
12 | * more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
17 | */ | ||
18 | |||
19 | |||
20 | #ifndef __RFKILL_GPIO_H | ||
21 | #define __RFKILL_GPIO_H | ||
22 | |||
23 | #include <linux/types.h> | ||
24 | #include <linux/rfkill.h> | ||
25 | |||
26 | /** | ||
27 | * struct rfkill_gpio_platform_data - platform data for rfkill gpio device. | ||
28 | * for unused gpio's, the expected value is -1. | ||
29 | * @name: name for the gpio rf kill instance | ||
30 | * @reset_gpio: GPIO which is used for reseting rfkill switch | ||
31 | * @shutdown_gpio: GPIO which is used for shutdown of rfkill switch | ||
32 | * @power_clk_name: [optional] name of clk to turn off while blocked | ||
33 | */ | ||
34 | |||
35 | struct rfkill_gpio_platform_data { | ||
36 | char *name; | ||
37 | int reset_gpio; | ||
38 | int shutdown_gpio; | ||
39 | const char *power_clk_name; | ||
40 | enum rfkill_type type; | ||
41 | }; | ||
42 | |||
43 | #endif /* __RFKILL_GPIO_H */ | ||
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 830e65dc01ee..2148b122779b 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -7,7 +7,7 @@ | |||
7 | #include <linux/list.h> | 7 | #include <linux/list.h> |
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/mutex.h> |
11 | #include <linux/memcontrol.h> | 11 | #include <linux/memcontrol.h> |
12 | 12 | ||
13 | /* | 13 | /* |
@@ -26,7 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | struct anon_vma { | 27 | struct anon_vma { |
28 | struct anon_vma *root; /* Root of this anon_vma tree */ | 28 | struct anon_vma *root; /* Root of this anon_vma tree */ |
29 | spinlock_t lock; /* Serialize access to vma list */ | 29 | struct mutex mutex; /* Serialize access to vma list */ |
30 | /* | 30 | /* |
31 | * The refcount is taken on an anon_vma when there is no | 31 | * The refcount is taken on an anon_vma when there is no |
32 | * guarantee that the vma of page tables will exist for | 32 | * guarantee that the vma of page tables will exist for |
@@ -64,7 +64,7 @@ struct anon_vma_chain { | |||
64 | struct vm_area_struct *vma; | 64 | struct vm_area_struct *vma; |
65 | struct anon_vma *anon_vma; | 65 | struct anon_vma *anon_vma; |
66 | struct list_head same_vma; /* locked by mmap_sem & page_table_lock */ | 66 | struct list_head same_vma; /* locked by mmap_sem & page_table_lock */ |
67 | struct list_head same_anon_vma; /* locked by anon_vma->lock */ | 67 | struct list_head same_anon_vma; /* locked by anon_vma->mutex */ |
68 | }; | 68 | }; |
69 | 69 | ||
70 | #ifdef CONFIG_MMU | 70 | #ifdef CONFIG_MMU |
@@ -93,24 +93,24 @@ static inline void vma_lock_anon_vma(struct vm_area_struct *vma) | |||
93 | { | 93 | { |
94 | struct anon_vma *anon_vma = vma->anon_vma; | 94 | struct anon_vma *anon_vma = vma->anon_vma; |
95 | if (anon_vma) | 95 | if (anon_vma) |
96 | spin_lock(&anon_vma->root->lock); | 96 | mutex_lock(&anon_vma->root->mutex); |
97 | } | 97 | } |
98 | 98 | ||
99 | static inline void vma_unlock_anon_vma(struct vm_area_struct *vma) | 99 | static inline void vma_unlock_anon_vma(struct vm_area_struct *vma) |
100 | { | 100 | { |
101 | struct anon_vma *anon_vma = vma->anon_vma; | 101 | struct anon_vma *anon_vma = vma->anon_vma; |
102 | if (anon_vma) | 102 | if (anon_vma) |
103 | spin_unlock(&anon_vma->root->lock); | 103 | mutex_unlock(&anon_vma->root->mutex); |
104 | } | 104 | } |
105 | 105 | ||
106 | static inline void anon_vma_lock(struct anon_vma *anon_vma) | 106 | static inline void anon_vma_lock(struct anon_vma *anon_vma) |
107 | { | 107 | { |
108 | spin_lock(&anon_vma->root->lock); | 108 | mutex_lock(&anon_vma->root->mutex); |
109 | } | 109 | } |
110 | 110 | ||
111 | static inline void anon_vma_unlock(struct anon_vma *anon_vma) | 111 | static inline void anon_vma_unlock(struct anon_vma *anon_vma) |
112 | { | 112 | { |
113 | spin_unlock(&anon_vma->root->lock); | 113 | mutex_unlock(&anon_vma->root->mutex); |
114 | } | 114 | } |
115 | 115 | ||
116 | /* | 116 | /* |
@@ -218,20 +218,7 @@ int try_to_munlock(struct page *); | |||
218 | /* | 218 | /* |
219 | * Called by memory-failure.c to kill processes. | 219 | * Called by memory-failure.c to kill processes. |
220 | */ | 220 | */ |
221 | struct anon_vma *__page_lock_anon_vma(struct page *page); | 221 | struct anon_vma *page_lock_anon_vma(struct page *page); |
222 | |||
223 | static inline struct anon_vma *page_lock_anon_vma(struct page *page) | ||
224 | { | ||
225 | struct anon_vma *anon_vma; | ||
226 | |||
227 | __cond_lock(RCU, anon_vma = __page_lock_anon_vma(page)); | ||
228 | |||
229 | /* (void) is needed to make gcc happy */ | ||
230 | (void) __cond_lock(&anon_vma->root->lock, anon_vma); | ||
231 | |||
232 | return anon_vma; | ||
233 | } | ||
234 | |||
235 | void page_unlock_anon_vma(struct anon_vma *anon_vma); | 222 | void page_unlock_anon_vma(struct anon_vma *anon_vma); |
236 | int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); | 223 | int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); |
237 | 224 | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index aaf71e08222c..f18300eddfcb 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1753,7 +1753,6 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t * | |||
1753 | #define PF_FROZEN 0x00010000 /* frozen for system suspend */ | 1753 | #define PF_FROZEN 0x00010000 /* frozen for system suspend */ |
1754 | #define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ | 1754 | #define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ |
1755 | #define PF_KSWAPD 0x00040000 /* I am kswapd */ | 1755 | #define PF_KSWAPD 0x00040000 /* I am kswapd */ |
1756 | #define PF_OOM_ORIGIN 0x00080000 /* Allocating much memory to others */ | ||
1757 | #define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */ | 1756 | #define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */ |
1758 | #define PF_KTHREAD 0x00200000 /* I am a kernel thread */ | 1757 | #define PF_KTHREAD 0x00200000 /* I am a kernel thread */ |
1759 | #define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */ | 1758 | #define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */ |
@@ -2177,6 +2176,7 @@ static inline void mmdrop(struct mm_struct * mm) | |||
2177 | if (unlikely(atomic_dec_and_test(&mm->mm_count))) | 2176 | if (unlikely(atomic_dec_and_test(&mm->mm_count))) |
2178 | __mmdrop(mm); | 2177 | __mmdrop(mm); |
2179 | } | 2178 | } |
2179 | extern int mm_init_cpumask(struct mm_struct *mm, struct mm_struct *oldmm); | ||
2180 | 2180 | ||
2181 | /* mmput gets rid of the mappings and all user-space */ | 2181 | /* mmput gets rid of the mappings and all user-space */ |
2182 | extern void mmput(struct mm_struct *); | 2182 | extern void mmput(struct mm_struct *); |
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index 399be5ad2f99..2b7fec840517 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h | |||
@@ -9,6 +9,8 @@ | |||
9 | 9 | ||
10 | #define SHMEM_NR_DIRECT 16 | 10 | #define SHMEM_NR_DIRECT 16 |
11 | 11 | ||
12 | #define SHMEM_SYMLINK_INLINE_LEN (SHMEM_NR_DIRECT * sizeof(swp_entry_t)) | ||
13 | |||
12 | struct shmem_inode_info { | 14 | struct shmem_inode_info { |
13 | spinlock_t lock; | 15 | spinlock_t lock; |
14 | unsigned long flags; | 16 | unsigned long flags; |
@@ -17,8 +19,12 @@ struct shmem_inode_info { | |||
17 | unsigned long next_index; /* highest alloced index + 1 */ | 19 | unsigned long next_index; /* highest alloced index + 1 */ |
18 | struct shared_policy policy; /* NUMA memory alloc policy */ | 20 | struct shared_policy policy; /* NUMA memory alloc policy */ |
19 | struct page *i_indirect; /* top indirect blocks page */ | 21 | struct page *i_indirect; /* top indirect blocks page */ |
20 | swp_entry_t i_direct[SHMEM_NR_DIRECT]; /* first blocks */ | 22 | union { |
23 | swp_entry_t i_direct[SHMEM_NR_DIRECT]; /* first blocks */ | ||
24 | char inline_symlink[SHMEM_SYMLINK_INLINE_LEN]; | ||
25 | }; | ||
21 | struct list_head swaplist; /* chain of maybes on swap */ | 26 | struct list_head swaplist; /* chain of maybes on swap */ |
27 | struct list_head xattr_list; /* list of shmem_xattr */ | ||
22 | struct inode vfs_inode; | 28 | struct inode vfs_inode; |
23 | }; | 29 | }; |
24 | 30 | ||
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index ab71447d0c5a..8c03b98df5f9 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -846,4 +846,5 @@ asmlinkage long sys_name_to_handle_at(int dfd, const char __user *name, | |||
846 | asmlinkage long sys_open_by_handle_at(int mountdirfd, | 846 | asmlinkage long sys_open_by_handle_at(int mountdirfd, |
847 | struct file_handle __user *handle, | 847 | struct file_handle __user *handle, |
848 | int flags); | 848 | int flags); |
849 | asmlinkage long sys_setns(int fd, int nstype); | ||
849 | #endif | 850 | #endif |
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index 2b3831b58aa4..51359837511a 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
@@ -261,6 +261,7 @@ extern void dec_zone_state(struct zone *, enum zone_stat_item); | |||
261 | extern void __dec_zone_state(struct zone *, enum zone_stat_item); | 261 | extern void __dec_zone_state(struct zone *, enum zone_stat_item); |
262 | 262 | ||
263 | void refresh_cpu_vm_stats(int); | 263 | void refresh_cpu_vm_stats(int); |
264 | void refresh_zone_stat_thresholds(void); | ||
264 | 265 | ||
265 | int calculate_pressure_threshold(struct zone *zone); | 266 | int calculate_pressure_threshold(struct zone *zone); |
266 | int calculate_normal_threshold(struct zone *zone); | 267 | int calculate_normal_threshold(struct zone *zone); |
@@ -313,6 +314,10 @@ static inline void __dec_zone_page_state(struct page *page, | |||
313 | #define set_pgdat_percpu_threshold(pgdat, callback) { } | 314 | #define set_pgdat_percpu_threshold(pgdat, callback) { } |
314 | 315 | ||
315 | static inline void refresh_cpu_vm_stats(int cpu) { } | 316 | static inline void refresh_cpu_vm_stats(int cpu) { } |
316 | #endif | 317 | static inline void refresh_zone_stat_thresholds(void) { } |
318 | |||
319 | #endif /* CONFIG_SMP */ | ||
320 | |||
321 | extern const char * const vmstat_text[]; | ||
317 | 322 | ||
318 | #endif /* _LINUX_VMSTAT_H */ | 323 | #endif /* _LINUX_VMSTAT_H */ |
diff --git a/include/linux/xattr.h b/include/linux/xattr.h index 6050783005bd..aed54c50aa66 100644 --- a/include/linux/xattr.h +++ b/include/linux/xattr.h | |||
@@ -13,10 +13,6 @@ | |||
13 | #define XATTR_CREATE 0x1 /* set value, fail if attr already exists */ | 13 | #define XATTR_CREATE 0x1 /* set value, fail if attr already exists */ |
14 | #define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */ | 14 | #define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */ |
15 | 15 | ||
16 | #ifdef __KERNEL__ | ||
17 | |||
18 | #include <linux/types.h> | ||
19 | |||
20 | /* Namespaces */ | 16 | /* Namespaces */ |
21 | #define XATTR_OS2_PREFIX "os2." | 17 | #define XATTR_OS2_PREFIX "os2." |
22 | #define XATTR_OS2_PREFIX_LEN (sizeof (XATTR_OS2_PREFIX) - 1) | 18 | #define XATTR_OS2_PREFIX_LEN (sizeof (XATTR_OS2_PREFIX) - 1) |
@@ -53,6 +49,10 @@ | |||
53 | #define XATTR_CAPS_SUFFIX "capability" | 49 | #define XATTR_CAPS_SUFFIX "capability" |
54 | #define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX | 50 | #define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX |
55 | 51 | ||
52 | #ifdef __KERNEL__ | ||
53 | |||
54 | #include <linux/types.h> | ||
55 | |||
56 | struct inode; | 56 | struct inode; |
57 | struct dentry; | 57 | struct dentry; |
58 | 58 | ||
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h index d2df55b0c213..008711e8e78f 100644 --- a/include/net/9p/9p.h +++ b/include/net/9p/9p.h | |||
@@ -241,10 +241,10 @@ enum p9_open_mode_t { | |||
241 | 241 | ||
242 | /** | 242 | /** |
243 | * enum p9_perm_t - 9P permissions | 243 | * enum p9_perm_t - 9P permissions |
244 | * @P9_DMDIR: mode bite for directories | 244 | * @P9_DMDIR: mode bit for directories |
245 | * @P9_DMAPPEND: mode bit for is append-only | 245 | * @P9_DMAPPEND: mode bit for is append-only |
246 | * @P9_DMEXCL: mode bit for excluse use (only one open handle allowed) | 246 | * @P9_DMEXCL: mode bit for excluse use (only one open handle allowed) |
247 | * @P9_DMMOUNT: mode bite for mount points | 247 | * @P9_DMMOUNT: mode bit for mount points |
248 | * @P9_DMAUTH: mode bit for authentication file | 248 | * @P9_DMAUTH: mode bit for authentication file |
249 | * @P9_DMTMP: mode bit for non-backed-up files | 249 | * @P9_DMTMP: mode bit for non-backed-up files |
250 | * @P9_DMSYMLINK: mode bit for symbolic links (9P2000.u) | 250 | * @P9_DMSYMLINK: mode bit for symbolic links (9P2000.u) |
@@ -362,7 +362,7 @@ struct p9_qid { | |||
362 | }; | 362 | }; |
363 | 363 | ||
364 | /** | 364 | /** |
365 | * struct p9_stat - file system metadata information | 365 | * struct p9_wstat - file system metadata information |
366 | * @size: length prefix for this stat structure instance | 366 | * @size: length prefix for this stat structure instance |
367 | * @type: the type of the server (equivalent to a major number) | 367 | * @type: the type of the server (equivalent to a major number) |
368 | * @dev: the sub-type of the server (equivalent to a minor number) | 368 | * @dev: the sub-type of the server (equivalent to a minor number) |
@@ -687,10 +687,10 @@ struct p9_rwstat { | |||
687 | * @size: prefixed length of the structure | 687 | * @size: prefixed length of the structure |
688 | * @id: protocol operating identifier of type &p9_msg_t | 688 | * @id: protocol operating identifier of type &p9_msg_t |
689 | * @tag: transaction id of the request | 689 | * @tag: transaction id of the request |
690 | * @offset: used by marshalling routines to track currentposition in buffer | 690 | * @offset: used by marshalling routines to track current position in buffer |
691 | * @capacity: used by marshalling routines to track total malloc'd capacity | 691 | * @capacity: used by marshalling routines to track total malloc'd capacity |
692 | * @pubuf: Payload user buffer given by the caller | 692 | * @pubuf: Payload user buffer given by the caller |
693 | * @pubuf: Payload kernel buffer given by the caller | 693 | * @pkbuf: Payload kernel buffer given by the caller |
694 | * @pbuf_size: pubuf/pkbuf(only one will be !NULL) size to be read/write. | 694 | * @pbuf_size: pubuf/pkbuf(only one will be !NULL) size to be read/write. |
695 | * @private: For transport layer's use. | 695 | * @private: For transport layer's use. |
696 | * @sdata: payload | 696 | * @sdata: payload |
@@ -714,7 +714,7 @@ struct p9_fcall { | |||
714 | size_t pbuf_size; | 714 | size_t pbuf_size; |
715 | void *private; | 715 | void *private; |
716 | 716 | ||
717 | uint8_t *sdata; | 717 | u8 *sdata; |
718 | }; | 718 | }; |
719 | 719 | ||
720 | struct p9_idpool; | 720 | struct p9_idpool; |
@@ -728,7 +728,6 @@ void p9_idpool_put(int id, struct p9_idpool *p); | |||
728 | int p9_idpool_check(int id, struct p9_idpool *p); | 728 | int p9_idpool_check(int id, struct p9_idpool *p); |
729 | 729 | ||
730 | int p9_error_init(void); | 730 | int p9_error_init(void); |
731 | int p9_errstr2errno(char *, int); | ||
732 | int p9_trans_fd_init(void); | 731 | int p9_trans_fd_init(void); |
733 | void p9_trans_fd_exit(void); | 732 | void p9_trans_fd_exit(void); |
734 | #endif /* NET_9P_H */ | 733 | #endif /* NET_9P_H */ |
diff --git a/include/net/9p/client.h b/include/net/9p/client.h index 051a99f79769..d26d5e98a173 100644 --- a/include/net/9p/client.h +++ b/include/net/9p/client.h | |||
@@ -60,7 +60,7 @@ enum p9_trans_status { | |||
60 | }; | 60 | }; |
61 | 61 | ||
62 | /** | 62 | /** |
63 | * enum p9_req_status_t - virtio request status | 63 | * enum p9_req_status_t - status of a request |
64 | * @REQ_STATUS_IDLE: request slot unused | 64 | * @REQ_STATUS_IDLE: request slot unused |
65 | * @REQ_STATUS_ALLOC: request has been allocated but not sent | 65 | * @REQ_STATUS_ALLOC: request has been allocated but not sent |
66 | * @REQ_STATUS_UNSENT: request waiting to be sent | 66 | * @REQ_STATUS_UNSENT: request waiting to be sent |
diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h index 8f08c736c4c3..d8549fb9c742 100644 --- a/include/net/9p/transport.h +++ b/include/net/9p/transport.h | |||
@@ -41,6 +41,7 @@ | |||
41 | * @pref: Preferences of this transport | 41 | * @pref: Preferences of this transport |
42 | * @def: set if this transport should be considered the default | 42 | * @def: set if this transport should be considered the default |
43 | * @create: member function to create a new connection on this transport | 43 | * @create: member function to create a new connection on this transport |
44 | * @close: member function to discard a connection on this transport | ||
44 | * @request: member function to issue a request to the transport | 45 | * @request: member function to issue a request to the transport |
45 | * @cancel: member function to cancel a request (if it hasn't been sent) | 46 | * @cancel: member function to cancel a request (if it hasn't been sent) |
46 | * | 47 | * |
@@ -48,7 +49,7 @@ | |||
48 | * transport module with the 9P core network module and used by the client | 49 | * transport module with the 9P core network module and used by the client |
49 | * to instantiate a new connection on a transport. | 50 | * to instantiate a new connection on a transport. |
50 | * | 51 | * |
51 | * BUGS: the transport module list isn't protected. | 52 | * The transport module list is protected by v9fs_trans_lock. |
52 | */ | 53 | */ |
53 | 54 | ||
54 | struct p9_trans_module { | 55 | struct p9_trans_module { |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index bfd6557946be..0589f554788a 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -531,6 +531,7 @@ struct sta_bss_parameters { | |||
531 | * @tx_retries: cumulative retry counts | 531 | * @tx_retries: cumulative retry counts |
532 | * @tx_failed: number of failed transmissions (retries exceeded, no ACK) | 532 | * @tx_failed: number of failed transmissions (retries exceeded, no ACK) |
533 | * @rx_dropped_misc: Dropped for un-specified reason. | 533 | * @rx_dropped_misc: Dropped for un-specified reason. |
534 | * @bss_param: current BSS parameters | ||
534 | * @generation: generation number for nl80211 dumps. | 535 | * @generation: generation number for nl80211 dumps. |
535 | * This number should increase every time the list of stations | 536 | * This number should increase every time the list of stations |
536 | * changes, i.e. when a station is added or removed, so that | 537 | * changes, i.e. when a station is added or removed, so that |
@@ -1537,7 +1538,7 @@ struct cfg80211_ops { | |||
1537 | * @WIPHY_FLAG_IBSS_RSN: The device supports IBSS RSN. | 1538 | * @WIPHY_FLAG_IBSS_RSN: The device supports IBSS RSN. |
1538 | * @WIPHY_FLAG_MESH_AUTH: The device supports mesh authentication by routing | 1539 | * @WIPHY_FLAG_MESH_AUTH: The device supports mesh authentication by routing |
1539 | * auth frames to userspace. See @NL80211_MESH_SETUP_USERSPACE_AUTH. | 1540 | * auth frames to userspace. See @NL80211_MESH_SETUP_USERSPACE_AUTH. |
1540 | * @WIPHY_FLAG_SCHED_SCAN: The device supports scheduled scans. | 1541 | * @WIPHY_FLAG_SUPPORTS_SCHED_SCAN: The device supports scheduled scans. |
1541 | */ | 1542 | */ |
1542 | enum wiphy_flags { | 1543 | enum wiphy_flags { |
1543 | WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), | 1544 | WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), |
@@ -2878,6 +2879,7 @@ void cfg80211_connect_result(struct net_device *dev, const u8 *bssid, | |||
2878 | * cfg80211_roamed - notify cfg80211 of roaming | 2879 | * cfg80211_roamed - notify cfg80211 of roaming |
2879 | * | 2880 | * |
2880 | * @dev: network device | 2881 | * @dev: network device |
2882 | * @channel: the channel of the new AP | ||
2881 | * @bssid: the BSSID of the new AP | 2883 | * @bssid: the BSSID of the new AP |
2882 | * @req_ie: association request IEs (maybe be %NULL) | 2884 | * @req_ie: association request IEs (maybe be %NULL) |
2883 | * @req_ie_len: association request IEs length | 2885 | * @req_ie_len: association request IEs length |
@@ -2888,7 +2890,9 @@ void cfg80211_connect_result(struct net_device *dev, const u8 *bssid, | |||
2888 | * It should be called by the underlying driver whenever it roamed | 2890 | * It should be called by the underlying driver whenever it roamed |
2889 | * from one AP to another while connected. | 2891 | * from one AP to another while connected. |
2890 | */ | 2892 | */ |
2891 | void cfg80211_roamed(struct net_device *dev, const u8 *bssid, | 2893 | void cfg80211_roamed(struct net_device *dev, |
2894 | struct ieee80211_channel *channel, | ||
2895 | const u8 *bssid, | ||
2892 | const u8 *req_ie, size_t req_ie_len, | 2896 | const u8 *req_ie, size_t req_ie_len, |
2893 | const u8 *resp_ie, size_t resp_ie_len, gfp_t gfp); | 2897 | const u8 *resp_ie, size_t resp_ie_len, gfp_t gfp); |
2894 | 2898 | ||
diff --git a/include/net/dst.h b/include/net/dst.h index 07a0402c52e6..7d15d238b6ec 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -111,6 +111,8 @@ static inline u32 *dst_metrics_write_ptr(struct dst_entry *dst) | |||
111 | { | 111 | { |
112 | unsigned long p = dst->_metrics; | 112 | unsigned long p = dst->_metrics; |
113 | 113 | ||
114 | BUG_ON(!p); | ||
115 | |||
114 | if (p & DST_METRICS_READ_ONLY) | 116 | if (p & DST_METRICS_READ_ONLY) |
115 | return dst->ops->cow_metrics(dst, p); | 117 | return dst->ops->cow_metrics(dst, p); |
116 | return __DST_METRICS_PTR(p); | 118 | return __DST_METRICS_PTR(p); |
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index 3ae491932bc8..dcc8f5749d3f 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
@@ -119,6 +119,7 @@ static inline struct net *copy_net_ns(unsigned long flags, struct net *net_ns) | |||
119 | extern struct list_head net_namespace_list; | 119 | extern struct list_head net_namespace_list; |
120 | 120 | ||
121 | extern struct net *get_net_ns_by_pid(pid_t pid); | 121 | extern struct net *get_net_ns_by_pid(pid_t pid); |
122 | extern struct net *get_net_ns_by_fd(int pid); | ||
122 | 123 | ||
123 | #ifdef CONFIG_NET_NS | 124 | #ifdef CONFIG_NET_NS |
124 | extern void __put_net(struct net *net); | 125 | extern void __put_net(struct net *net); |
diff --git a/include/video/omap-panel-generic-dpi.h b/include/video/omap-panel-generic-dpi.h new file mode 100644 index 000000000000..127e3f20328e --- /dev/null +++ b/include/video/omap-panel-generic-dpi.h | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * Header for generic DPI panel driver | ||
3 | * | ||
4 | * Copyright (C) 2010 Canonical Ltd. | ||
5 | * Author: Bryan Wu <bryan.wu@canonical.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
14 | * more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along with | ||
17 | * this program. If not, see <http://www.gnu.org/licenses/>. | ||
18 | */ | ||
19 | |||
20 | #ifndef __OMAP_PANEL_GENERIC_DPI_H | ||
21 | #define __OMAP_PANEL_GENERIC_DPI_H | ||
22 | |||
23 | struct omap_dss_device; | ||
24 | |||
25 | /** | ||
26 | * struct panel_generic_dpi_data - panel driver configuration data | ||
27 | * @name: panel name | ||
28 | * @platform_enable: platform specific panel enable function | ||
29 | * @platform_disable: platform specific panel disable function | ||
30 | */ | ||
31 | struct panel_generic_dpi_data { | ||
32 | const char *name; | ||
33 | int (*platform_enable)(struct omap_dss_device *dssdev); | ||
34 | void (*platform_disable)(struct omap_dss_device *dssdev); | ||
35 | }; | ||
36 | |||
37 | #endif /* __OMAP_PANEL_GENERIC_DPI_H */ | ||
diff --git a/include/video/omap-panel-nokia-dsi.h b/include/video/omap-panel-nokia-dsi.h new file mode 100644 index 000000000000..921ae9327228 --- /dev/null +++ b/include/video/omap-panel-nokia-dsi.h | |||
@@ -0,0 +1,33 @@ | |||
1 | #ifndef __OMAP_NOKIA_DSI_PANEL_H | ||
2 | #define __OMAP_NOKIA_DSI_PANEL_H | ||
3 | |||
4 | struct omap_dss_device; | ||
5 | |||
6 | /** | ||
7 | * struct nokia_dsi_panel_data - Nokia DSI panel driver configuration | ||
8 | * @name: panel name | ||
9 | * @use_ext_te: use external TE | ||
10 | * @ext_te_gpio: external TE GPIO | ||
11 | * @esd_interval: interval of ESD checks, 0 = disabled (ms) | ||
12 | * @ulps_timeout: time to wait before entering ULPS, 0 = disabled (ms) | ||
13 | * @max_backlight_level: maximum backlight level | ||
14 | * @set_backlight: pointer to backlight set function | ||
15 | * @get_backlight: pointer to backlight get function | ||
16 | */ | ||
17 | struct nokia_dsi_panel_data { | ||
18 | const char *name; | ||
19 | |||
20 | int reset_gpio; | ||
21 | |||
22 | bool use_ext_te; | ||
23 | int ext_te_gpio; | ||
24 | |||
25 | unsigned esd_interval; | ||
26 | unsigned ulps_timeout; | ||
27 | |||
28 | int max_backlight_level; | ||
29 | int (*set_backlight)(struct omap_dss_device *dssdev, int level); | ||
30 | int (*get_backlight)(struct omap_dss_device *dssdev); | ||
31 | }; | ||
32 | |||
33 | #endif /* __OMAP_NOKIA_DSI_PANEL_H */ | ||
diff --git a/include/video/omapdss.h b/include/video/omapdss.h new file mode 100644 index 000000000000..892b97f8e157 --- /dev/null +++ b/include/video/omapdss.h | |||
@@ -0,0 +1,641 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2008 Nokia Corporation | ||
3 | * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License version 2 as published by | ||
7 | * the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
12 | * more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along with | ||
15 | * this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | ||
17 | |||
18 | #ifndef __OMAP_OMAPDSS_H | ||
19 | #define __OMAP_OMAPDSS_H | ||
20 | |||
21 | #include <linux/list.h> | ||
22 | #include <linux/kobject.h> | ||
23 | #include <linux/device.h> | ||
24 | #include <linux/platform_device.h> | ||
25 | #include <asm/atomic.h> | ||
26 | |||
27 | #define DISPC_IRQ_FRAMEDONE (1 << 0) | ||
28 | #define DISPC_IRQ_VSYNC (1 << 1) | ||
29 | #define DISPC_IRQ_EVSYNC_EVEN (1 << 2) | ||
30 | #define DISPC_IRQ_EVSYNC_ODD (1 << 3) | ||
31 | #define DISPC_IRQ_ACBIAS_COUNT_STAT (1 << 4) | ||
32 | #define DISPC_IRQ_PROG_LINE_NUM (1 << 5) | ||
33 | #define DISPC_IRQ_GFX_FIFO_UNDERFLOW (1 << 6) | ||
34 | #define DISPC_IRQ_GFX_END_WIN (1 << 7) | ||
35 | #define DISPC_IRQ_PAL_GAMMA_MASK (1 << 8) | ||
36 | #define DISPC_IRQ_OCP_ERR (1 << 9) | ||
37 | #define DISPC_IRQ_VID1_FIFO_UNDERFLOW (1 << 10) | ||
38 | #define DISPC_IRQ_VID1_END_WIN (1 << 11) | ||
39 | #define DISPC_IRQ_VID2_FIFO_UNDERFLOW (1 << 12) | ||
40 | #define DISPC_IRQ_VID2_END_WIN (1 << 13) | ||
41 | #define DISPC_IRQ_SYNC_LOST (1 << 14) | ||
42 | #define DISPC_IRQ_SYNC_LOST_DIGIT (1 << 15) | ||
43 | #define DISPC_IRQ_WAKEUP (1 << 16) | ||
44 | #define DISPC_IRQ_SYNC_LOST2 (1 << 17) | ||
45 | #define DISPC_IRQ_VSYNC2 (1 << 18) | ||
46 | #define DISPC_IRQ_ACBIAS_COUNT_STAT2 (1 << 21) | ||
47 | #define DISPC_IRQ_FRAMEDONE2 (1 << 22) | ||
48 | |||
49 | struct omap_dss_device; | ||
50 | struct omap_overlay_manager; | ||
51 | |||
52 | enum omap_display_type { | ||
53 | OMAP_DISPLAY_TYPE_NONE = 0, | ||
54 | OMAP_DISPLAY_TYPE_DPI = 1 << 0, | ||
55 | OMAP_DISPLAY_TYPE_DBI = 1 << 1, | ||
56 | OMAP_DISPLAY_TYPE_SDI = 1 << 2, | ||
57 | OMAP_DISPLAY_TYPE_DSI = 1 << 3, | ||
58 | OMAP_DISPLAY_TYPE_VENC = 1 << 4, | ||
59 | OMAP_DISPLAY_TYPE_HDMI = 1 << 5, | ||
60 | }; | ||
61 | |||
62 | enum omap_plane { | ||
63 | OMAP_DSS_GFX = 0, | ||
64 | OMAP_DSS_VIDEO1 = 1, | ||
65 | OMAP_DSS_VIDEO2 = 2 | ||
66 | }; | ||
67 | |||
68 | enum omap_channel { | ||
69 | OMAP_DSS_CHANNEL_LCD = 0, | ||
70 | OMAP_DSS_CHANNEL_DIGIT = 1, | ||
71 | OMAP_DSS_CHANNEL_LCD2 = 2, | ||
72 | }; | ||
73 | |||
74 | enum omap_color_mode { | ||
75 | OMAP_DSS_COLOR_CLUT1 = 1 << 0, /* BITMAP 1 */ | ||
76 | OMAP_DSS_COLOR_CLUT2 = 1 << 1, /* BITMAP 2 */ | ||
77 | OMAP_DSS_COLOR_CLUT4 = 1 << 2, /* BITMAP 4 */ | ||
78 | OMAP_DSS_COLOR_CLUT8 = 1 << 3, /* BITMAP 8 */ | ||
79 | OMAP_DSS_COLOR_RGB12U = 1 << 4, /* RGB12, 16-bit container */ | ||
80 | OMAP_DSS_COLOR_ARGB16 = 1 << 5, /* ARGB16 */ | ||
81 | OMAP_DSS_COLOR_RGB16 = 1 << 6, /* RGB16 */ | ||
82 | OMAP_DSS_COLOR_RGB24U = 1 << 7, /* RGB24, 32-bit container */ | ||
83 | OMAP_DSS_COLOR_RGB24P = 1 << 8, /* RGB24, 24-bit container */ | ||
84 | OMAP_DSS_COLOR_YUV2 = 1 << 9, /* YUV2 4:2:2 co-sited */ | ||
85 | OMAP_DSS_COLOR_UYVY = 1 << 10, /* UYVY 4:2:2 co-sited */ | ||
86 | OMAP_DSS_COLOR_ARGB32 = 1 << 11, /* ARGB32 */ | ||
87 | OMAP_DSS_COLOR_RGBA32 = 1 << 12, /* RGBA32 */ | ||
88 | OMAP_DSS_COLOR_RGBX32 = 1 << 13, /* RGBx32 */ | ||
89 | OMAP_DSS_COLOR_NV12 = 1 << 14, /* NV12 format: YUV 4:2:0 */ | ||
90 | OMAP_DSS_COLOR_RGBA16 = 1 << 15, /* RGBA16 - 4444 */ | ||
91 | OMAP_DSS_COLOR_RGBX16 = 1 << 16, /* RGBx16 - 4444 */ | ||
92 | OMAP_DSS_COLOR_ARGB16_1555 = 1 << 17, /* ARGB16 - 1555 */ | ||
93 | OMAP_DSS_COLOR_XRGB16_1555 = 1 << 18, /* xRGB16 - 1555 */ | ||
94 | }; | ||
95 | |||
96 | enum omap_lcd_display_type { | ||
97 | OMAP_DSS_LCD_DISPLAY_STN, | ||
98 | OMAP_DSS_LCD_DISPLAY_TFT, | ||
99 | }; | ||
100 | |||
101 | enum omap_dss_load_mode { | ||
102 | OMAP_DSS_LOAD_CLUT_AND_FRAME = 0, | ||
103 | OMAP_DSS_LOAD_CLUT_ONLY = 1, | ||
104 | OMAP_DSS_LOAD_FRAME_ONLY = 2, | ||
105 | OMAP_DSS_LOAD_CLUT_ONCE_FRAME = 3, | ||
106 | }; | ||
107 | |||
108 | enum omap_dss_trans_key_type { | ||
109 | OMAP_DSS_COLOR_KEY_GFX_DST = 0, | ||
110 | OMAP_DSS_COLOR_KEY_VID_SRC = 1, | ||
111 | }; | ||
112 | |||
113 | enum omap_rfbi_te_mode { | ||
114 | OMAP_DSS_RFBI_TE_MODE_1 = 1, | ||
115 | OMAP_DSS_RFBI_TE_MODE_2 = 2, | ||
116 | }; | ||
117 | |||
118 | enum omap_panel_config { | ||
119 | OMAP_DSS_LCD_IVS = 1<<0, | ||
120 | OMAP_DSS_LCD_IHS = 1<<1, | ||
121 | OMAP_DSS_LCD_IPC = 1<<2, | ||
122 | OMAP_DSS_LCD_IEO = 1<<3, | ||
123 | OMAP_DSS_LCD_RF = 1<<4, | ||
124 | OMAP_DSS_LCD_ONOFF = 1<<5, | ||
125 | |||
126 | OMAP_DSS_LCD_TFT = 1<<20, | ||
127 | }; | ||
128 | |||
129 | enum omap_dss_venc_type { | ||
130 | OMAP_DSS_VENC_TYPE_COMPOSITE, | ||
131 | OMAP_DSS_VENC_TYPE_SVIDEO, | ||
132 | }; | ||
133 | |||
134 | enum omap_display_caps { | ||
135 | OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE = 1 << 0, | ||
136 | OMAP_DSS_DISPLAY_CAP_TEAR_ELIM = 1 << 1, | ||
137 | }; | ||
138 | |||
139 | enum omap_dss_update_mode { | ||
140 | OMAP_DSS_UPDATE_DISABLED = 0, | ||
141 | OMAP_DSS_UPDATE_AUTO, | ||
142 | OMAP_DSS_UPDATE_MANUAL, | ||
143 | }; | ||
144 | |||
145 | enum omap_dss_display_state { | ||
146 | OMAP_DSS_DISPLAY_DISABLED = 0, | ||
147 | OMAP_DSS_DISPLAY_ACTIVE, | ||
148 | OMAP_DSS_DISPLAY_SUSPENDED, | ||
149 | }; | ||
150 | |||
151 | /* XXX perhaps this should be removed */ | ||
152 | enum omap_dss_overlay_managers { | ||
153 | OMAP_DSS_OVL_MGR_LCD, | ||
154 | OMAP_DSS_OVL_MGR_TV, | ||
155 | OMAP_DSS_OVL_MGR_LCD2, | ||
156 | }; | ||
157 | |||
158 | enum omap_dss_rotation_type { | ||
159 | OMAP_DSS_ROT_DMA = 0, | ||
160 | OMAP_DSS_ROT_VRFB = 1, | ||
161 | }; | ||
162 | |||
163 | /* clockwise rotation angle */ | ||
164 | enum omap_dss_rotation_angle { | ||
165 | OMAP_DSS_ROT_0 = 0, | ||
166 | OMAP_DSS_ROT_90 = 1, | ||
167 | OMAP_DSS_ROT_180 = 2, | ||
168 | OMAP_DSS_ROT_270 = 3, | ||
169 | }; | ||
170 | |||
171 | enum omap_overlay_caps { | ||
172 | OMAP_DSS_OVL_CAP_SCALE = 1 << 0, | ||
173 | OMAP_DSS_OVL_CAP_DISPC = 1 << 1, | ||
174 | }; | ||
175 | |||
176 | enum omap_overlay_manager_caps { | ||
177 | OMAP_DSS_OVL_MGR_CAP_DISPC = 1 << 0, | ||
178 | }; | ||
179 | |||
180 | enum omap_dss_clk_source { | ||
181 | OMAP_DSS_CLK_SRC_FCK = 0, /* OMAP2/3: DSS1_ALWON_FCLK | ||
182 | * OMAP4: DSS_FCLK */ | ||
183 | OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC, /* OMAP3: DSI1_PLL_FCLK | ||
184 | * OMAP4: PLL1_CLK1 */ | ||
185 | OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI, /* OMAP3: DSI2_PLL_FCLK | ||
186 | * OMAP4: PLL1_CLK2 */ | ||
187 | OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DISPC, /* OMAP4: PLL2_CLK1 */ | ||
188 | OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DSI, /* OMAP4: PLL2_CLK2 */ | ||
189 | }; | ||
190 | |||
191 | /* RFBI */ | ||
192 | |||
193 | struct rfbi_timings { | ||
194 | int cs_on_time; | ||
195 | int cs_off_time; | ||
196 | int we_on_time; | ||
197 | int we_off_time; | ||
198 | int re_on_time; | ||
199 | int re_off_time; | ||
200 | int we_cycle_time; | ||
201 | int re_cycle_time; | ||
202 | int cs_pulse_width; | ||
203 | int access_time; | ||
204 | |||
205 | int clk_div; | ||
206 | |||
207 | u32 tim[5]; /* set by rfbi_convert_timings() */ | ||
208 | |||
209 | int converted; | ||
210 | }; | ||
211 | |||
212 | void omap_rfbi_write_command(const void *buf, u32 len); | ||
213 | void omap_rfbi_read_data(void *buf, u32 len); | ||
214 | void omap_rfbi_write_data(const void *buf, u32 len); | ||
215 | void omap_rfbi_write_pixels(const void __iomem *buf, int scr_width, | ||
216 | u16 x, u16 y, | ||
217 | u16 w, u16 h); | ||
218 | int omap_rfbi_enable_te(bool enable, unsigned line); | ||
219 | int omap_rfbi_setup_te(enum omap_rfbi_te_mode mode, | ||
220 | unsigned hs_pulse_time, unsigned vs_pulse_time, | ||
221 | int hs_pol_inv, int vs_pol_inv, int extif_div); | ||
222 | void rfbi_bus_lock(void); | ||
223 | void rfbi_bus_unlock(void); | ||
224 | |||
225 | /* DSI */ | ||
226 | void dsi_bus_lock(struct omap_dss_device *dssdev); | ||
227 | void dsi_bus_unlock(struct omap_dss_device *dssdev); | ||
228 | int dsi_vc_dcs_write(struct omap_dss_device *dssdev, int channel, u8 *data, | ||
229 | int len); | ||
230 | int dsi_vc_dcs_write_0(struct omap_dss_device *dssdev, int channel, | ||
231 | u8 dcs_cmd); | ||
232 | int dsi_vc_dcs_write_1(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, | ||
233 | u8 param); | ||
234 | int dsi_vc_dcs_write_nosync(struct omap_dss_device *dssdev, int channel, | ||
235 | u8 *data, int len); | ||
236 | int dsi_vc_dcs_read(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, | ||
237 | u8 *buf, int buflen); | ||
238 | int dsi_vc_dcs_read_1(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, | ||
239 | u8 *data); | ||
240 | int dsi_vc_dcs_read_2(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, | ||
241 | u8 *data1, u8 *data2); | ||
242 | int dsi_vc_set_max_rx_packet_size(struct omap_dss_device *dssdev, int channel, | ||
243 | u16 len); | ||
244 | int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel); | ||
245 | int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel); | ||
246 | |||
247 | /* Board specific data */ | ||
248 | struct omap_dss_board_info { | ||
249 | int (*get_last_off_on_transaction_id)(struct device *dev); | ||
250 | int num_devices; | ||
251 | struct omap_dss_device **devices; | ||
252 | struct omap_dss_device *default_device; | ||
253 | void (*dsi_mux_pads)(bool enable); | ||
254 | }; | ||
255 | |||
256 | #if defined(CONFIG_OMAP2_DSS_MODULE) || defined(CONFIG_OMAP2_DSS) | ||
257 | /* Init with the board info */ | ||
258 | extern int omap_display_init(struct omap_dss_board_info *board_data); | ||
259 | #else | ||
260 | static inline int omap_display_init(struct omap_dss_board_info *board_data) | ||
261 | { | ||
262 | return 0; | ||
263 | } | ||
264 | #endif | ||
265 | |||
266 | struct omap_display_platform_data { | ||
267 | struct omap_dss_board_info *board_data; | ||
268 | /* TODO: Additional members to be added when PM is considered */ | ||
269 | |||
270 | bool (*opt_clock_available)(const char *clk_role); | ||
271 | }; | ||
272 | |||
273 | struct omap_video_timings { | ||
274 | /* Unit: pixels */ | ||
275 | u16 x_res; | ||
276 | /* Unit: pixels */ | ||
277 | u16 y_res; | ||
278 | /* Unit: KHz */ | ||
279 | u32 pixel_clock; | ||
280 | /* Unit: pixel clocks */ | ||
281 | u16 hsw; /* Horizontal synchronization pulse width */ | ||
282 | /* Unit: pixel clocks */ | ||
283 | u16 hfp; /* Horizontal front porch */ | ||
284 | /* Unit: pixel clocks */ | ||
285 | u16 hbp; /* Horizontal back porch */ | ||
286 | /* Unit: line clocks */ | ||
287 | u16 vsw; /* Vertical synchronization pulse width */ | ||
288 | /* Unit: line clocks */ | ||
289 | u16 vfp; /* Vertical front porch */ | ||
290 | /* Unit: line clocks */ | ||
291 | u16 vbp; /* Vertical back porch */ | ||
292 | }; | ||
293 | |||
294 | #ifdef CONFIG_OMAP2_DSS_VENC | ||
295 | /* Hardcoded timings for tv modes. Venc only uses these to | ||
296 | * identify the mode, and does not actually use the configs | ||
297 | * itself. However, the configs should be something that | ||
298 | * a normal monitor can also show */ | ||
299 | extern const struct omap_video_timings omap_dss_pal_timings; | ||
300 | extern const struct omap_video_timings omap_dss_ntsc_timings; | ||
301 | #endif | ||
302 | |||
303 | struct omap_overlay_info { | ||
304 | bool enabled; | ||
305 | |||
306 | u32 paddr; | ||
307 | void __iomem *vaddr; | ||
308 | u32 p_uv_addr; /* for NV12 format */ | ||
309 | u16 screen_width; | ||
310 | u16 width; | ||
311 | u16 height; | ||
312 | enum omap_color_mode color_mode; | ||
313 | u8 rotation; | ||
314 | enum omap_dss_rotation_type rotation_type; | ||
315 | bool mirror; | ||
316 | |||
317 | u16 pos_x; | ||
318 | u16 pos_y; | ||
319 | u16 out_width; /* if 0, out_width == width */ | ||
320 | u16 out_height; /* if 0, out_height == height */ | ||
321 | u8 global_alpha; | ||
322 | u8 pre_mult_alpha; | ||
323 | }; | ||
324 | |||
325 | struct omap_overlay { | ||
326 | struct kobject kobj; | ||
327 | struct list_head list; | ||
328 | |||
329 | /* static fields */ | ||
330 | const char *name; | ||
331 | int id; | ||
332 | enum omap_color_mode supported_modes; | ||
333 | enum omap_overlay_caps caps; | ||
334 | |||
335 | /* dynamic fields */ | ||
336 | struct omap_overlay_manager *manager; | ||
337 | struct omap_overlay_info info; | ||
338 | |||
339 | /* if true, info has been changed, but not applied() yet */ | ||
340 | bool info_dirty; | ||
341 | |||
342 | int (*set_manager)(struct omap_overlay *ovl, | ||
343 | struct omap_overlay_manager *mgr); | ||
344 | int (*unset_manager)(struct omap_overlay *ovl); | ||
345 | |||
346 | int (*set_overlay_info)(struct omap_overlay *ovl, | ||
347 | struct omap_overlay_info *info); | ||
348 | void (*get_overlay_info)(struct omap_overlay *ovl, | ||
349 | struct omap_overlay_info *info); | ||
350 | |||
351 | int (*wait_for_go)(struct omap_overlay *ovl); | ||
352 | }; | ||
353 | |||
354 | struct omap_overlay_manager_info { | ||
355 | u32 default_color; | ||
356 | |||
357 | enum omap_dss_trans_key_type trans_key_type; | ||
358 | u32 trans_key; | ||
359 | bool trans_enabled; | ||
360 | |||
361 | bool alpha_enabled; | ||
362 | }; | ||
363 | |||
364 | struct omap_overlay_manager { | ||
365 | struct kobject kobj; | ||
366 | struct list_head list; | ||
367 | |||
368 | /* static fields */ | ||
369 | const char *name; | ||
370 | int id; | ||
371 | enum omap_overlay_manager_caps caps; | ||
372 | int num_overlays; | ||
373 | struct omap_overlay **overlays; | ||
374 | enum omap_display_type supported_displays; | ||
375 | |||
376 | /* dynamic fields */ | ||
377 | struct omap_dss_device *device; | ||
378 | struct omap_overlay_manager_info info; | ||
379 | |||
380 | bool device_changed; | ||
381 | /* if true, info has been changed but not applied() yet */ | ||
382 | bool info_dirty; | ||
383 | |||
384 | int (*set_device)(struct omap_overlay_manager *mgr, | ||
385 | struct omap_dss_device *dssdev); | ||
386 | int (*unset_device)(struct omap_overlay_manager *mgr); | ||
387 | |||
388 | int (*set_manager_info)(struct omap_overlay_manager *mgr, | ||
389 | struct omap_overlay_manager_info *info); | ||
390 | void (*get_manager_info)(struct omap_overlay_manager *mgr, | ||
391 | struct omap_overlay_manager_info *info); | ||
392 | |||
393 | int (*apply)(struct omap_overlay_manager *mgr); | ||
394 | int (*wait_for_go)(struct omap_overlay_manager *mgr); | ||
395 | int (*wait_for_vsync)(struct omap_overlay_manager *mgr); | ||
396 | |||
397 | int (*enable)(struct omap_overlay_manager *mgr); | ||
398 | int (*disable)(struct omap_overlay_manager *mgr); | ||
399 | }; | ||
400 | |||
401 | struct omap_dss_device { | ||
402 | struct device dev; | ||
403 | |||
404 | enum omap_display_type type; | ||
405 | |||
406 | enum omap_channel channel; | ||
407 | |||
408 | union { | ||
409 | struct { | ||
410 | u8 data_lines; | ||
411 | } dpi; | ||
412 | |||
413 | struct { | ||
414 | u8 channel; | ||
415 | u8 data_lines; | ||
416 | } rfbi; | ||
417 | |||
418 | struct { | ||
419 | u8 datapairs; | ||
420 | } sdi; | ||
421 | |||
422 | struct { | ||
423 | u8 clk_lane; | ||
424 | u8 clk_pol; | ||
425 | u8 data1_lane; | ||
426 | u8 data1_pol; | ||
427 | u8 data2_lane; | ||
428 | u8 data2_pol; | ||
429 | u8 data3_lane; | ||
430 | u8 data3_pol; | ||
431 | u8 data4_lane; | ||
432 | u8 data4_pol; | ||
433 | |||
434 | int module; | ||
435 | |||
436 | bool ext_te; | ||
437 | u8 ext_te_gpio; | ||
438 | } dsi; | ||
439 | |||
440 | struct { | ||
441 | enum omap_dss_venc_type type; | ||
442 | bool invert_polarity; | ||
443 | } venc; | ||
444 | } phy; | ||
445 | |||
446 | struct { | ||
447 | struct { | ||
448 | struct { | ||
449 | u16 lck_div; | ||
450 | u16 pck_div; | ||
451 | enum omap_dss_clk_source lcd_clk_src; | ||
452 | } channel; | ||
453 | |||
454 | enum omap_dss_clk_source dispc_fclk_src; | ||
455 | } dispc; | ||
456 | |||
457 | struct { | ||
458 | u16 regn; | ||
459 | u16 regm; | ||
460 | u16 regm_dispc; | ||
461 | u16 regm_dsi; | ||
462 | |||
463 | u16 lp_clk_div; | ||
464 | enum omap_dss_clk_source dsi_fclk_src; | ||
465 | } dsi; | ||
466 | |||
467 | struct { | ||
468 | u16 regn; | ||
469 | u16 regm2; | ||
470 | } hdmi; | ||
471 | } clocks; | ||
472 | |||
473 | struct { | ||
474 | struct omap_video_timings timings; | ||
475 | |||
476 | int acbi; /* ac-bias pin transitions per interrupt */ | ||
477 | /* Unit: line clocks */ | ||
478 | int acb; /* ac-bias pin frequency */ | ||
479 | |||
480 | enum omap_panel_config config; | ||
481 | } panel; | ||
482 | |||
483 | struct { | ||
484 | u8 pixel_size; | ||
485 | struct rfbi_timings rfbi_timings; | ||
486 | } ctrl; | ||
487 | |||
488 | int reset_gpio; | ||
489 | |||
490 | int max_backlight_level; | ||
491 | |||
492 | const char *name; | ||
493 | |||
494 | /* used to match device to driver */ | ||
495 | const char *driver_name; | ||
496 | |||
497 | void *data; | ||
498 | |||
499 | struct omap_dss_driver *driver; | ||
500 | |||
501 | /* helper variable for driver suspend/resume */ | ||
502 | bool activate_after_resume; | ||
503 | |||
504 | enum omap_display_caps caps; | ||
505 | |||
506 | struct omap_overlay_manager *manager; | ||
507 | |||
508 | enum omap_dss_display_state state; | ||
509 | |||
510 | /* platform specific */ | ||
511 | int (*platform_enable)(struct omap_dss_device *dssdev); | ||
512 | void (*platform_disable)(struct omap_dss_device *dssdev); | ||
513 | int (*set_backlight)(struct omap_dss_device *dssdev, int level); | ||
514 | int (*get_backlight)(struct omap_dss_device *dssdev); | ||
515 | }; | ||
516 | |||
517 | struct omap_dss_driver { | ||
518 | struct device_driver driver; | ||
519 | |||
520 | int (*probe)(struct omap_dss_device *); | ||
521 | void (*remove)(struct omap_dss_device *); | ||
522 | |||
523 | int (*enable)(struct omap_dss_device *display); | ||
524 | void (*disable)(struct omap_dss_device *display); | ||
525 | int (*suspend)(struct omap_dss_device *display); | ||
526 | int (*resume)(struct omap_dss_device *display); | ||
527 | int (*run_test)(struct omap_dss_device *display, int test); | ||
528 | |||
529 | int (*set_update_mode)(struct omap_dss_device *dssdev, | ||
530 | enum omap_dss_update_mode); | ||
531 | enum omap_dss_update_mode (*get_update_mode)( | ||
532 | struct omap_dss_device *dssdev); | ||
533 | |||
534 | int (*update)(struct omap_dss_device *dssdev, | ||
535 | u16 x, u16 y, u16 w, u16 h); | ||
536 | int (*sync)(struct omap_dss_device *dssdev); | ||
537 | |||
538 | int (*enable_te)(struct omap_dss_device *dssdev, bool enable); | ||
539 | int (*get_te)(struct omap_dss_device *dssdev); | ||
540 | |||
541 | u8 (*get_rotate)(struct omap_dss_device *dssdev); | ||
542 | int (*set_rotate)(struct omap_dss_device *dssdev, u8 rotate); | ||
543 | |||
544 | bool (*get_mirror)(struct omap_dss_device *dssdev); | ||
545 | int (*set_mirror)(struct omap_dss_device *dssdev, bool enable); | ||
546 | |||
547 | int (*memory_read)(struct omap_dss_device *dssdev, | ||
548 | void *buf, size_t size, | ||
549 | u16 x, u16 y, u16 w, u16 h); | ||
550 | |||
551 | void (*get_resolution)(struct omap_dss_device *dssdev, | ||
552 | u16 *xres, u16 *yres); | ||
553 | void (*get_dimensions)(struct omap_dss_device *dssdev, | ||
554 | u32 *width, u32 *height); | ||
555 | int (*get_recommended_bpp)(struct omap_dss_device *dssdev); | ||
556 | |||
557 | int (*check_timings)(struct omap_dss_device *dssdev, | ||
558 | struct omap_video_timings *timings); | ||
559 | void (*set_timings)(struct omap_dss_device *dssdev, | ||
560 | struct omap_video_timings *timings); | ||
561 | void (*get_timings)(struct omap_dss_device *dssdev, | ||
562 | struct omap_video_timings *timings); | ||
563 | |||
564 | int (*set_wss)(struct omap_dss_device *dssdev, u32 wss); | ||
565 | u32 (*get_wss)(struct omap_dss_device *dssdev); | ||
566 | }; | ||
567 | |||
568 | int omap_dss_register_driver(struct omap_dss_driver *); | ||
569 | void omap_dss_unregister_driver(struct omap_dss_driver *); | ||
570 | |||
571 | void omap_dss_get_device(struct omap_dss_device *dssdev); | ||
572 | void omap_dss_put_device(struct omap_dss_device *dssdev); | ||
573 | #define for_each_dss_dev(d) while ((d = omap_dss_get_next_device(d)) != NULL) | ||
574 | struct omap_dss_device *omap_dss_get_next_device(struct omap_dss_device *from); | ||
575 | struct omap_dss_device *omap_dss_find_device(void *data, | ||
576 | int (*match)(struct omap_dss_device *dssdev, void *data)); | ||
577 | |||
578 | int omap_dss_start_device(struct omap_dss_device *dssdev); | ||
579 | void omap_dss_stop_device(struct omap_dss_device *dssdev); | ||
580 | |||
581 | int omap_dss_get_num_overlay_managers(void); | ||
582 | struct omap_overlay_manager *omap_dss_get_overlay_manager(int num); | ||
583 | |||
584 | int omap_dss_get_num_overlays(void); | ||
585 | struct omap_overlay *omap_dss_get_overlay(int num); | ||
586 | |||
587 | void omapdss_default_get_resolution(struct omap_dss_device *dssdev, | ||
588 | u16 *xres, u16 *yres); | ||
589 | int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev); | ||
590 | |||
591 | typedef void (*omap_dispc_isr_t) (void *arg, u32 mask); | ||
592 | int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask); | ||
593 | int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void *arg, u32 mask); | ||
594 | |||
595 | int omap_dispc_wait_for_irq_timeout(u32 irqmask, unsigned long timeout); | ||
596 | int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask, | ||
597 | unsigned long timeout); | ||
598 | |||
599 | #define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver) | ||
600 | #define to_dss_device(x) container_of((x), struct omap_dss_device, dev) | ||
601 | |||
602 | void omapdss_dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel, | ||
603 | bool enable); | ||
604 | int omapdss_dsi_enable_te(struct omap_dss_device *dssdev, bool enable); | ||
605 | |||
606 | int omap_dsi_prepare_update(struct omap_dss_device *dssdev, | ||
607 | u16 *x, u16 *y, u16 *w, u16 *h, | ||
608 | bool enlarge_update_area); | ||
609 | int omap_dsi_update(struct omap_dss_device *dssdev, | ||
610 | int channel, | ||
611 | u16 x, u16 y, u16 w, u16 h, | ||
612 | void (*callback)(int, void *), void *data); | ||
613 | int omap_dsi_request_vc(struct omap_dss_device *dssdev, int *channel); | ||
614 | int omap_dsi_set_vc_id(struct omap_dss_device *dssdev, int channel, int vc_id); | ||
615 | void omap_dsi_release_vc(struct omap_dss_device *dssdev, int channel); | ||
616 | |||
617 | int omapdss_dsi_display_enable(struct omap_dss_device *dssdev); | ||
618 | void omapdss_dsi_display_disable(struct omap_dss_device *dssdev, | ||
619 | bool disconnect_lanes, bool enter_ulps); | ||
620 | |||
621 | int omapdss_dpi_display_enable(struct omap_dss_device *dssdev); | ||
622 | void omapdss_dpi_display_disable(struct omap_dss_device *dssdev); | ||
623 | void dpi_set_timings(struct omap_dss_device *dssdev, | ||
624 | struct omap_video_timings *timings); | ||
625 | int dpi_check_timings(struct omap_dss_device *dssdev, | ||
626 | struct omap_video_timings *timings); | ||
627 | |||
628 | int omapdss_sdi_display_enable(struct omap_dss_device *dssdev); | ||
629 | void omapdss_sdi_display_disable(struct omap_dss_device *dssdev); | ||
630 | |||
631 | int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev); | ||
632 | void omapdss_rfbi_display_disable(struct omap_dss_device *dssdev); | ||
633 | int omap_rfbi_prepare_update(struct omap_dss_device *dssdev, | ||
634 | u16 *x, u16 *y, u16 *w, u16 *h); | ||
635 | int omap_rfbi_update(struct omap_dss_device *dssdev, | ||
636 | u16 x, u16 y, u16 w, u16 h, | ||
637 | void (*callback)(void *), void *data); | ||
638 | int omap_rfbi_configure(struct omap_dss_device *dssdev, int pixel_size, | ||
639 | int data_lines); | ||
640 | |||
641 | #endif | ||
diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h index 2c8d369190b3..d964e68fc61d 100644 --- a/include/video/sh_mobile_lcdc.h +++ b/include/video/sh_mobile_lcdc.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define __ASM_SH_MOBILE_LCDC_H__ | 2 | #define __ASM_SH_MOBILE_LCDC_H__ |
3 | 3 | ||
4 | #include <linux/fb.h> | 4 | #include <linux/fb.h> |
5 | #include <video/sh_mobile_meram.h> | ||
5 | 6 | ||
6 | enum { | 7 | enum { |
7 | RGB8, /* 24bpp, 8:8:8 */ | 8 | RGB8, /* 24bpp, 8:8:8 */ |
@@ -87,11 +88,13 @@ struct sh_mobile_lcdc_chan_cfg { | |||
87 | struct sh_mobile_lcdc_bl_info bl_info; | 88 | struct sh_mobile_lcdc_bl_info bl_info; |
88 | struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */ | 89 | struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */ |
89 | int nonstd; | 90 | int nonstd; |
91 | struct sh_mobile_meram_cfg *meram_cfg; | ||
90 | }; | 92 | }; |
91 | 93 | ||
92 | struct sh_mobile_lcdc_info { | 94 | struct sh_mobile_lcdc_info { |
93 | int clock_source; | 95 | int clock_source; |
94 | struct sh_mobile_lcdc_chan_cfg ch[2]; | 96 | struct sh_mobile_lcdc_chan_cfg ch[2]; |
97 | struct sh_mobile_meram_info *meram_dev; | ||
95 | }; | 98 | }; |
96 | 99 | ||
97 | #endif /* __ASM_SH_MOBILE_LCDC_H__ */ | 100 | #endif /* __ASM_SH_MOBILE_LCDC_H__ */ |
diff --git a/include/video/sh_mobile_meram.h b/include/video/sh_mobile_meram.h new file mode 100644 index 000000000000..af602d602b28 --- /dev/null +++ b/include/video/sh_mobile_meram.h | |||
@@ -0,0 +1,68 @@ | |||
1 | #ifndef __VIDEO_SH_MOBILE_MERAM_H__ | ||
2 | #define __VIDEO_SH_MOBILE_MERAM_H__ | ||
3 | |||
4 | /* For sh_mobile_meram_info.addr_mode */ | ||
5 | enum { | ||
6 | SH_MOBILE_MERAM_MODE0 = 0, | ||
7 | SH_MOBILE_MERAM_MODE1 | ||
8 | }; | ||
9 | |||
10 | enum { | ||
11 | SH_MOBILE_MERAM_PF_NV = 0, | ||
12 | SH_MOBILE_MERAM_PF_RGB, | ||
13 | SH_MOBILE_MERAM_PF_NV24 | ||
14 | }; | ||
15 | |||
16 | |||
17 | struct sh_mobile_meram_priv; | ||
18 | struct sh_mobile_meram_ops; | ||
19 | |||
20 | struct sh_mobile_meram_info { | ||
21 | int addr_mode; | ||
22 | struct sh_mobile_meram_ops *ops; | ||
23 | struct sh_mobile_meram_priv *priv; | ||
24 | struct platform_device *pdev; | ||
25 | }; | ||
26 | |||
27 | /* icb config */ | ||
28 | struct sh_mobile_meram_icb { | ||
29 | int marker_icb; /* ICB # for Marker ICB */ | ||
30 | int cache_icb; /* ICB # for Cache ICB */ | ||
31 | int meram_offset; /* MERAM Buffer Offset to use */ | ||
32 | int meram_size; /* MERAM Buffer Size to use */ | ||
33 | |||
34 | int cache_unit; /* bytes to cache per ICB */ | ||
35 | }; | ||
36 | |||
37 | struct sh_mobile_meram_cfg { | ||
38 | struct sh_mobile_meram_icb icb[2]; | ||
39 | int pixelformat; | ||
40 | int current_reg; | ||
41 | }; | ||
42 | |||
43 | struct module; | ||
44 | struct sh_mobile_meram_ops { | ||
45 | struct module *module; | ||
46 | /* register usage of meram */ | ||
47 | int (*meram_register)(struct sh_mobile_meram_info *meram_dev, | ||
48 | struct sh_mobile_meram_cfg *cfg, | ||
49 | int xres, int yres, int pixelformat, | ||
50 | unsigned long base_addr_y, | ||
51 | unsigned long base_addr_c, | ||
52 | unsigned long *icb_addr_y, | ||
53 | unsigned long *icb_addr_c, int *pitch); | ||
54 | |||
55 | /* unregister usage of meram */ | ||
56 | int (*meram_unregister)(struct sh_mobile_meram_info *meram_dev, | ||
57 | struct sh_mobile_meram_cfg *cfg); | ||
58 | |||
59 | /* update meram settings */ | ||
60 | int (*meram_update)(struct sh_mobile_meram_info *meram_dev, | ||
61 | struct sh_mobile_meram_cfg *cfg, | ||
62 | unsigned long base_addr_y, | ||
63 | unsigned long base_addr_c, | ||
64 | unsigned long *icb_addr_y, | ||
65 | unsigned long *icb_addr_c); | ||
66 | }; | ||
67 | |||
68 | #endif /* __VIDEO_SH_MOBILE_MERAM_H__ */ | ||
diff --git a/include/xen/interface/io/blkif.h b/include/xen/interface/io/blkif.h index 61e523af3c46..3d5d6db864fe 100644 --- a/include/xen/interface/io/blkif.h +++ b/include/xen/interface/io/blkif.h | |||
@@ -45,6 +45,19 @@ typedef uint64_t blkif_sector_t; | |||
45 | #define BLKIF_OP_WRITE_BARRIER 2 | 45 | #define BLKIF_OP_WRITE_BARRIER 2 |
46 | 46 | ||
47 | /* | 47 | /* |
48 | * Recognised if "feature-flush-cache" is present in backend xenbus | ||
49 | * info. A flush will ask the underlying storage hardware to flush its | ||
50 | * non-volatile caches as appropriate. The "feature-flush-cache" node | ||
51 | * contains a boolean indicating whether flush requests are likely to | ||
52 | * succeed or fail. Either way, a flush request may fail at any time | ||
53 | * with BLKIF_RSP_EOPNOTSUPP if it is unsupported by the underlying | ||
54 | * block-device hardware. The boolean simply indicates whether or not it | ||
55 | * is worthwhile for the frontend to attempt flushes. If a backend does | ||
56 | * not recognise BLKIF_OP_WRITE_FLUSH_CACHE, it should *not* create the | ||
57 | * "feature-flush-cache" node! | ||
58 | */ | ||
59 | #define BLKIF_OP_FLUSH_DISKCACHE 3 | ||
60 | /* | ||
48 | * Maximum scatter/gather segments per request. | 61 | * Maximum scatter/gather segments per request. |
49 | * This is carefully chosen so that sizeof(struct blkif_ring) <= PAGE_SIZE. | 62 | * This is carefully chosen so that sizeof(struct blkif_ring) <= PAGE_SIZE. |
50 | * NB. This could be 12 if the ring indexes weren't stored in the same page. | 63 | * NB. This could be 12 if the ring indexes weren't stored in the same page. |