diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-15 21:50:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-15 21:50:19 -0400 |
commit | 835a906c74ecf20cdb817d6d02975cc0ba421e35 (patch) | |
tree | 86db6424947e8f5b4ddb1f7f6bfdaf9353f194d7 /include | |
parent | e089d43fb1ab8e39168c9f61d30aef5b8724d085 (diff) | |
parent | 51a41e7d39ce0da1198837aaa495fe6dbcc4f802 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh64-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh64-2.6:
sh64: Add .gitignore entry for syscalltab.
sh64: generic quicklist support.
sh64: Update cayman defconfig.
sh64: Fixup sh-sci build.
sh64: ppoll/pselect6() and restartable syscalls.
sh64: dma-mapping updates.
sh64: Fixups for the irq_regs changes.
sh64: Wire up many new syscalls.
spelling fixes: arch/sh64/
sh64: ROUND_UP macro cleanup in arch/sh64/kernel/pci_sh5.c
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-sh64/dma-mapping.h | 14 | ||||
-rw-r--r-- | include/asm-sh64/irq_regs.h | 1 | ||||
-rw-r--r-- | include/asm-sh64/pgalloc.h | 100 | ||||
-rw-r--r-- | include/asm-sh64/sci.h | 1 | ||||
-rw-r--r-- | include/asm-sh64/thread_info.h | 6 | ||||
-rw-r--r-- | include/asm-sh64/unistd.h | 43 |
6 files changed, 77 insertions, 88 deletions
diff --git a/include/asm-sh64/dma-mapping.h b/include/asm-sh64/dma-mapping.h index 5efe906c59f7..c7c0f059cdc4 100644 --- a/include/asm-sh64/dma-mapping.h +++ b/include/asm-sh64/dma-mapping.h | |||
@@ -35,6 +35,10 @@ static inline void dma_free_coherent(struct device *dev, size_t size, | |||
35 | consistent_free(NULL, size, vaddr, dma_handle); | 35 | consistent_free(NULL, size, vaddr, dma_handle); |
36 | } | 36 | } |
37 | 37 | ||
38 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) | ||
39 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) | ||
40 | #define dma_is_consistent(d, h) (1) | ||
41 | |||
38 | static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, | 42 | static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, |
39 | enum dma_data_direction dir) | 43 | enum dma_data_direction dir) |
40 | { | 44 | { |
@@ -49,7 +53,7 @@ static inline dma_addr_t dma_map_single(struct device *dev, | |||
49 | if (dev->bus == &pci_bus_type) | 53 | if (dev->bus == &pci_bus_type) |
50 | return virt_to_bus(ptr); | 54 | return virt_to_bus(ptr); |
51 | #endif | 55 | #endif |
52 | dma_cache_sync(ptr, size, dir); | 56 | dma_cache_sync(dev, ptr, size, dir); |
53 | 57 | ||
54 | return virt_to_bus(ptr); | 58 | return virt_to_bus(ptr); |
55 | } | 59 | } |
@@ -63,7 +67,7 @@ static inline int dma_map_sg(struct device *dev, struct scatterlist *sg, | |||
63 | 67 | ||
64 | for (i = 0; i < nents; i++) { | 68 | for (i = 0; i < nents; i++) { |
65 | #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) | 69 | #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) |
66 | dma_cache_sync(page_address(sg[i].page) + sg[i].offset, | 70 | dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset, |
67 | sg[i].length, dir); | 71 | sg[i].length, dir); |
68 | #endif | 72 | #endif |
69 | sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset; | 73 | sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset; |
@@ -94,7 +98,7 @@ static inline void dma_sync_single(struct device *dev, dma_addr_t dma_handle, | |||
94 | if (dev->bus == &pci_bus_type) | 98 | if (dev->bus == &pci_bus_type) |
95 | return; | 99 | return; |
96 | #endif | 100 | #endif |
97 | dma_cache_sync(bus_to_virt(dma_handle), size, dir); | 101 | dma_cache_sync(dev, bus_to_virt(dma_handle), size, dir); |
98 | } | 102 | } |
99 | 103 | ||
100 | static inline void dma_sync_single_range(struct device *dev, | 104 | static inline void dma_sync_single_range(struct device *dev, |
@@ -106,7 +110,7 @@ static inline void dma_sync_single_range(struct device *dev, | |||
106 | if (dev->bus == &pci_bus_type) | 110 | if (dev->bus == &pci_bus_type) |
107 | return; | 111 | return; |
108 | #endif | 112 | #endif |
109 | dma_cache_sync(bus_to_virt(dma_handle) + offset, size, dir); | 113 | dma_cache_sync(dev, bus_to_virt(dma_handle) + offset, size, dir); |
110 | } | 114 | } |
111 | 115 | ||
112 | static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg, | 116 | static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg, |
@@ -116,7 +120,7 @@ static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg, | |||
116 | 120 | ||
117 | for (i = 0; i < nelems; i++) { | 121 | for (i = 0; i < nelems; i++) { |
118 | #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) | 122 | #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) |
119 | dma_cache_sync(page_address(sg[i].page) + sg[i].offset, | 123 | dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset, |
120 | sg[i].length, dir); | 124 | sg[i].length, dir); |
121 | #endif | 125 | #endif |
122 | sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset; | 126 | sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset; |
diff --git a/include/asm-sh64/irq_regs.h b/include/asm-sh64/irq_regs.h new file mode 100644 index 000000000000..3dd9c0b70270 --- /dev/null +++ b/include/asm-sh64/irq_regs.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/irq_regs.h> | |||
diff --git a/include/asm-sh64/pgalloc.h b/include/asm-sh64/pgalloc.h index cb803e56cb64..6eccab770a6d 100644 --- a/include/asm-sh64/pgalloc.h +++ b/include/asm-sh64/pgalloc.h | |||
@@ -14,13 +14,9 @@ | |||
14 | * | 14 | * |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include <linux/threads.h> | ||
18 | #include <linux/mm.h> | 17 | #include <linux/mm.h> |
19 | 18 | #include <linux/quicklist.h> | |
20 | #define pgd_quicklist (current_cpu_data.pgd_quick) | 19 | #include <asm/page.h> |
21 | #define pmd_quicklist (current_cpu_data.pmd_quick) | ||
22 | #define pte_quicklist (current_cpu_data.pte_quick) | ||
23 | #define pgtable_cache_size (current_cpu_data.pgtable_cache_sz) | ||
24 | 20 | ||
25 | static inline void pgd_init(unsigned long page) | 21 | static inline void pgd_init(unsigned long page) |
26 | { | 22 | { |
@@ -45,84 +41,37 @@ static inline pgd_t *get_pgd_slow(void) | |||
45 | return ret; | 41 | return ret; |
46 | } | 42 | } |
47 | 43 | ||
48 | static inline pgd_t *get_pgd_fast(void) | 44 | static inline pgd_t *pgd_alloc(struct mm_struct *mm) |
49 | { | ||
50 | unsigned long *ret; | ||
51 | |||
52 | if ((ret = pgd_quicklist) != NULL) { | ||
53 | pgd_quicklist = (unsigned long *)(*ret); | ||
54 | ret[0] = 0; | ||
55 | pgtable_cache_size--; | ||
56 | } else | ||
57 | ret = (unsigned long *)get_pgd_slow(); | ||
58 | |||
59 | if (ret) { | ||
60 | memset(ret, 0, USER_PTRS_PER_PGD * sizeof(pgd_t)); | ||
61 | } | ||
62 | return (pgd_t *)ret; | ||
63 | } | ||
64 | |||
65 | static inline void free_pgd_fast(pgd_t *pgd) | ||
66 | { | ||
67 | *(unsigned long *)pgd = (unsigned long) pgd_quicklist; | ||
68 | pgd_quicklist = (unsigned long *) pgd; | ||
69 | pgtable_cache_size++; | ||
70 | } | ||
71 | |||
72 | static inline void free_pgd_slow(pgd_t *pgd) | ||
73 | { | 45 | { |
74 | kfree((void *)pgd); | 46 | return quicklist_alloc(0, GFP_KERNEL, NULL); |
75 | } | 47 | } |
76 | 48 | ||
77 | extern pte_t *get_pte_slow(pmd_t *pmd, unsigned long address_preadjusted); | 49 | static inline void pgd_free(pgd_t *pgd) |
78 | extern pte_t *get_pte_kernel_slow(pmd_t *pmd, unsigned long address_preadjusted); | ||
79 | |||
80 | static inline pte_t *get_pte_fast(void) | ||
81 | { | 50 | { |
82 | unsigned long *ret; | 51 | quicklist_free(0, NULL, pgd); |
83 | |||
84 | if((ret = (unsigned long *)pte_quicklist) != NULL) { | ||
85 | pte_quicklist = (unsigned long *)(*ret); | ||
86 | ret[0] = ret[1]; | ||
87 | pgtable_cache_size--; | ||
88 | } | ||
89 | return (pte_t *)ret; | ||
90 | } | 52 | } |
91 | 53 | ||
92 | static inline void free_pte_fast(pte_t *pte) | 54 | static inline struct page *pte_alloc_one(struct mm_struct *mm, |
55 | unsigned long address) | ||
93 | { | 56 | { |
94 | *(unsigned long *)pte = (unsigned long) pte_quicklist; | 57 | void *pg = quicklist_alloc(0, GFP_KERNEL, NULL); |
95 | pte_quicklist = (unsigned long *) pte; | 58 | return pg ? virt_to_page(pg) : NULL; |
96 | pgtable_cache_size++; | ||
97 | } | 59 | } |
98 | 60 | ||
99 | static inline void pte_free_kernel(pte_t *pte) | 61 | static inline void pte_free_kernel(pte_t *pte) |
100 | { | 62 | { |
101 | free_page((unsigned long)pte); | 63 | quicklist_free(0, NULL, pte); |
102 | } | 64 | } |
103 | 65 | ||
104 | static inline void pte_free(struct page *pte) | 66 | static inline void pte_free(struct page *pte) |
105 | { | 67 | { |
106 | __free_page(pte); | 68 | quicklist_free_page(0, NULL, pte); |
107 | } | 69 | } |
108 | 70 | ||
109 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, | 71 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, |
110 | unsigned long address) | 72 | unsigned long address) |
111 | { | 73 | { |
112 | pte_t *pte; | 74 | return quicklist_alloc(0, GFP_KERNEL, NULL); |
113 | |||
114 | pte = (pte_t *)__get_free_page(GFP_KERNEL | __GFP_REPEAT|__GFP_ZERO); | ||
115 | |||
116 | return pte; | ||
117 | } | ||
118 | |||
119 | static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) | ||
120 | { | ||
121 | struct page *pte; | ||
122 | |||
123 | pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0); | ||
124 | |||
125 | return pte; | ||
126 | } | 75 | } |
127 | 76 | ||
128 | #define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte)) | 77 | #define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte)) |
@@ -142,31 +91,23 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long add | |||
142 | 91 | ||
143 | #elif defined(CONFIG_SH64_PGTABLE_3_LEVEL) | 92 | #elif defined(CONFIG_SH64_PGTABLE_3_LEVEL) |
144 | 93 | ||
145 | static __inline__ pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) | 94 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) |
146 | { | 95 | { |
147 | pmd_t *pmd; | 96 | return quicklist_alloc(0, GFP_KERNEL, NULL); |
148 | pmd = (pmd_t *) __get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); | ||
149 | return pmd; | ||
150 | } | 97 | } |
151 | 98 | ||
152 | static __inline__ void pmd_free(pmd_t *pmd) | 99 | static inline void pmd_free(pmd_t *pmd) |
153 | { | 100 | { |
154 | free_page((unsigned long) pmd); | 101 | quicklist_free(0, NULL, pmd); |
155 | } | 102 | } |
156 | 103 | ||
157 | #define pgd_populate(mm, pgd, pmd) pgd_set(pgd, pmd) | 104 | #define pgd_populate(mm, pgd, pmd) pgd_set(pgd, pmd) |
158 | #define __pmd_free_tlb(tlb,pmd) pmd_free(pmd) | 105 | #define __pmd_free_tlb(tlb,pmd) pmd_free(pmd) |
159 | 106 | ||
160 | #else | 107 | #else |
161 | #error "No defined page table size" | 108 | #error "No defined page table size" |
162 | #endif | 109 | #endif |
163 | 110 | ||
164 | #define check_pgt_cache() do { } while (0) | ||
165 | #define pgd_free(pgd) free_pgd_slow(pgd) | ||
166 | #define pgd_alloc(mm) get_pgd_fast() | ||
167 | |||
168 | extern int do_check_pgt_cache(int, int); | ||
169 | |||
170 | #define pmd_populate_kernel(mm, pmd, pte) \ | 111 | #define pmd_populate_kernel(mm, pmd, pte) \ |
171 | set_pmd(pmd, __pmd(_PAGE_TABLE + (unsigned long) (pte))) | 112 | set_pmd(pmd, __pmd(_PAGE_TABLE + (unsigned long) (pte))) |
172 | 113 | ||
@@ -176,4 +117,9 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, | |||
176 | set_pmd(pmd, __pmd(_PAGE_TABLE + (unsigned long) page_address (pte))); | 117 | set_pmd(pmd, __pmd(_PAGE_TABLE + (unsigned long) page_address (pte))); |
177 | } | 118 | } |
178 | 119 | ||
120 | static inline void check_pgt_cache(void) | ||
121 | { | ||
122 | quicklist_trim(0, NULL, 25, 16); | ||
123 | } | ||
124 | |||
179 | #endif /* __ASM_SH64_PGALLOC_H */ | 125 | #endif /* __ASM_SH64_PGALLOC_H */ |
diff --git a/include/asm-sh64/sci.h b/include/asm-sh64/sci.h new file mode 100644 index 000000000000..793c568b7820 --- /dev/null +++ b/include/asm-sh64/sci.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-sh/sci.h> | |||
diff --git a/include/asm-sh64/thread_info.h b/include/asm-sh64/thread_info.h index 1f825cb163c3..f6d5117c53af 100644 --- a/include/asm-sh64/thread_info.h +++ b/include/asm-sh64/thread_info.h | |||
@@ -78,7 +78,13 @@ static inline struct thread_info *current_thread_info(void) | |||
78 | #define TIF_SIGPENDING 2 /* signal pending */ | 78 | #define TIF_SIGPENDING 2 /* signal pending */ |
79 | #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ | 79 | #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ |
80 | #define TIF_MEMDIE 4 | 80 | #define TIF_MEMDIE 4 |
81 | #define TIF_RESTORE_SIGMASK 5 /* Restore signal mask in do_signal */ | ||
81 | 82 | ||
83 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) | ||
84 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) | ||
85 | #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) | ||
86 | #define _TIF_MEMDIE (1 << TIF_MEMDIE) | ||
87 | #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) | ||
82 | 88 | ||
83 | #endif /* __KERNEL__ */ | 89 | #endif /* __KERNEL__ */ |
84 | 90 | ||
diff --git a/include/asm-sh64/unistd.h b/include/asm-sh64/unistd.h index 1f38a7aacaaf..ea3adc600b41 100644 --- a/include/asm-sh64/unistd.h +++ b/include/asm-sh64/unistd.h | |||
@@ -9,14 +9,14 @@ | |||
9 | * include/asm-sh64/unistd.h | 9 | * include/asm-sh64/unistd.h |
10 | * | 10 | * |
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | 11 | * Copyright (C) 2000, 2001 Paolo Alberelli |
12 | * Copyright (C) 2003 Paul Mundt | 12 | * Copyright (C) 2003 - 2007 Paul Mundt |
13 | * Copyright (C) 2004 Sean McGoogan | 13 | * Copyright (C) 2004 Sean McGoogan |
14 | * | 14 | * |
15 | * This file contains the system call numbers. | 15 | * This file contains the system call numbers. |
16 | * | 16 | * |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #define __NR_setup 0 /* used only by init, to get system going */ | 19 | #define __NR_restart_syscall 0 |
20 | #define __NR_exit 1 | 20 | #define __NR_exit 1 |
21 | #define __NR_fork 2 | 21 | #define __NR_fork 2 |
22 | #define __NR_read 3 | 22 | #define __NR_read 3 |
@@ -196,8 +196,8 @@ | |||
196 | #define __NR_rt_sigtimedwait 177 | 196 | #define __NR_rt_sigtimedwait 177 |
197 | #define __NR_rt_sigqueueinfo 178 | 197 | #define __NR_rt_sigqueueinfo 178 |
198 | #define __NR_rt_sigsuspend 179 | 198 | #define __NR_rt_sigsuspend 179 |
199 | #define __NR_pread 180 | 199 | #define __NR_pread64 180 |
200 | #define __NR_pwrite 181 | 200 | #define __NR_pwrite64 181 |
201 | #define __NR_chown 182 | 201 | #define __NR_chown 182 |
202 | #define __NR_getcwd 183 | 202 | #define __NR_getcwd 183 |
203 | #define __NR_capget 184 | 203 | #define __NR_capget 184 |
@@ -343,10 +343,41 @@ | |||
343 | #define __NR_inotify_init 318 | 343 | #define __NR_inotify_init 318 |
344 | #define __NR_inotify_add_watch 319 | 344 | #define __NR_inotify_add_watch 319 |
345 | #define __NR_inotify_rm_watch 320 | 345 | #define __NR_inotify_rm_watch 320 |
346 | /* 321 is unused */ | ||
347 | #define __NR_migrate_pages 322 | ||
348 | #define __NR_openat 323 | ||
349 | #define __NR_mkdirat 324 | ||
350 | #define __NR_mknodat 325 | ||
351 | #define __NR_fchownat 326 | ||
352 | #define __NR_futimesat 327 | ||
353 | #define __NR_fstatat64 328 | ||
354 | #define __NR_unlinkat 329 | ||
355 | #define __NR_renameat 330 | ||
356 | #define __NR_linkat 331 | ||
357 | #define __NR_symlinkat 332 | ||
358 | #define __NR_readlinkat 333 | ||
359 | #define __NR_fchmodat 334 | ||
360 | #define __NR_faccessat 335 | ||
361 | #define __NR_pselect6 336 | ||
362 | #define __NR_ppoll 337 | ||
363 | #define __NR_unshare 338 | ||
364 | #define __NR_set_robust_list 339 | ||
365 | #define __NR_get_robust_list 340 | ||
366 | #define __NR_splice 341 | ||
367 | #define __NR_sync_file_range 342 | ||
368 | #define __NR_tee 343 | ||
369 | #define __NR_vmsplice 344 | ||
370 | #define __NR_move_pages 345 | ||
371 | #define __NR_getcpu 346 | ||
372 | #define __NR_epoll_pwait 347 | ||
373 | #define __NR_utimensat 348 | ||
374 | #define __NR_signalfd 349 | ||
375 | #define __NR_timerfd 350 | ||
376 | #define __NR_eventfd 351 | ||
346 | 377 | ||
347 | #ifdef __KERNEL__ | 378 | #ifdef __KERNEL__ |
348 | 379 | ||
349 | #define NR_syscalls 321 | 380 | #define NR_syscalls 352 |
350 | 381 | ||
351 | #define __ARCH_WANT_IPC_PARSE_VERSION | 382 | #define __ARCH_WANT_IPC_PARSE_VERSION |
352 | #define __ARCH_WANT_OLD_READDIR | 383 | #define __ARCH_WANT_OLD_READDIR |