Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] xtensa: remove io_remap_page_range and minor clean-ups

Remove io_remap_page_range() from all of Linux 2.6.x (as requested and
suggested by Randy Dunlap) and minor clean-ups.

Signed-off-by: Chris Zankel <chris@zankel.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Chris Zankel and committed by
Linus Torvalds
288a60cf fac97ae0

+22 -64
+2 -2
arch/xtensa/kernel/pci.c
··· 402 402 __pci_mmap_set_flags(dev, vma, mmap_state); 403 403 __pci_mmap_set_pgprot(dev, vma, mmap_state, write_combine); 404 404 405 - ret = io_remap_page_range(vma, vma->vm_start, vma->vm_pgoff<<PAGE_SHIFT, 406 - vma->vm_end - vma->vm_start, vma->vm_page_prot); 405 + ret = io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, 406 + vma->vm_end - vma->vm_start,vma->vm_page_prot); 407 407 408 408 return ret; 409 409 }
+1 -1
arch/xtensa/kernel/platform.c
··· 39 39 _F(int, get_rtc_time, (time_t* t), { return 0; }); 40 40 _F(int, set_rtc_time, (time_t t), { return 0; }); 41 41 42 - #if CONFIG_XTENSA_CALIBRATE_CCOUNT 42 + #ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT 43 43 _F(void, calibrate_ccount, (void), 44 44 { 45 45 printk ("ERROR: Cannot calibrate cpu frequency! Assuming 100MHz.\n");
+1 -1
arch/xtensa/kernel/process.c
··· 457 457 dump_task_fpu(struct pt_regs *regs, struct task_struct *task, elf_fpregset_t *r) 458 458 { 459 459 /* see asm/coprocessor.h for this magic number 16 */ 460 - #if TOTAL_CPEXTRA_SIZE > 16 460 + #if XTENSA_CP_EXTRA_SIZE > 16 461 461 do_save_fpregs (r, regs, task); 462 462 463 463 /* For now, bit 16 means some extra state may be present: */
+1 -1
arch/xtensa/kernel/setup.c
··· 304 304 # endif 305 305 #endif 306 306 307 - #if CONFIG_PCI 307 + #ifdef CONFIG_PCI 308 308 platform_pcibios_init(); 309 309 #endif 310 310 }
+1 -1
arch/xtensa/kernel/signal.c
··· 182 182 183 183 struct task_struct *tsk = current; 184 184 release_all_cp(tsk); 185 - return __copy_from_user(tsk->thread.cpextra, buf, TOTAL_CPEXTRA_SIZE); 185 + return __copy_from_user(tsk->thread.cpextra, buf, XTENSA_CP_EXTRA_SIZE); 186 186 #endif 187 187 return 0; 188 188 }
+1 -1
arch/xtensa/kernel/time.c
··· 68 68 * speed for the CALIBRATE. 69 69 */ 70 70 71 - #if CONFIG_XTENSA_CALIBRATE_CCOUNT 71 + #ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT 72 72 printk("Calibrating CPU frequency "); 73 73 platform_calibrate_ccount(); 74 74 printk("%d.%02d MHz\n", (int)ccount_per_jiffy/(1000000/HZ),
+1 -1
arch/xtensa/mm/init.c
··· 239 239 high_memory = (void *) __va(max_mapnr << PAGE_SHIFT); 240 240 highmemsize = 0; 241 241 242 - #if CONFIG_HIGHMEM 242 + #ifdef CONFIG_HIGHMEM 243 243 #error HIGHGMEM not implemented in init.c 244 244 #endif 245 245
+1 -1
include/asm-xtensa/atomic.h
··· 22 22 #include <asm/processor.h> 23 23 #include <asm/system.h> 24 24 25 - #define ATOMIC_INIT(i) ( (atomic_t) { (i) } ) 25 + #define ATOMIC_INIT(i) { (i) } 26 26 27 27 /* 28 28 * This Xtensa implementation assumes that the right mechanism
+1 -1
include/asm-xtensa/bitops.h
··· 174 174 return 1UL & (((const volatile unsigned int *)addr)[nr>>5] >> (nr&31)); 175 175 } 176 176 177 - #if XCHAL_HAVE_NSAU 177 + #if XCHAL_HAVE_NSA 178 178 179 179 static __inline__ int __cntlz (unsigned long x) 180 180 {
+1
include/asm-xtensa/hardirq.h
··· 23 23 unsigned int __nmi_count; /* arch dependent */ 24 24 } ____cacheline_aligned irq_cpustat_t; 25 25 26 + void ack_bad_irq(unsigned int irq); 26 27 #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ 27 28 28 29 #endif /* _XTENSA_HARDIRQ_H */
+11 -38
include/asm-xtensa/semaphore.h
··· 20 20 atomic_t count; 21 21 int sleepers; 22 22 wait_queue_head_t wait; 23 - #if WAITQUEUE_DEBUG 24 - long __magic; 25 - #endif 26 23 }; 27 24 28 - #if WAITQUEUE_DEBUG 29 - # define __SEM_DEBUG_INIT(name) \ 30 - , (int)&(name).__magic 31 - #else 32 - # define __SEM_DEBUG_INIT(name) 33 - #endif 25 + #define __SEMAPHORE_INITIALIZER(name,n) \ 26 + { \ 27 + .count = ATOMIC_INIT(n), \ 28 + .sleepers = 0, \ 29 + .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ 30 + } 34 31 35 - #define __SEMAPHORE_INITIALIZER(name,count) \ 36 - { ATOMIC_INIT(count), \ 37 - 0, \ 38 - __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ 39 - __SEM_DEBUG_INIT(name) } 40 - 41 - #define __MUTEX_INITIALIZER(name) \ 32 + #define __MUTEX_INITIALIZER(name) \ 42 33 __SEMAPHORE_INITIALIZER(name, 1) 43 34 44 - #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ 35 + #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ 45 36 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) 46 37 47 38 #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) ··· 40 49 41 50 static inline void sema_init (struct semaphore *sem, int val) 42 51 { 43 - /* 44 - * *sem = (struct semaphore)__SEMAPHORE_INITIALIZER((*sem),val); 45 - * 46 - * i'd rather use the more flexible initialization above, but sadly 47 - * GCC 2.7.2.3 emits a bogus warning. EGCS doesnt. Oh well. 48 - */ 49 52 atomic_set(&sem->count, val); 50 53 init_waitqueue_head(&sem->wait); 51 - #if WAITQUEUE_DEBUG 52 - sem->__magic = (int)&sem->__magic; 53 - #endif 54 54 } 55 55 56 56 static inline void init_MUTEX (struct semaphore *sem) ··· 63 81 64 82 static inline void down(struct semaphore * sem) 65 83 { 66 - #if WAITQUEUE_DEBUG 67 - CHECK_MAGIC(sem->__magic); 68 - #endif 84 + might_sleep(); 69 85 70 86 if (atomic_sub_return(1, &sem->count) < 0) 71 87 __down(sem); ··· 72 92 static inline int down_interruptible(struct semaphore * sem) 73 93 { 74 94 int ret = 0; 75 - #if WAITQUEUE_DEBUG 76 - CHECK_MAGIC(sem->__magic); 77 - #endif 95 + 96 + might_sleep(); 78 97 79 98 if (atomic_sub_return(1, &sem->count) < 0) 80 99 ret = __down_interruptible(sem); ··· 83 104 static inline int down_trylock(struct semaphore * sem) 84 105 { 85 106 int ret = 0; 86 - #if WAITQUEUE_DEBUG 87 - CHECK_MAGIC(sem->__magic); 88 - #endif 89 107 90 108 if (atomic_sub_return(1, &sem->count) < 0) 91 109 ret = __down_trylock(sem); ··· 95 119 */ 96 120 static inline void up(struct semaphore * sem) 97 121 { 98 - #if WAITQUEUE_DEBUG 99 - CHECK_MAGIC(sem->__magic); 100 - #endif 101 122 if (atomic_add_return(1, &sem->count) <= 0) 102 123 __up(sem); 103 124 }
-16
include/asm-xtensa/system.h
··· 189 189 190 190 #define tas(ptr) (xchg((ptr),1)) 191 191 192 - #if ( __XCC__ == 1 ) 193 - 194 - /* xt-xcc processes __inline__ differently than xt-gcc and decides to 195 - * insert an out-of-line copy of function __xchg. This presents the 196 - * unresolved symbol at link time of __xchg_called_with_bad_pointer, 197 - * even though such a function would never be called at run-time. 198 - * xt-gcc always inlines __xchg, and optimizes away the undefined 199 - * bad_pointer function. 200 - */ 201 - 202 - #define xchg(ptr,x) xchg_u32(ptr,x) 203 - 204 - #else /* assume xt-gcc */ 205 - 206 192 #define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) 207 193 208 194 /* ··· 209 223 __xchg_called_with_bad_pointer(); 210 224 return x; 211 225 } 212 - 213 - #endif 214 226 215 227 extern void set_except_vector(int n, void *addr); 216 228