From 6b5d1a0a2ff4fc5a26029f62eef033224ce0fa97 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Mon, 14 May 2007 09:07:27 +0900 Subject: sh64: Wire up many new syscalls. This has suffered a bit of bitrot, so we're a bit behind on the syscalls. There were a few that were wrapped incorrectly as well, caught by the syscall checker. Fix them all up. Signed-off-by: Paul Mundt --- include/asm-sh64/unistd.h | 43 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/asm-sh64/unistd.h b/include/asm-sh64/unistd.h index 1f38a7aacaa..ea3adc600b4 100644 --- a/include/asm-sh64/unistd.h +++ b/include/asm-sh64/unistd.h @@ -9,14 +9,14 @@ * include/asm-sh64/unistd.h * * Copyright (C) 2000, 2001 Paolo Alberelli - * Copyright (C) 2003 Paul Mundt + * Copyright (C) 2003 - 2007 Paul Mundt * Copyright (C) 2004 Sean McGoogan * * This file contains the system call numbers. * */ -#define __NR_setup 0 /* used only by init, to get system going */ +#define __NR_restart_syscall 0 #define __NR_exit 1 #define __NR_fork 2 #define __NR_read 3 @@ -196,8 +196,8 @@ #define __NR_rt_sigtimedwait 177 #define __NR_rt_sigqueueinfo 178 #define __NR_rt_sigsuspend 179 -#define __NR_pread 180 -#define __NR_pwrite 181 +#define __NR_pread64 180 +#define __NR_pwrite64 181 #define __NR_chown 182 #define __NR_getcwd 183 #define __NR_capget 184 @@ -343,10 +343,41 @@ #define __NR_inotify_init 318 #define __NR_inotify_add_watch 319 #define __NR_inotify_rm_watch 320 +/* 321 is unused */ +#define __NR_migrate_pages 322 +#define __NR_openat 323 +#define __NR_mkdirat 324 +#define __NR_mknodat 325 +#define __NR_fchownat 326 +#define __NR_futimesat 327 +#define __NR_fstatat64 328 +#define __NR_unlinkat 329 +#define __NR_renameat 330 +#define __NR_linkat 331 +#define __NR_symlinkat 332 +#define __NR_readlinkat 333 +#define __NR_fchmodat 334 +#define __NR_faccessat 335 +#define __NR_pselect6 336 +#define __NR_ppoll 337 +#define __NR_unshare 338 +#define __NR_set_robust_list 339 +#define __NR_get_robust_list 340 +#define __NR_splice 341 +#define __NR_sync_file_range 342 +#define __NR_tee 343 +#define __NR_vmsplice 344 +#define __NR_move_pages 345 +#define __NR_getcpu 346 +#define __NR_epoll_pwait 347 +#define __NR_utimensat 348 +#define __NR_signalfd 349 +#define __NR_timerfd 350 +#define __NR_eventfd 351 -#ifdef __KERNEL__ +#ifdef __KERNEL__ -#define NR_syscalls 321 +#define NR_syscalls 352 #define __ARCH_WANT_IPC_PARSE_VERSION #define __ARCH_WANT_OLD_READDIR -- cgit v1.2.3-18-g5258 From a226d33abccff1959cec911da4143ea06ab22052 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Mon, 14 May 2007 09:10:01 +0900 Subject: sh64: Fixups for the irq_regs changes. A few interrupt handlers were never updated, fix them up. We were missing the irq_regs conversion also, so do that at the same time. Signed-off-by: Paul Mundt --- include/asm-sh64/irq_regs.h | 1 + 1 file changed, 1 insertion(+) create mode 100644 include/asm-sh64/irq_regs.h (limited to 'include') diff --git a/include/asm-sh64/irq_regs.h b/include/asm-sh64/irq_regs.h new file mode 100644 index 00000000000..3dd9c0b7027 --- /dev/null +++ b/include/asm-sh64/irq_regs.h @@ -0,0 +1 @@ +#include -- cgit v1.2.3-18-g5258 From 599c26d32950c33bdd2a5ac6939bfe15ecf057e0 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Mon, 14 May 2007 09:10:46 +0900 Subject: sh64: dma-mapping updates. Follow the noncoherent changes from sh. Signed-off-by: Paul Mundt --- include/asm-sh64/dma-mapping.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/asm-sh64/dma-mapping.h b/include/asm-sh64/dma-mapping.h index 5efe906c59f..c7c0f059cdc 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, consistent_free(NULL, size, vaddr, dma_handle); } +#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) +#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) +#define dma_is_consistent(d, h) (1) + static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, enum dma_data_direction dir) { @@ -49,7 +53,7 @@ static inline dma_addr_t dma_map_single(struct device *dev, if (dev->bus == &pci_bus_type) return virt_to_bus(ptr); #endif - dma_cache_sync(ptr, size, dir); + dma_cache_sync(dev, ptr, size, dir); return virt_to_bus(ptr); } @@ -63,7 +67,7 @@ static inline int dma_map_sg(struct device *dev, struct scatterlist *sg, for (i = 0; i < nents; i++) { #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) - dma_cache_sync(page_address(sg[i].page) + sg[i].offset, + dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset, sg[i].length, dir); #endif 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, if (dev->bus == &pci_bus_type) return; #endif - dma_cache_sync(bus_to_virt(dma_handle), size, dir); + dma_cache_sync(dev, bus_to_virt(dma_handle), size, dir); } static inline void dma_sync_single_range(struct device *dev, @@ -106,7 +110,7 @@ static inline void dma_sync_single_range(struct device *dev, if (dev->bus == &pci_bus_type) return; #endif - dma_cache_sync(bus_to_virt(dma_handle) + offset, size, dir); + dma_cache_sync(dev, bus_to_virt(dma_handle) + offset, size, dir); } 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, for (i = 0; i < nelems; i++) { #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) - dma_cache_sync(page_address(sg[i].page) + sg[i].offset, + dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset, sg[i].length, dir); #endif sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset; -- cgit v1.2.3-18-g5258 From c18fe9a0467afaec7de05ec76cd994ae7c866760 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Mon, 14 May 2007 09:12:39 +0900 Subject: sh64: ppoll/pselect6() and restartable syscalls. This patch was hanging around for some time while we were waiting for the compiler situation to improve.. now that all is well again, finally merge it. Signed-off-by: Paul Mundt --- include/asm-sh64/thread_info.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/asm-sh64/thread_info.h b/include/asm-sh64/thread_info.h index 1f825cb163c..f6d5117c53a 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) #define TIF_SIGPENDING 2 /* signal pending */ #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ #define TIF_MEMDIE 4 +#define TIF_RESTORE_SIGMASK 5 /* Restore signal mask in do_signal */ +#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) +#define _TIF_SIGPENDING (1 << TIF_SIGPENDING) +#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) +#define _TIF_MEMDIE (1 << TIF_MEMDIE) +#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) #endif /* __KERNEL__ */ -- cgit v1.2.3-18-g5258 From 2f32834a32dfc289ea73839dbcb98d135742947b Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Mon, 14 May 2007 09:13:54 +0900 Subject: sh64: Fixup sh-sci build. sh-sci needs asm/sci.h, borrow this from sh so we can build again. Signed-off-by: Paul Mundt --- include/asm-sh64/sci.h | 1 + 1 file changed, 1 insertion(+) create mode 100644 include/asm-sh64/sci.h (limited to 'include') diff --git a/include/asm-sh64/sci.h b/include/asm-sh64/sci.h new file mode 100644 index 00000000000..793c568b782 --- /dev/null +++ b/include/asm-sh64/sci.h @@ -0,0 +1 @@ +#include -- cgit v1.2.3-18-g5258 From 6c645ac72582bacb85b90a1cf88e81a13045aba4 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Mon, 14 May 2007 09:55:35 +0900 Subject: sh64: generic quicklist support. Signed-off-by: Paul Mundt --- include/asm-sh64/pgalloc.h | 100 +++++++++++---------------------------------- 1 file changed, 23 insertions(+), 77 deletions(-) (limited to 'include') diff --git a/include/asm-sh64/pgalloc.h b/include/asm-sh64/pgalloc.h index cb803e56cb6..6eccab770a6 100644 --- a/include/asm-sh64/pgalloc.h +++ b/include/asm-sh64/pgalloc.h @@ -14,13 +14,9 @@ * */ -#include #include - -#define pgd_quicklist (current_cpu_data.pgd_quick) -#define pmd_quicklist (current_cpu_data.pmd_quick) -#define pte_quicklist (current_cpu_data.pte_quick) -#define pgtable_cache_size (current_cpu_data.pgtable_cache_sz) +#include +#include static inline void pgd_init(unsigned long page) { @@ -45,84 +41,37 @@ static inline pgd_t *get_pgd_slow(void) return ret; } -static inline pgd_t *get_pgd_fast(void) -{ - unsigned long *ret; - - if ((ret = pgd_quicklist) != NULL) { - pgd_quicklist = (unsigned long *)(*ret); - ret[0] = 0; - pgtable_cache_size--; - } else - ret = (unsigned long *)get_pgd_slow(); - - if (ret) { - memset(ret, 0, USER_PTRS_PER_PGD * sizeof(pgd_t)); - } - return (pgd_t *)ret; -} - -static inline void free_pgd_fast(pgd_t *pgd) -{ - *(unsigned long *)pgd = (unsigned long) pgd_quicklist; - pgd_quicklist = (unsigned long *) pgd; - pgtable_cache_size++; -} - -static inline void free_pgd_slow(pgd_t *pgd) +static inline pgd_t *pgd_alloc(struct mm_struct *mm) { - kfree((void *)pgd); + return quicklist_alloc(0, GFP_KERNEL, NULL); } -extern pte_t *get_pte_slow(pmd_t *pmd, unsigned long address_preadjusted); -extern pte_t *get_pte_kernel_slow(pmd_t *pmd, unsigned long address_preadjusted); - -static inline pte_t *get_pte_fast(void) +static inline void pgd_free(pgd_t *pgd) { - unsigned long *ret; - - if((ret = (unsigned long *)pte_quicklist) != NULL) { - pte_quicklist = (unsigned long *)(*ret); - ret[0] = ret[1]; - pgtable_cache_size--; - } - return (pte_t *)ret; + quicklist_free(0, NULL, pgd); } -static inline void free_pte_fast(pte_t *pte) +static inline struct page *pte_alloc_one(struct mm_struct *mm, + unsigned long address) { - *(unsigned long *)pte = (unsigned long) pte_quicklist; - pte_quicklist = (unsigned long *) pte; - pgtable_cache_size++; + void *pg = quicklist_alloc(0, GFP_KERNEL, NULL); + return pg ? virt_to_page(pg) : NULL; } static inline void pte_free_kernel(pte_t *pte) { - free_page((unsigned long)pte); + quicklist_free(0, NULL, pte); } static inline void pte_free(struct page *pte) { - __free_page(pte); + quicklist_free_page(0, NULL, pte); } static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) { - pte_t *pte; - - pte = (pte_t *)__get_free_page(GFP_KERNEL | __GFP_REPEAT|__GFP_ZERO); - - return pte; -} - -static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) -{ - struct page *pte; - - pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0); - - return pte; + return quicklist_alloc(0, GFP_KERNEL, NULL); } #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 #elif defined(CONFIG_SH64_PGTABLE_3_LEVEL) -static __inline__ pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) +static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) { - pmd_t *pmd; - pmd = (pmd_t *) __get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); - return pmd; + return quicklist_alloc(0, GFP_KERNEL, NULL); } -static __inline__ void pmd_free(pmd_t *pmd) +static inline void pmd_free(pmd_t *pmd) { - free_page((unsigned long) pmd); + quicklist_free(0, NULL, pmd); } -#define pgd_populate(mm, pgd, pmd) pgd_set(pgd, pmd) +#define pgd_populate(mm, pgd, pmd) pgd_set(pgd, pmd) #define __pmd_free_tlb(tlb,pmd) pmd_free(pmd) #else #error "No defined page table size" #endif -#define check_pgt_cache() do { } while (0) -#define pgd_free(pgd) free_pgd_slow(pgd) -#define pgd_alloc(mm) get_pgd_fast() - -extern int do_check_pgt_cache(int, int); - #define pmd_populate_kernel(mm, pmd, pte) \ set_pmd(pmd, __pmd(_PAGE_TABLE + (unsigned long) (pte))) @@ -176,4 +117,9 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, set_pmd(pmd, __pmd(_PAGE_TABLE + (unsigned long) page_address (pte))); } +static inline void check_pgt_cache(void) +{ + quicklist_trim(0, NULL, 25, 16); +} + #endif /* __ASM_SH64_PGALLOC_H */ -- cgit v1.2.3-18-g5258 From 4728d546d7137ad5350cc2e53d4748fd26f61a60 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Wed, 16 May 2007 00:51:46 +0200 Subject: ide: remove ide_dma_enable() * check ->speedproc return value in ide_tune_dma() * use ide_tune_dma() in cmd64x/cs5530/sc1200/siimage/sl82c105/scc_pata drivers * remove no longer needed ide_dma_enable() Signed-off-by: Bartlomiej Zolnierkiewicz --- include/linux/ide.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/linux/ide.h b/include/linux/ide.h index df4e6a51031..be789613007 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -1357,7 +1357,6 @@ static inline void ide_set_hwifdata (ide_hwif_t * hwif, void *data) /* ide-lib.c */ u8 ide_rate_filter(ide_drive_t *, u8); -extern int ide_dma_enable(ide_drive_t *drive); extern char *ide_xfer_verbose(u8 xfer_rate); extern void ide_toggle_bounce(ide_drive_t *drive, int on); extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); -- cgit v1.2.3-18-g5258 From 122ab0887c36247bd4508c25e4fccf9264546fe2 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Wed, 16 May 2007 00:51:46 +0200 Subject: ide: remove ide_use_dma() ide_use_dma() duplicates a lot of ide_max_dma_mode() functionality and as all users of ide_use_dma() were converted to use ide_tune_dma() now it is possible to add missing checks to ide_tune_dma() and remove ide_use_dma() completely, so do it. There should be no functionality changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz --- include/linux/ide.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/linux/ide.h b/include/linux/ide.h index be789613007..07aba87d369 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -1281,7 +1281,6 @@ struct drive_list_entry { int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *); int __ide_dma_bad_drive(ide_drive_t *); int __ide_dma_good_drive(ide_drive_t *); -int ide_use_dma(ide_drive_t *); u8 ide_max_dma_mode(ide_drive_t *); int ide_tune_dma(ide_drive_t *); void ide_dma_off(ide_drive_t *); @@ -1309,7 +1308,6 @@ extern int __ide_dma_timeout(ide_drive_t *); #endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ #else -static inline int ide_use_dma(ide_drive_t *drive) { return 0; } static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; } static inline int ide_tune_dma(ide_drive_t *drive) { return 0; } static inline void ide_dma_off(ide_drive_t *drive) { ; } -- cgit v1.2.3-18-g5258 From b4e1ded3cf6e13c122f019532cb60347d6c88c8c Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 15 May 2007 20:37:00 +0100 Subject: m32r: __xchg() should be always_inline it depends on elimination of unreachable branches in switch (by object size), so we must declare it always_inline Signed-off-by: Al Viro Acked-by: Hirokazu Takata Signed-off-by: Linus Torvalds --- include/asm-m32r/system.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-m32r/system.h b/include/asm-m32r/system.h index b291b2f7295..8ee73d3f316 100644 --- a/include/asm-m32r/system.h +++ b/include/asm-m32r/system.h @@ -10,6 +10,7 @@ * Copyright (C) 2004, 2006 Hirokazu Takata */ +#include #include #ifdef __KERNEL__ @@ -154,7 +155,7 @@ extern void __xchg_called_with_bad_pointer(void); #define DCACHE_CLEAR(reg0, reg1, addr) #endif /* CONFIG_CHIP_M32700_TS1 */ -static inline unsigned long +static __always_inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size) { unsigned long flags; -- cgit v1.2.3-18-g5258