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

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6: (27 commits)
parisc: use generic atomic64 on 32-bit
parisc: superio: fix build breakage
parisc: Fix PCI resource allocation on non-PAT SBA machines
parisc: perf: wire up sys_perf_counter_open
parisc: add task_pt_regs macro
parisc: wire sys_perf_counter_open to sys_ni_syscall
parisc: inventory.c, fix bloated stack frame
parisc: processor.c, fix bloated stack frame
parisc: fix compile warning in mm/init.c
parisc: remove dead code from sys_parisc32.c
parisc: wire up rt_tgsigqueueinfo
parisc: ensure broadcast tlb purge runs single threaded
parisc: fix "delay!" timer handling
parisc: fix mismatched parenthesis in memcpy.c
parisc: Fix gcc 4.4 warning in lba_pci.c
parisc: add parameter to read_cr16()
parisc: decode_exc.c should include kernel.h
parisc: remove obsolete hw_interrupt_type
parisc: fix irq compile bugs in arch/parisc/kernel/irq.c
parisc: advertise PCI devs after "assign_resources"
...

Manually fixed up trivial conflicts in tools/perf/perf.h due to addition
of SH vs HPPA perf-counter support.

+228 -219
+2
arch/parisc/Kconfig
··· 16 16 select RTC_DRV_GENERIC 17 17 select INIT_ALL_POSSIBLE 18 18 select BUG 19 + select HAVE_PERF_COUNTERS 20 + select GENERIC_ATOMIC64 if !64BIT 19 21 help 20 22 The PA-RISC microprocessor is designed by Hewlett-Packard and used 21 23 in many of their workstations & servers (HP9000 700 and 800 series,
+9 -5
arch/parisc/include/asm/atomic.h
··· 222 222 223 223 #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 224 224 225 - #define atomic_add(i,v) ((void)(__atomic_add_return( ((int)(i)),(v)))) 226 - #define atomic_sub(i,v) ((void)(__atomic_add_return(-((int)(i)),(v)))) 225 + #define atomic_add(i,v) ((void)(__atomic_add_return( (i),(v)))) 226 + #define atomic_sub(i,v) ((void)(__atomic_add_return(-(i),(v)))) 227 227 #define atomic_inc(v) ((void)(__atomic_add_return( 1,(v)))) 228 228 #define atomic_dec(v) ((void)(__atomic_add_return( -1,(v)))) 229 229 230 - #define atomic_add_return(i,v) (__atomic_add_return( ((int)(i)),(v))) 231 - #define atomic_sub_return(i,v) (__atomic_add_return(-((int)(i)),(v))) 230 + #define atomic_add_return(i,v) (__atomic_add_return( (i),(v))) 231 + #define atomic_sub_return(i,v) (__atomic_add_return(-(i),(v))) 232 232 #define atomic_inc_return(v) (__atomic_add_return( 1,(v))) 233 233 #define atomic_dec_return(v) (__atomic_add_return( -1,(v))) 234 234 ··· 336 336 337 337 #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) 338 338 339 - #endif /* CONFIG_64BIT */ 339 + #else /* CONFIG_64BIT */ 340 + 341 + #include <asm-generic/atomic64.h> 342 + 343 + #endif /* !CONFIG_64BIT */ 340 344 341 345 #include <asm-generic/atomic-long.h> 342 346
+1 -2
arch/parisc/include/asm/dma.h
··· 1 - /* $Id: dma.h,v 1.2 1999/04/27 00:46:18 deller Exp $ 2 - * linux/include/asm/dma.h: Defines for using and allocating dma channels. 1 + /* asm/dma.h: Defines for using and allocating dma channels. 3 2 * Written by Hennus Bergman, 1992. 4 3 * High DMA channel support & info by Hannu Savolainen 5 4 * and John Boyd, Nov. 1992.
+7
arch/parisc/include/asm/perf_counter.h
··· 1 + #ifndef __ASM_PARISC_PERF_COUNTER_H 2 + #define __ASM_PARISC_PERF_COUNTER_H 3 + 4 + /* parisc only supports software counters through this interface. */ 5 + static inline void set_perf_counter_pending(void) { } 6 + 7 + #endif /* __ASM_PARISC_PERF_COUNTER_H */
+3
arch/parisc/include/asm/processor.h
··· 18 18 #include <asm/types.h> 19 19 #include <asm/system.h> 20 20 #include <asm/percpu.h> 21 + 21 22 #endif /* __ASSEMBLY__ */ 22 23 23 24 #define KERNEL_STACK_SIZE (4*PAGE_SIZE) ··· 127 126 unsigned long map_base; 128 127 unsigned long flags; 129 128 }; 129 + 130 + #define task_pt_regs(tsk) ((struct pt_regs *)&((tsk)->thread.regs)) 130 131 131 132 /* Thread struct flags. */ 132 133 #define PARISC_UAC_NOPRINT (1UL << 0) /* see prctl and unaligned.c */
+2 -2
arch/parisc/include/asm/system.h
··· 168 168 /* LDCW, the only atomic read-write operation PA-RISC has. *sigh*. */ 169 169 #define __ldcw(a) ({ \ 170 170 unsigned __ret; \ 171 - __asm__ __volatile__(__LDCW " 0(%1),%0" \ 172 - : "=r" (__ret) : "r" (a)); \ 171 + __asm__ __volatile__(__LDCW " 0(%2),%0" \ 172 + : "=r" (__ret), "+m" (*(a)) : "r" (a)); \ 173 173 __ret; \ 174 174 }) 175 175
+7 -7
arch/parisc/include/asm/tlbflush.h
··· 12 12 * N class systems, only one PxTLB inter processor broadcast can be 13 13 * active at any one time on the Merced bus. This tlb purge 14 14 * synchronisation is fairly lightweight and harmless so we activate 15 - * it on all SMP systems not just the N class. We also need to have 16 - * preemption disabled on uniprocessor machines, and spin_lock does that 17 - * nicely. 15 + * it on all systems not just the N class. 18 16 */ 19 17 extern spinlock_t pa_tlb_lock; 20 18 21 - #define purge_tlb_start(x) spin_lock(&pa_tlb_lock) 22 - #define purge_tlb_end(x) spin_unlock(&pa_tlb_lock) 19 + #define purge_tlb_start(flags) spin_lock_irqsave(&pa_tlb_lock, flags) 20 + #define purge_tlb_end(flags) spin_unlock_irqrestore(&pa_tlb_lock, flags) 23 21 24 22 extern void flush_tlb_all(void); 25 23 extern void flush_tlb_all_local(void *); ··· 61 63 static inline void flush_tlb_page(struct vm_area_struct *vma, 62 64 unsigned long addr) 63 65 { 66 + unsigned long flags; 67 + 64 68 /* For one page, it's not worth testing the split_tlb variable */ 65 69 66 70 mb(); 67 71 mtsp(vma->vm_mm->context,1); 68 - purge_tlb_start(); 72 + purge_tlb_start(flags); 69 73 pdtlb(addr); 70 74 pitlb(addr); 71 - purge_tlb_end(); 75 + purge_tlb_end(flags); 72 76 } 73 77 74 78 void __flush_tlb_range(unsigned long sid,
+5 -1
arch/parisc/include/asm/unistd.h
··· 807 807 #define __NR_dup3 (__NR_Linux + 312) 808 808 #define __NR_pipe2 (__NR_Linux + 313) 809 809 #define __NR_inotify_init1 (__NR_Linux + 314) 810 + #define __NR_preadv (__NR_Linux + 315) 811 + #define __NR_pwritev (__NR_Linux + 316) 812 + #define __NR_rt_tgsigqueueinfo (__NR_Linux + 317) 813 + #define __NR_perf_counter_open (__NR_Linux + 318) 810 814 811 - #define __NR_Linux_syscalls (__NR_inotify_init1 + 1) 815 + #define __NR_Linux_syscalls (__NR_perf_counter_open + 1) 812 816 813 817 814 818 #define __IGNORE_select /* newselect */
+16 -10
arch/parisc/kernel/cache.c
··· 1 - /* $Id: cache.c,v 1.4 2000/01/25 00:11:38 prumpf Exp $ 2 - * 1 + /* 3 2 * This file is subject to the terms and conditions of the GNU General Public 4 3 * License. See the file "COPYING" in the main directory of this archive 5 4 * for more details. ··· 397 398 398 399 void clear_user_page_asm(void *page, unsigned long vaddr) 399 400 { 401 + unsigned long flags; 400 402 /* This function is implemented in assembly in pacache.S */ 401 403 extern void __clear_user_page_asm(void *page, unsigned long vaddr); 402 404 403 - purge_tlb_start(); 405 + purge_tlb_start(flags); 404 406 __clear_user_page_asm(page, vaddr); 405 - purge_tlb_end(); 407 + purge_tlb_end(flags); 406 408 } 407 409 408 410 #define FLUSH_THRESHOLD 0x80000 /* 0.5MB */ ··· 444 444 445 445 void clear_user_page(void *page, unsigned long vaddr, struct page *pg) 446 446 { 447 + unsigned long flags; 448 + 447 449 purge_kernel_dcache_page((unsigned long)page); 448 - purge_tlb_start(); 450 + purge_tlb_start(flags); 449 451 pdtlb_kernel(page); 450 - purge_tlb_end(); 452 + purge_tlb_end(flags); 451 453 clear_user_page_asm(page, vaddr); 452 454 } 453 455 EXPORT_SYMBOL(clear_user_page); 454 456 455 457 void flush_kernel_dcache_page_addr(void *addr) 456 458 { 459 + unsigned long flags; 460 + 457 461 flush_kernel_dcache_page_asm(addr); 458 - purge_tlb_start(); 462 + purge_tlb_start(flags); 459 463 pdtlb_kernel(addr); 460 - purge_tlb_end(); 464 + purge_tlb_end(flags); 461 465 } 462 466 EXPORT_SYMBOL(flush_kernel_dcache_page_addr); 463 467 ··· 494 490 if (npages >= 512) /* 2MB of space: arbitrary, should be tuned */ 495 491 flush_tlb_all(); 496 492 else { 493 + unsigned long flags; 494 + 497 495 mtsp(sid, 1); 498 - purge_tlb_start(); 496 + purge_tlb_start(flags); 499 497 if (split_tlb) { 500 498 while (npages--) { 501 499 pdtlb(start); ··· 510 504 start += PAGE_SIZE; 511 505 } 512 506 } 513 - purge_tlb_end(); 507 + purge_tlb_end(flags); 514 508 } 515 509 } 516 510
+24 -17
arch/parisc/kernel/inventory.c
··· 170 170 static int __init 171 171 pat_query_module(ulong pcell_loc, ulong mod_index) 172 172 { 173 - pdc_pat_cell_mod_maddr_block_t pa_pdc_cell; 173 + pdc_pat_cell_mod_maddr_block_t *pa_pdc_cell; 174 174 unsigned long bytecnt; 175 175 unsigned long temp; /* 64-bit scratch value */ 176 176 long status; /* PDC return value status */ 177 177 struct parisc_device *dev; 178 178 179 + pa_pdc_cell = kmalloc(sizeof (*pa_pdc_cell), GFP_KERNEL); 180 + if (!pa_pdc_cell) 181 + panic("couldn't allocate memory for PDC_PAT_CELL!"); 182 + 179 183 /* return cell module (PA or Processor view) */ 180 184 status = pdc_pat_cell_module(&bytecnt, pcell_loc, mod_index, 181 - PA_VIEW, &pa_pdc_cell); 185 + PA_VIEW, pa_pdc_cell); 182 186 183 187 if (status != PDC_OK) { 184 188 /* no more cell modules or error */ 185 189 return status; 186 190 } 187 191 188 - temp = pa_pdc_cell.cba; 189 - dev = alloc_pa_dev(PAT_GET_CBA(temp), &pa_pdc_cell.mod_path); 192 + temp = pa_pdc_cell->cba; 193 + dev = alloc_pa_dev(PAT_GET_CBA(temp), &(pa_pdc_cell->mod_path)); 190 194 if (!dev) { 191 195 return PDC_OK; 192 196 } ··· 207 203 208 204 /* save generic info returned from the call */ 209 205 /* REVISIT: who is the consumer of this? not sure yet... */ 210 - dev->mod_info = pa_pdc_cell.mod_info; /* pass to PAT_GET_ENTITY() */ 211 - dev->pmod_loc = pa_pdc_cell.mod_location; 206 + dev->mod_info = pa_pdc_cell->mod_info; /* pass to PAT_GET_ENTITY() */ 207 + dev->pmod_loc = pa_pdc_cell->mod_location; 212 208 213 209 register_parisc_device(dev); /* advertise device */ 214 210 ··· 220 216 221 217 case PAT_ENTITY_PROC: 222 218 printk(KERN_DEBUG "PAT_ENTITY_PROC: id_eid 0x%lx\n", 223 - pa_pdc_cell.mod[0]); 219 + pa_pdc_cell->mod[0]); 224 220 break; 225 221 226 222 case PAT_ENTITY_MEM: 227 223 printk(KERN_DEBUG 228 224 "PAT_ENTITY_MEM: amount 0x%lx min_gni_base 0x%lx min_gni_len 0x%lx\n", 229 - pa_pdc_cell.mod[0], pa_pdc_cell.mod[1], 230 - pa_pdc_cell.mod[2]); 225 + pa_pdc_cell->mod[0], pa_pdc_cell->mod[1], 226 + pa_pdc_cell->mod[2]); 231 227 break; 232 228 case PAT_ENTITY_CA: 233 229 printk(KERN_DEBUG "PAT_ENTITY_CA: %ld\n", pcell_loc); ··· 247 243 print_ranges: 248 244 pdc_pat_cell_module(&bytecnt, pcell_loc, mod_index, 249 245 IO_VIEW, &io_pdc_cell); 250 - printk(KERN_DEBUG "ranges %ld\n", pa_pdc_cell.mod[1]); 251 - for (i = 0; i < pa_pdc_cell.mod[1]; i++) { 246 + printk(KERN_DEBUG "ranges %ld\n", pa_pdc_cell->mod[1]); 247 + for (i = 0; i < pa_pdc_cell->mod[1]; i++) { 252 248 printk(KERN_DEBUG 253 249 " PA_VIEW %ld: 0x%016lx 0x%016lx 0x%016lx\n", 254 - i, pa_pdc_cell.mod[2 + i * 3], /* type */ 255 - pa_pdc_cell.mod[3 + i * 3], /* start */ 256 - pa_pdc_cell.mod[4 + i * 3]); /* finish (ie end) */ 250 + i, pa_pdc_cell->mod[2 + i * 3], /* type */ 251 + pa_pdc_cell->mod[3 + i * 3], /* start */ 252 + pa_pdc_cell->mod[4 + i * 3]); /* finish (ie end) */ 257 253 printk(KERN_DEBUG 258 254 " IO_VIEW %ld: 0x%016lx 0x%016lx 0x%016lx\n", 259 - i, io_pdc_cell.mod[2 + i * 3], /* type */ 260 - io_pdc_cell.mod[3 + i * 3], /* start */ 261 - io_pdc_cell.mod[4 + i * 3]); /* finish (ie end) */ 255 + i, io_pdc_cell->mod[2 + i * 3], /* type */ 256 + io_pdc_cell->mod[3 + i * 3], /* start */ 257 + io_pdc_cell->mod[4 + i * 3]); /* finish (ie end) */ 262 258 } 263 259 printk(KERN_DEBUG "\n"); 264 260 break; 265 261 } 266 262 #endif /* DEBUG_PAT */ 263 + 264 + kfree(pa_pdc_cell); 265 + 267 266 return PDC_OK; 268 267 } 269 268
+5 -5
arch/parisc/kernel/irq.c
··· 120 120 if (CHECK_IRQ_PER_CPU(irq)) { 121 121 /* Bad linux design decision. The mask has already 122 122 * been set; we must reset it */ 123 - cpumask_setall(&irq_desc[irq].affinity); 123 + cpumask_setall(irq_desc[irq].affinity); 124 124 return -EINVAL; 125 125 } 126 126 ··· 138 138 if (cpu_dest < 0) 139 139 return -1; 140 140 141 - cpumask_copy(&irq_desc[irq].affinity, dest); 141 + cpumask_copy(irq_desc[irq].affinity, dest); 142 142 143 143 return 0; 144 144 } 145 145 #endif 146 146 147 - static struct hw_interrupt_type cpu_interrupt_type = { 147 + static struct irq_chip cpu_interrupt_type = { 148 148 .typename = "CPU", 149 149 .startup = cpu_startup_irq, 150 150 .shutdown = cpu_disable_irq, ··· 299 299 unsigned long txn_affinity_addr(unsigned int irq, int cpu) 300 300 { 301 301 #ifdef CONFIG_SMP 302 - cpumask_copy(&irq_desc[irq].affinity, cpumask_of(cpu)); 302 + cpumask_copy(irq_desc[irq].affinity, cpumask_of(cpu)); 303 303 #endif 304 304 305 305 return per_cpu(cpu_data, cpu).txn_addr; ··· 356 356 irq = eirr_to_irq(eirr_val); 357 357 358 358 #ifdef CONFIG_SMP 359 - cpumask_copy(&dest, &irq_desc[irq].affinity); 359 + cpumask_copy(&dest, irq_desc[irq].affinity); 360 360 if (CHECK_IRQ_PER_CPU(irq_desc[irq].status) && 361 361 !cpu_isset(smp_processor_id(), dest)) { 362 362 int cpu = first_cpu(dest);
+8 -4
arch/parisc/kernel/pci-dma.c
··· 90 90 if (end > PMD_SIZE) 91 91 end = PMD_SIZE; 92 92 do { 93 + unsigned long flags; 94 + 93 95 if (!pte_none(*pte)) 94 96 printk(KERN_ERR "map_pte_uncached: page already exists\n"); 95 97 set_pte(pte, __mk_pte(*paddr_ptr, PAGE_KERNEL_UNC)); 96 - purge_tlb_start(); 98 + purge_tlb_start(flags); 97 99 pdtlb_kernel(orig_vaddr); 98 - purge_tlb_end(); 100 + purge_tlb_end(flags); 99 101 vaddr += PAGE_SIZE; 100 102 orig_vaddr += PAGE_SIZE; 101 103 (*paddr_ptr) += PAGE_SIZE; ··· 170 168 if (end > PMD_SIZE) 171 169 end = PMD_SIZE; 172 170 do { 171 + unsigned long flags; 173 172 pte_t page = *pte; 173 + 174 174 pte_clear(&init_mm, vaddr, pte); 175 - purge_tlb_start(); 175 + purge_tlb_start(flags); 176 176 pdtlb_kernel(orig_vaddr); 177 - purge_tlb_end(); 177 + purge_tlb_end(flags); 178 178 vaddr += PAGE_SIZE; 179 179 orig_vaddr += PAGE_SIZE; 180 180 pte++;
+1 -2
arch/parisc/kernel/pci.c
··· 1 - /* $Id: pci.c,v 1.6 2000/01/29 00:12:05 grundler Exp $ 2 - * 1 + /* 3 2 * This file is subject to the terms and conditions of the GNU General Public 4 3 * License. See the file "COPYING" in the main directory of this archive 5 4 * for more details.
+12 -7
arch/parisc/kernel/processor.c
··· 1 - /* $Id: processor.c,v 1.1 2002/07/20 16:27:06 rhirst Exp $ 2 - * 1 + /* 3 2 * Initial setup-routines for HP 9000 based hardware. 4 3 * 5 4 * Copyright (C) 1991, 1992, 1995 Linus Torvalds ··· 120 121 if (is_pdc_pat()) { 121 122 ulong status; 122 123 unsigned long bytecnt; 123 - pdc_pat_cell_mod_maddr_block_t pa_pdc_cell; 124 + pdc_pat_cell_mod_maddr_block_t *pa_pdc_cell; 124 125 #undef USE_PAT_CPUID 125 126 #ifdef USE_PAT_CPUID 126 127 struct pdc_pat_cpu_num cpu_info; 127 128 #endif 128 129 130 + pa_pdc_cell = kmalloc(sizeof (*pa_pdc_cell), GFP_KERNEL); 131 + if (!pa_pdc_cell) 132 + panic("couldn't allocate memory for PDC_PAT_CELL!"); 133 + 129 134 status = pdc_pat_cell_module(&bytecnt, dev->pcell_loc, 130 - dev->mod_index, PA_VIEW, &pa_pdc_cell); 135 + dev->mod_index, PA_VIEW, pa_pdc_cell); 131 136 132 137 BUG_ON(PDC_OK != status); 133 138 134 139 /* verify it's the same as what do_pat_inventory() found */ 135 - BUG_ON(dev->mod_info != pa_pdc_cell.mod_info); 136 - BUG_ON(dev->pmod_loc != pa_pdc_cell.mod_location); 140 + BUG_ON(dev->mod_info != pa_pdc_cell->mod_info); 141 + BUG_ON(dev->pmod_loc != pa_pdc_cell->mod_location); 137 142 138 - txn_addr = pa_pdc_cell.mod[0]; /* id_eid for IO sapic */ 143 + txn_addr = pa_pdc_cell->mod[0]; /* id_eid for IO sapic */ 144 + 145 + kfree(pa_pdc_cell); 139 146 140 147 #ifdef USE_PAT_CPUID 141 148 /* We need contiguous numbers for cpuid. Firmware's notion
+1 -2
arch/parisc/kernel/setup.c
··· 1 - /* $Id: setup.c,v 1.8 2000/02/02 04:42:38 prumpf Exp $ 2 - * 1 + /* 3 2 * Initial setup-routines for HP 9000 based hardware. 4 3 * 5 4 * Copyright (C) 1991, 1992, 1995 Linus Torvalds
-62
arch/parisc/kernel/sys_parisc32.c
··· 174 174 return ret; 175 175 } 176 176 177 - /*** copied from mips64 ***/ 178 - /* 179 - * Ooo, nasty. We need here to frob 32-bit unsigned longs to 180 - * 64-bit unsigned longs. 181 - */ 182 - 183 - static inline int 184 - get_fd_set32(unsigned long n, u32 *ufdset, unsigned long *fdset) 185 - { 186 - n = (n + 8*sizeof(u32) - 1) / (8*sizeof(u32)); 187 - if (ufdset) { 188 - unsigned long odd; 189 - 190 - if (!access_ok(VERIFY_WRITE, ufdset, n*sizeof(u32))) 191 - return -EFAULT; 192 - 193 - odd = n & 1UL; 194 - n &= ~1UL; 195 - while (n) { 196 - unsigned long h, l; 197 - __get_user(l, ufdset); 198 - __get_user(h, ufdset+1); 199 - ufdset += 2; 200 - *fdset++ = h << 32 | l; 201 - n -= 2; 202 - } 203 - if (odd) 204 - __get_user(*fdset, ufdset); 205 - } else { 206 - /* Tricky, must clear full unsigned long in the 207 - * kernel fdset at the end, this makes sure that 208 - * actually happens. 209 - */ 210 - memset(fdset, 0, ((n + 1) & ~1)*sizeof(u32)); 211 - } 212 - return 0; 213 - } 214 - 215 - static inline void 216 - set_fd_set32(unsigned long n, u32 *ufdset, unsigned long *fdset) 217 - { 218 - unsigned long odd; 219 - n = (n + 8*sizeof(u32) - 1) / (8*sizeof(u32)); 220 - 221 - if (!ufdset) 222 - return; 223 - 224 - odd = n & 1UL; 225 - n &= ~1UL; 226 - while (n) { 227 - unsigned long h, l; 228 - l = *fdset++; 229 - h = l >> 32; 230 - __put_user(l, ufdset); 231 - __put_user(h, ufdset+1); 232 - ufdset += 2; 233 - n -= 2; 234 - } 235 - if (odd) 236 - __put_user(*fdset, ufdset); 237 - } 238 - 239 177 struct msgbuf32 { 240 178 int mtype; 241 179 char mtext[1];
+4
arch/parisc/kernel/syscall_table.S
··· 413 413 ENTRY_SAME(dup3) 414 414 ENTRY_SAME(pipe2) 415 415 ENTRY_SAME(inotify_init1) 416 + ENTRY_COMP(preadv) /* 315 */ 417 + ENTRY_COMP(pwritev) 418 + ENTRY_COMP(rt_tgsigqueueinfo) 419 + ENTRY_SAME(perf_counter_open) 416 420 417 421 /* Nothing yet */ 418 422
+54 -36
arch/parisc/kernel/time.c
··· 56 56 */ 57 57 irqreturn_t __irq_entry timer_interrupt(int irq, void *dev_id) 58 58 { 59 - unsigned long now; 59 + unsigned long now, now2; 60 60 unsigned long next_tick; 61 - unsigned long cycles_elapsed, ticks_elapsed; 61 + unsigned long cycles_elapsed, ticks_elapsed = 1; 62 62 unsigned long cycles_remainder; 63 63 unsigned int cpu = smp_processor_id(); 64 64 struct cpuinfo_parisc *cpuinfo = &per_cpu(cpu_data, cpu); ··· 71 71 /* Initialize next_tick to the expected tick time. */ 72 72 next_tick = cpuinfo->it_value; 73 73 74 - /* Get current interval timer. 75 - * CR16 reads as 64 bits in CPU wide mode. 76 - * CR16 reads as 32 bits in CPU narrow mode. 77 - */ 74 + /* Get current cycle counter (Control Register 16). */ 78 75 now = mfctl(16); 79 76 80 77 cycles_elapsed = now - next_tick; 81 78 82 - if ((cycles_elapsed >> 5) < cpt) { 79 + if ((cycles_elapsed >> 6) < cpt) { 83 80 /* use "cheap" math (add/subtract) instead 84 81 * of the more expensive div/mul method 85 82 */ 86 83 cycles_remainder = cycles_elapsed; 87 - ticks_elapsed = 1; 88 84 while (cycles_remainder > cpt) { 89 85 cycles_remainder -= cpt; 90 86 ticks_elapsed++; 91 87 } 92 88 } else { 89 + /* TODO: Reduce this to one fdiv op */ 93 90 cycles_remainder = cycles_elapsed % cpt; 94 - ticks_elapsed = 1 + cycles_elapsed / cpt; 95 - } 96 - 97 - /* Can we differentiate between "early CR16" (aka Scenario 1) and 98 - * "long delay" (aka Scenario 3)? I don't think so. 99 - * 100 - * We expected timer_interrupt to be delivered at least a few hundred 101 - * cycles after the IT fires. But it's arbitrary how much time passes 102 - * before we call it "late". I've picked one second. 103 - */ 104 - if (unlikely(ticks_elapsed > HZ)) { 105 - /* Scenario 3: very long delay? bad in any case */ 106 - printk (KERN_CRIT "timer_interrupt(CPU %d): delayed!" 107 - " cycles %lX rem %lX " 108 - " next/now %lX/%lX\n", 109 - cpu, 110 - cycles_elapsed, cycles_remainder, 111 - next_tick, now ); 91 + ticks_elapsed += cycles_elapsed / cpt; 112 92 } 113 93 114 94 /* convert from "division remainder" to "remainder of clock tick" */ ··· 102 122 103 123 cpuinfo->it_value = next_tick; 104 124 105 - /* Skip one clocktick on purpose if we are likely to miss next_tick. 106 - * We want to avoid the new next_tick being less than CR16. 107 - * If that happened, itimer wouldn't fire until CR16 wrapped. 108 - * We'll catch the tick we missed on the tick after that. 125 + /* Program the IT when to deliver the next interrupt. 126 + * Only bottom 32-bits of next_tick are writable in CR16! 109 127 */ 110 - if (!(cycles_remainder >> 13)) 111 - next_tick += cpt; 112 - 113 - /* Program the IT when to deliver the next interrupt. */ 114 - /* Only bottom 32-bits of next_tick are written to cr16. */ 115 128 mtctl(next_tick, 16); 116 129 130 + /* Skip one clocktick on purpose if we missed next_tick. 131 + * The new CR16 must be "later" than current CR16 otherwise 132 + * itimer would not fire until CR16 wrapped - e.g 4 seconds 133 + * later on a 1Ghz processor. We'll account for the missed 134 + * tick on the next timer interrupt. 135 + * 136 + * "next_tick - now" will always give the difference regardless 137 + * if one or the other wrapped. If "now" is "bigger" we'll end up 138 + * with a very large unsigned number. 139 + */ 140 + now2 = mfctl(16); 141 + if (next_tick - now2 > cpt) 142 + mtctl(next_tick+cpt, 16); 143 + 144 + #if 1 145 + /* 146 + * GGG: DEBUG code for how many cycles programming CR16 used. 147 + */ 148 + if (unlikely(now2 - now > 0x3000)) /* 12K cycles */ 149 + printk (KERN_CRIT "timer_interrupt(CPU %d): SLOW! 0x%lx cycles!" 150 + " cyc %lX rem %lX " 151 + " next/now %lX/%lX\n", 152 + cpu, now2 - now, cycles_elapsed, cycles_remainder, 153 + next_tick, now ); 154 + #endif 155 + 156 + /* Can we differentiate between "early CR16" (aka Scenario 1) and 157 + * "long delay" (aka Scenario 3)? I don't think so. 158 + * 159 + * Timer_interrupt will be delivered at least a few hundred cycles 160 + * after the IT fires. But it's arbitrary how much time passes 161 + * before we call it "late". I've picked one second. 162 + * 163 + * It's important NO printk's are between reading CR16 and 164 + * setting up the next value. May introduce huge variance. 165 + */ 166 + if (unlikely(ticks_elapsed > HZ)) { 167 + /* Scenario 3: very long delay? bad in any case */ 168 + printk (KERN_CRIT "timer_interrupt(CPU %d): delayed!" 169 + " cycles %lX rem %lX " 170 + " next/now %lX/%lX\n", 171 + cpu, 172 + cycles_elapsed, cycles_remainder, 173 + next_tick, now ); 174 + } 117 175 118 176 /* Done mucking with unreliable delivery of interrupts. 119 177 * Go do system house keeping. ··· 191 173 192 174 /* clock source code */ 193 175 194 - static cycle_t read_cr16(void) 176 + static cycle_t read_cr16(struct clocksource *cs) 195 177 { 196 178 return get_cycles(); 197 179 }
-2
arch/parisc/lib/checksum.c
··· 13 13 * modify it under the terms of the GNU General Public License 14 14 * as published by the Free Software Foundation; either version 15 15 * 2 of the License, or (at your option) any later version. 16 - * 17 - * $Id: checksum.c,v 1.3 1997/12/01 17:57:34 ralf Exp $ 18 16 */ 19 17 #include <linux/module.h> 20 18 #include <linux/types.h>
+1 -1
arch/parisc/lib/memcpy.c
··· 405 405 406 406 unaligned_copy: 407 407 /* possibly we are aligned on a word, but not on a double... */ 408 - if (likely(t1 & (sizeof(unsigned int)-1)) == 0) { 408 + if (likely((t1 & (sizeof(unsigned int)-1)) == 0)) { 409 409 t2 = src & (sizeof(unsigned int) - 1); 410 410 411 411 if (unlikely(t2 != 0)) {
+1 -1
arch/parisc/math-emu/decode_exc.c
··· 40 40 * END_DESC 41 41 */ 42 42 43 - 43 + #include <linux/kernel.h> 44 44 #include "float.h" 45 45 #include "sgl_float.h" 46 46 #include "dbl_float.h"
+1 -2
arch/parisc/mm/fault.c
··· 1 - /* $Id: fault.c,v 1.5 2000/01/26 16:20:29 jsm Exp $ 2 - * 1 + /* 3 2 * This file is subject to the terms and conditions of the GNU General Public 4 3 * License. See the file "COPYING" in the main directory of this archive 5 4 * for more details.
+9 -20
arch/parisc/mm/init.c
··· 370 370 371 371 void free_initmem(void) 372 372 { 373 - unsigned long addr, init_begin, init_end; 374 - 375 - printk(KERN_INFO "Freeing unused kernel memory: "); 373 + unsigned long addr; 374 + unsigned long init_begin = (unsigned long)__init_begin; 375 + unsigned long init_end = (unsigned long)__init_end; 376 376 377 377 #ifdef CONFIG_DEBUG_KERNEL 378 378 /* Attempt to catch anyone trying to execute code here 379 379 * by filling the page with BRK insns. 380 - * 381 - * If we disable interrupts for all CPUs, then IPI stops working. 382 - * Kinda breaks the global cache flushing. 383 380 */ 384 - local_irq_disable(); 385 - 386 - memset(__init_begin, 0x00, 387 - (unsigned long)__init_end - (unsigned long)__init_begin); 388 - 389 - flush_data_cache(); 390 - asm volatile("sync" : : ); 391 - flush_icache_range((unsigned long)__init_begin, (unsigned long)__init_end); 392 - asm volatile("sync" : : ); 393 - 394 - local_irq_enable(); 381 + memset((void *)init_begin, 0x00, init_end - init_begin); 382 + flush_icache_range(init_begin, init_end); 395 383 #endif 396 384 397 385 /* align __init_begin and __init_end to page size, 398 386 ignoring linker script where we might have tried to save RAM */ 399 - init_begin = PAGE_ALIGN((unsigned long)(__init_begin)); 400 - init_end = PAGE_ALIGN((unsigned long)(__init_end)); 387 + init_begin = PAGE_ALIGN(init_begin); 388 + init_end = PAGE_ALIGN(init_end); 401 389 for (addr = init_begin; addr < init_end; addr += PAGE_SIZE) { 402 390 ClearPageReserved(virt_to_page(addr)); 403 391 init_page_count(virt_to_page(addr)); ··· 397 409 /* set up a new led state on systems shipped LED State panel */ 398 410 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BCOMPLETE); 399 411 400 - printk("%luk freed\n", (init_end - init_begin) >> 10); 412 + printk(KERN_INFO "Freeing unused kernel memory: %luk freed\n", 413 + (init_end - init_begin) >> 10); 401 414 } 402 415 403 416
+4 -3
drivers/parisc/ccio-dma.c
··· 1134 1134 .llseek = seq_lseek, 1135 1135 .release = single_release, 1136 1136 }; 1137 - #endif 1137 + #endif /* CONFIG_PROC_FS */ 1138 1138 1139 1139 /** 1140 1140 * ccio_find_ioc - Find the ioc in the ioc_list ··· 1568 1568 /* if this fails, no I/O cards will work, so may as well bug */ 1569 1569 BUG_ON(dev->dev.platform_data == NULL); 1570 1570 HBA_DATA(dev->dev.platform_data)->iommu = ioc; 1571 - 1571 + 1572 + #ifdef CONFIG_PROC_FS 1572 1573 if (ioc_count == 0) { 1573 1574 proc_create(MODULE_NAME, 0, proc_runway_root, 1574 1575 &ccio_proc_info_fops); 1575 1576 proc_create(MODULE_NAME"-bitmap", 0, proc_runway_root, 1576 1577 &ccio_proc_bitmap_fops); 1577 1578 } 1578 - 1579 + #endif 1579 1580 ioc_count++; 1580 1581 1581 1582 parisc_has_iommu();
+6 -6
drivers/parisc/dino.c
··· 353 353 return 0; 354 354 } 355 355 356 - static struct hw_interrupt_type dino_interrupt_type = { 356 + static struct irq_chip dino_interrupt_type = { 357 357 .typename = "GSC-PCI", 358 358 .startup = dino_startup_irq, 359 359 .shutdown = dino_disable_irq, ··· 1019 1019 ** It's not used to avoid chicken/egg problems 1020 1020 ** with configuration accessor functions. 1021 1021 */ 1022 - bus = pci_scan_bus_parented(&dev->dev, dino_current_bus, 1023 - &dino_cfg_ops, NULL); 1022 + dino_dev->hba.hba_bus = bus = pci_scan_bus_parented(&dev->dev, 1023 + dino_current_bus, &dino_cfg_ops, NULL); 1024 + 1024 1025 if(bus) { 1025 - pci_bus_add_devices(bus); 1026 1026 /* This code *depends* on scanning being single threaded 1027 1027 * if it isn't, this global bus number count will fail 1028 1028 */ 1029 1029 dino_current_bus = bus->subordinate + 1; 1030 1030 pci_bus_assign_resources(bus); 1031 + pci_bus_add_devices(bus); 1031 1032 } else { 1032 - printk(KERN_ERR "ERROR: failed to scan PCI bus on %s (probably duplicate bus number %d)\n", 1033 + printk(KERN_ERR "ERROR: failed to scan PCI bus on %s (duplicate bus number %d?)\n", 1033 1034 dev_name(&dev->dev), dino_current_bus); 1034 1035 /* increment the bus number in case of duplicates */ 1035 1036 dino_current_bus++; 1036 1037 } 1037 - dino_dev->hba.hba_bus = bus; 1038 1038 return 0; 1039 1039 } 1040 1040
+1 -1
drivers/parisc/eisa.c
··· 188 188 return 0; 189 189 } 190 190 191 - static struct hw_interrupt_type eisa_interrupt_type = { 191 + static struct irq_chip eisa_interrupt_type = { 192 192 .typename = "EISA", 193 193 .startup = eisa_startup_irq, 194 194 .shutdown = eisa_disable_irq,
+2 -2
drivers/parisc/gsc.c
··· 148 148 return 0; 149 149 } 150 150 151 - static struct hw_interrupt_type gsc_asic_interrupt_type = { 151 + static struct irq_chip gsc_asic_interrupt_type = { 152 152 .typename = "GSC-ASIC", 153 153 .startup = gsc_asic_startup_irq, 154 154 .shutdown = gsc_asic_disable_irq, ··· 158 158 .end = no_end_irq, 159 159 }; 160 160 161 - int gsc_assign_irq(struct hw_interrupt_type *type, void *data) 161 + int gsc_assign_irq(struct irq_chip *type, void *data) 162 162 { 163 163 static int irq = GSC_IRQ_BASE; 164 164 struct irq_desc *desc;
+1 -1
drivers/parisc/gsc.h
··· 38 38 int gsc_common_setup(struct parisc_device *parent, struct gsc_asic *gsc_asic); 39 39 int gsc_alloc_irq(struct gsc_irq *dev); /* dev needs an irq */ 40 40 int gsc_claim_irq(struct gsc_irq *dev, int irq); /* dev needs this irq */ 41 - int gsc_assign_irq(struct hw_interrupt_type *type, void *data); 41 + int gsc_assign_irq(struct irq_chip *type, void *data); 42 42 int gsc_find_local_irq(unsigned int irq, int *global_irq, int limit); 43 43 void gsc_fixup_irqs(struct parisc_device *parent, void *ctrl, 44 44 void (*choose)(struct parisc_device *child, void *ctrl));
+1 -1
drivers/parisc/iosapic.c
··· 729 729 } 730 730 #endif 731 731 732 - static struct hw_interrupt_type iosapic_interrupt_type = { 732 + static struct irq_chip iosapic_interrupt_type = { 733 733 .typename = "IO-SAPIC-level", 734 734 .startup = iosapic_startup_irq, 735 735 .shutdown = iosapic_disable_irq,
+27 -14
drivers/parisc/lba_pci.c
··· 980 980 lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev) 981 981 { 982 982 unsigned long bytecnt; 983 - pdc_pat_cell_mod_maddr_block_t pa_pdc_cell; /* PA_VIEW */ 984 - pdc_pat_cell_mod_maddr_block_t io_pdc_cell; /* IO_VIEW */ 985 983 long io_count; 986 984 long status; /* PDC return status */ 987 985 long pa_count; 986 + pdc_pat_cell_mod_maddr_block_t *pa_pdc_cell; /* PA_VIEW */ 987 + pdc_pat_cell_mod_maddr_block_t *io_pdc_cell; /* IO_VIEW */ 988 988 int i; 989 + 990 + pa_pdc_cell = kzalloc(sizeof(pdc_pat_cell_mod_maddr_block_t), GFP_KERNEL); 991 + if (!pa_pdc_cell) 992 + return; 993 + 994 + io_pdc_cell = kzalloc(sizeof(pdc_pat_cell_mod_maddr_block_t), GFP_KERNEL); 995 + if (!pa_pdc_cell) { 996 + kfree(pa_pdc_cell); 997 + return; 998 + } 989 999 990 1000 /* return cell module (IO view) */ 991 1001 status = pdc_pat_cell_module(&bytecnt, pa_dev->pcell_loc, pa_dev->mod_index, 992 - PA_VIEW, & pa_pdc_cell); 993 - pa_count = pa_pdc_cell.mod[1]; 1002 + PA_VIEW, pa_pdc_cell); 1003 + pa_count = pa_pdc_cell->mod[1]; 994 1004 995 1005 status |= pdc_pat_cell_module(&bytecnt, pa_dev->pcell_loc, pa_dev->mod_index, 996 - IO_VIEW, &io_pdc_cell); 997 - io_count = io_pdc_cell.mod[1]; 1006 + IO_VIEW, io_pdc_cell); 1007 + io_count = io_pdc_cell->mod[1]; 998 1008 999 1009 /* We've already done this once for device discovery...*/ 1000 1010 if (status != PDC_OK) { 1001 1011 panic("pdc_pat_cell_module() call failed for LBA!\n"); 1002 1012 } 1003 1013 1004 - if (PAT_GET_ENTITY(pa_pdc_cell.mod_info) != PAT_ENTITY_LBA) { 1014 + if (PAT_GET_ENTITY(pa_pdc_cell->mod_info) != PAT_ENTITY_LBA) { 1005 1015 panic("pdc_pat_cell_module() entity returned != PAT_ENTITY_LBA!\n"); 1006 1016 } 1007 1017 ··· 1026 1016 } *p, *io; 1027 1017 struct resource *r; 1028 1018 1029 - p = (void *) &(pa_pdc_cell.mod[2+i*3]); 1030 - io = (void *) &(io_pdc_cell.mod[2+i*3]); 1019 + p = (void *) &(pa_pdc_cell->mod[2+i*3]); 1020 + io = (void *) &(io_pdc_cell->mod[2+i*3]); 1031 1021 1032 1022 /* Convert the PAT range data to PCI "struct resource" */ 1033 1023 switch(p->type & 0xff) { ··· 1106 1096 break; 1107 1097 } 1108 1098 } 1099 + 1100 + kfree(pa_pdc_cell); 1101 + kfree(io_pdc_cell); 1109 1102 } 1110 1103 #else 1111 1104 /* keep compiler from complaining about missing declarations */ ··· 1522 1509 lba_bus = lba_dev->hba.hba_bus = 1523 1510 pci_scan_bus_parented(&dev->dev, lba_dev->hba.bus_num.start, 1524 1511 cfg_ops, NULL); 1525 - if (lba_bus) { 1526 - lba_next_bus = lba_bus->subordinate + 1; 1527 - pci_bus_add_devices(lba_bus); 1528 - } 1529 1512 1530 1513 /* This is in lieu of calling pci_assign_unassigned_resources() */ 1531 1514 if (is_pdc_pat()) { ··· 1542 1533 } 1543 1534 pci_enable_bridges(lba_bus); 1544 1535 1545 - 1546 1536 /* 1547 1537 ** Once PCI register ops has walked the bus, access to config 1548 1538 ** space is restricted. Avoids master aborts on config cycles. ··· 1549 1541 */ 1550 1542 if (cfg_ops == &elroy_cfg_ops) { 1551 1543 lba_dev->flags |= LBA_FLAG_SKIP_PROBE; 1544 + } 1545 + 1546 + if (lba_bus) { 1547 + lba_next_bus = lba_bus->subordinate + 1; 1548 + pci_bus_add_devices(lba_bus); 1552 1549 } 1553 1550 1554 1551 /* Whew! Finally done! Tell services we got this one covered. */
+2
drivers/parisc/sba_iommu.c
··· 2057 2057 r->start = (base & ~1UL) | PCI_F_EXTEND; 2058 2058 size = ~ READ_REG32(reg + LMMIO_DIRECT0_MASK); 2059 2059 r->end = r->start + size; 2060 + r->flags = IORESOURCE_MEM; 2060 2061 } 2061 2062 } 2062 2063 ··· 2094 2093 size = (~READ_REG32(sba->sba_hpa + LMMIO_DIST_MASK)) / ROPES_PER_IOC; 2095 2094 r->start += rope * (size + 1); /* adjust base for this rope */ 2096 2095 r->end = r->start + size; 2096 + r->flags = IORESOURCE_MEM; 2097 2097 }
+3 -3
drivers/parisc/superio.c
··· 325 325 return 0; 326 326 } 327 327 328 - static struct hw_interrupt_type superio_interrupt_type = { 328 + static struct irq_chip superio_interrupt_type = { 329 329 .typename = SUPERIO, 330 330 .startup = superio_startup_irq, 331 331 .shutdown = superio_disable_irq, ··· 434 434 0 /*base_hi*/, 435 435 PAR_IRQ, 436 436 PARPORT_DMA_NONE /* dma */, 437 - NULL /*struct pci_dev* */), 438 - 0 /* shared irq flags */ ) 437 + NULL /*struct pci_dev* */, 438 + 0 /* shared irq flags */)) 439 439 440 440 printk(KERN_WARNING PFX "Probing parallel port failed.\n"); 441 441 #endif /* CONFIG_PARPORT_PC */
+2
drivers/video/Kconfig
··· 616 616 select FB_CFB_FILLRECT 617 617 select FB_CFB_COPYAREA 618 618 select FB_CFB_IMAGEBLIT 619 + select STI_CONSOLE 620 + select VT 619 621 default y 620 622 ---help--- 621 623 STI refers to the HP "Standard Text Interface" which is a set of
+6
tools/perf/perf.h
··· 29 29 #define cpu_relax() asm volatile("" ::: "memory") 30 30 #endif 31 31 32 + #ifdef __hppa__ 33 + #include "../../arch/parisc/include/asm/unistd.h" 34 + #define rmb() asm volatile("" ::: "memory") 35 + #define cpu_relax() asm volatile("" ::: "memory"); 36 + #endif 37 + 32 38 #include <time.h> 33 39 #include <unistd.h> 34 40 #include <sys/types.h>