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

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

* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6:
agp: parisc-agp.c - use correct page_mask function
parisc: Fix linker script breakage.
parisc: convert to asm-generic/hardirq.h
parisc: Make THREAD_SIZE available to assembly files and linker scripts.
parisc: correct use of SHF_ALLOC
parisc: rename parisc's vmalloc_start to parisc_vmalloc_start
parisc: add me to Maintainers
parisc: includecheck fix: signal.c
parisc: HAVE_ARCH_TRACEHOOK
parisc: add skeleton syscall.h
parisc: stop using task->ptrace for {single,block}step flags
parisc: split syscall_trace into two halves
parisc: add missing TI_TASK macro in syscall.S
parisc: tracehook_signal_handler
parisc: tracehook_report_syscall

+129 -82
+1
MAINTAINERS
··· 3973 3973 PARISC ARCHITECTURE 3974 3974 M: Kyle McMartin <kyle@mcmartin.ca> 3975 3975 M: Helge Deller <deller@gmx.de> 3976 + M: "James E.J. Bottomley" <jejb@parisc-linux.org> 3976 3977 L: linux-parisc@vger.kernel.org 3977 3978 W: http://www.parisc-linux.org/ 3978 3979 T: git git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6.git
+1
arch/parisc/Kconfig
··· 18 18 select BUG 19 19 select HAVE_PERF_EVENTS 20 20 select GENERIC_ATOMIC64 if !64BIT 21 + select HAVE_ARCH_TRACEHOOK 21 22 help 22 23 The PA-RISC microprocessor is designed by Hewlett-Packard and used 23 24 in many of their workstations & servers (HP9000 700 and 800 series,
+2 -2
arch/parisc/include/asm/fixmap.h
··· 21 21 #define KERNEL_MAP_END (TMPALIAS_MAP_START) 22 22 23 23 #ifndef __ASSEMBLY__ 24 - extern void *vmalloc_start; 24 + extern void *parisc_vmalloc_start; 25 25 #define PCXL_DMA_MAP_SIZE (8*1024*1024) 26 - #define VMALLOC_START ((unsigned long)vmalloc_start) 26 + #define VMALLOC_START ((unsigned long)parisc_vmalloc_start) 27 27 #define VMALLOC_END (KERNEL_MAP_END) 28 28 #endif /*__ASSEMBLY__*/ 29 29
+1 -19
arch/parisc/include/asm/hardirq.h
··· 1 1 /* hardirq.h: PA-RISC hard IRQ support. 2 2 * 3 3 * Copyright (C) 2001 Matthew Wilcox <matthew@wil.cx> 4 - * 5 - * The locking is really quite interesting. There's a cpu-local 6 - * count of how many interrupts are being handled, and a global 7 - * lock. An interrupt can only be serviced if the global lock 8 - * is free. You can't be sure no more interrupts are being 9 - * serviced until you've acquired the lock and then checked 10 - * all the per-cpu interrupt counts are all zero. It's a specialised 11 - * br_lock, and that's exactly how Sparc does it. We don't because 12 - * it's more locking for us. This way is lock-free in the interrupt path. 13 4 */ 14 5 15 6 #ifndef _PARISC_HARDIRQ_H 16 7 #define _PARISC_HARDIRQ_H 17 8 18 - #include <linux/threads.h> 19 - #include <linux/irq.h> 20 - 21 - typedef struct { 22 - unsigned long __softirq_pending; /* set_bit is used on this */ 23 - } ____cacheline_aligned irq_cpustat_t; 24 - 25 - #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ 26 - 27 - void ack_bad_irq(unsigned int irq); 9 + #include <asm-generic/hardirq.h> 28 10 29 11 #endif /* _PARISC_HARDIRQ_H */
+4 -1
arch/parisc/include/asm/ptrace.h
··· 59 59 #define user_mode(regs) (((regs)->iaoq[0] & 3) ? 1 : 0) 60 60 #define user_space(regs) (((regs)->iasq[1] != 0) ? 1 : 0) 61 61 #define instruction_pointer(regs) ((regs)->iaoq[0] & ~3) 62 + #define user_stack_pointer(regs) ((regs)->gr[30]) 62 63 unsigned long profile_pc(struct pt_regs *); 63 64 extern void show_regs(struct pt_regs *); 64 - #endif 65 + 66 + 67 + #endif /* __KERNEL__ */ 65 68 66 69 #endif
+40
arch/parisc/include/asm/syscall.h
··· 1 + /* syscall.h */ 2 + 3 + #ifndef _ASM_PARISC_SYSCALL_H_ 4 + #define _ASM_PARISC_SYSCALL_H_ 5 + 6 + #include <linux/err.h> 7 + #include <asm/ptrace.h> 8 + 9 + static inline long syscall_get_nr(struct task_struct *tsk, 10 + struct pt_regs *regs) 11 + { 12 + return regs->gr[20]; 13 + } 14 + 15 + static inline void syscall_get_arguments(struct task_struct *tsk, 16 + struct pt_regs *regs, unsigned int i, 17 + unsigned int n, unsigned long *args) 18 + { 19 + BUG_ON(i); 20 + 21 + switch (n) { 22 + case 6: 23 + args[5] = regs->gr[21]; 24 + case 5: 25 + args[4] = regs->gr[22]; 26 + case 4: 27 + args[3] = regs->gr[23]; 28 + case 3: 29 + args[2] = regs->gr[24]; 30 + case 2: 31 + args[1] = regs->gr[25]; 32 + case 1: 33 + args[0] = regs->gr[26]; 34 + break; 35 + default: 36 + BUG(); 37 + } 38 + } 39 + 40 + #endif /*_ASM_PARISC_SYSCALL_H_*/
+9 -5
arch/parisc/include/asm/thread_info.h
··· 32 32 #define init_thread_info (init_thread_union.thread_info) 33 33 #define init_stack (init_thread_union.stack) 34 34 35 + /* how to get the thread information struct from C */ 36 + #define current_thread_info() ((struct thread_info *)mfctl(30)) 37 + 38 + #endif /* !__ASSEMBLY */ 39 + 35 40 /* thread information allocation */ 36 41 37 42 #define THREAD_SIZE_ORDER 2 ··· 44 39 * the kernel stack */ 45 40 #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) 46 41 #define THREAD_SHIFT (PAGE_SHIFT + THREAD_SIZE_ORDER) 47 - 48 - /* how to get the thread information struct from C */ 49 - #define current_thread_info() ((struct thread_info *)mfctl(30)) 50 - 51 - #endif /* !__ASSEMBLY */ 52 42 53 43 #define PREEMPT_ACTIVE_BIT 28 54 44 #define PREEMPT_ACTIVE (1 << PREEMPT_ACTIVE_BIT) ··· 60 60 #define TIF_RESTORE_SIGMASK 6 /* restore saved signal mask */ 61 61 #define TIF_FREEZE 7 /* is freezing for suspend */ 62 62 #define TIF_NOTIFY_RESUME 8 /* callback before returning to user */ 63 + #define TIF_SINGLESTEP 9 /* single stepping? */ 64 + #define TIF_BLOCKSTEP 10 /* branch stepping? */ 63 65 64 66 #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 65 67 #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) ··· 71 69 #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) 72 70 #define _TIF_FREEZE (1 << TIF_FREEZE) 73 71 #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) 72 + #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) 73 + #define _TIF_BLOCKSTEP (1 << TIF_BLOCKSTEP) 74 74 75 75 #define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | \ 76 76 _TIF_NEED_RESCHED | _TIF_RESTORE_SIGMASK)
+2 -2
arch/parisc/kernel/asm-offsets.c
··· 270 270 DEFINE(DTLB_OFF_COUNT, offsetof(struct pdc_cache_info, dt_off_count)); 271 271 DEFINE(DTLB_LOOP, offsetof(struct pdc_cache_info, dt_loop)); 272 272 BLANK(); 273 - DEFINE(PA_BLOCKSTEP_BIT, 31-PT_BLOCKSTEP_BIT); 274 - DEFINE(PA_SINGLESTEP_BIT, 31-PT_SINGLESTEP_BIT); 273 + DEFINE(TIF_BLOCKSTEP_PA_BIT, 31-TIF_BLOCKSTEP); 274 + DEFINE(TIF_SINGLESTEP_PA_BIT, 31-TIF_SINGLESTEP); 275 275 BLANK(); 276 276 DEFINE(ASM_PMD_SHIFT, PMD_SHIFT); 277 277 DEFINE(ASM_PGDIR_SHIFT, PGDIR_SHIFT);
+11 -10
arch/parisc/kernel/entry.S
··· 2047 2047 b,n syscall_check_sig 2048 2048 2049 2049 syscall_restore: 2050 - /* Are we being ptraced? */ 2051 2050 LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 2052 2051 2053 - ldw TASK_PTRACE(%r1), %r19 2054 - bb,< %r19,31,syscall_restore_rfi 2055 - nop 2052 + /* Are we being ptraced? */ 2053 + ldw TASK_FLAGS(%r1),%r19 2054 + ldi (_TIF_SINGLESTEP|_TIF_BLOCKSTEP),%r2 2055 + and,COND(=) %r19,%r2,%r0 2056 + b,n syscall_restore_rfi 2056 2057 2057 2058 ldo TASK_PT_FR31(%r1),%r19 /* reload fpregs */ 2058 2059 rest_fp %r19 ··· 2114 2113 ldi 0x0b,%r20 /* Create new PSW */ 2115 2114 depi -1,13,1,%r20 /* C, Q, D, and I bits */ 2116 2115 2117 - /* The values of PA_SINGLESTEP_BIT and PA_BLOCKSTEP_BIT are 2118 - * set in include/linux/ptrace.h and converted to PA bitmap 2116 + /* The values of SINGLESTEP_BIT and BLOCKSTEP_BIT are 2117 + * set in thread_info.h and converted to PA bitmap 2119 2118 * numbers in asm-offsets.c */ 2120 2119 2121 - /* if ((%r19.PA_SINGLESTEP_BIT)) { %r20.27=1} */ 2122 - extru,= %r19,PA_SINGLESTEP_BIT,1,%r0 2120 + /* if ((%r19.SINGLESTEP_BIT)) { %r20.27=1} */ 2121 + extru,= %r19,TIF_SINGLESTEP_PA_BIT,1,%r0 2123 2122 depi -1,27,1,%r20 /* R bit */ 2124 2123 2125 - /* if ((%r19.PA_BLOCKSTEP_BIT)) { %r20.7=1} */ 2126 - extru,= %r19,PA_BLOCKSTEP_BIT,1,%r0 2124 + /* if ((%r19.BLOCKSTEP_BIT)) { %r20.7=1} */ 2125 + extru,= %r19,TIF_BLOCKSTEP_PA_BIT,1,%r0 2127 2126 depi -1,7,1,%r20 /* T bit */ 2128 2127 2129 2128 STREG %r20,TASK_PT_PSW(%r1)
-5
arch/parisc/kernel/irq.c
··· 423 423 set_eiem(cpu_eiem); /* EIEM : enable all external intr */ 424 424 425 425 } 426 - 427 - void ack_bad_irq(unsigned int irq) 428 - { 429 - printk(KERN_WARNING "unexpected IRQ %d\n", irq); 430 - }
+1 -1
arch/parisc/kernel/module.c
··· 893 893 * ourselves */ 894 894 for (i = 1; i < hdr->e_shnum; i++) { 895 895 if(sechdrs[i].sh_type == SHT_SYMTAB 896 - && (sechdrs[i].sh_type & SHF_ALLOC)) { 896 + && (sechdrs[i].sh_flags & SHF_ALLOC)) { 897 897 int strindex = sechdrs[i].sh_link; 898 898 /* FIXME: AWFUL HACK 899 899 * The cast is to drop the const from
+22 -22
arch/parisc/kernel/ptrace.c
··· 13 13 #include <linux/smp.h> 14 14 #include <linux/errno.h> 15 15 #include <linux/ptrace.h> 16 + #include <linux/tracehook.h> 16 17 #include <linux/user.h> 17 18 #include <linux/personality.h> 18 19 #include <linux/security.h> ··· 36 35 */ 37 36 void ptrace_disable(struct task_struct *task) 38 37 { 39 - task->ptrace &= ~(PT_SINGLESTEP|PT_BLOCKSTEP); 38 + clear_tsk_thread_flag(task, TIF_SINGLESTEP); 39 + clear_tsk_thread_flag(task, TIF_BLOCKSTEP); 40 40 41 41 /* make sure the trap bits are not set */ 42 42 pa_psw(task)->r = 0; ··· 57 55 58 56 void user_enable_single_step(struct task_struct *task) 59 57 { 60 - task->ptrace &= ~PT_BLOCKSTEP; 61 - task->ptrace |= PT_SINGLESTEP; 58 + clear_tsk_thread_flag(task, TIF_BLOCKSTEP); 59 + set_tsk_thread_flag(task, TIF_SINGLESTEP); 62 60 63 61 if (pa_psw(task)->n) { 64 62 struct siginfo si; ··· 100 98 101 99 void user_enable_block_step(struct task_struct *task) 102 100 { 103 - task->ptrace &= ~PT_SINGLESTEP; 104 - task->ptrace |= PT_BLOCKSTEP; 101 + clear_tsk_thread_flag(task, TIF_SINGLESTEP); 102 + set_tsk_thread_flag(task, TIF_BLOCKSTEP); 105 103 106 104 /* Enable taken branch trap. */ 107 105 pa_psw(task)->r = 0; ··· 265 263 } 266 264 #endif 267 265 268 - 269 - void syscall_trace(void) 266 + long do_syscall_trace_enter(struct pt_regs *regs) 270 267 { 271 - if (!test_thread_flag(TIF_SYSCALL_TRACE)) 272 - return; 273 - if (!(current->ptrace & PT_PTRACED)) 274 - return; 275 - ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) 276 - ? 0x80 : 0)); 277 - /* 278 - * this isn't the same as continuing with a signal, but it will do 279 - * for normal use. strace only continues with a signal if the 280 - * stopping signal is not SIGTRAP. -brl 281 - */ 282 - if (current->exit_code) { 283 - send_sig(current->exit_code, current, 1); 284 - current->exit_code = 0; 285 - } 268 + if (test_thread_flag(TIF_SYSCALL_TRACE) && 269 + tracehook_report_syscall_entry(regs)) 270 + return -1L; 271 + 272 + return regs->gr[20]; 273 + } 274 + 275 + void do_syscall_trace_exit(struct pt_regs *regs) 276 + { 277 + int stepping = test_thread_flag(TIF_SINGLESTEP) || 278 + test_thread_flag(TIF_BLOCKSTEP); 279 + 280 + if (stepping || test_thread_flag(TIF_SYSCALL_TRACE)) 281 + tracehook_report_syscall_exit(regs, stepping); 286 282 }
+4 -1
arch/parisc/kernel/signal.c
··· 21 21 #include <linux/errno.h> 22 22 #include <linux/wait.h> 23 23 #include <linux/ptrace.h> 24 + #include <linux/tracehook.h> 24 25 #include <linux/unistd.h> 25 26 #include <linux/stddef.h> 26 27 #include <linux/compat.h> ··· 35 34 #include <asm/asm-offsets.h> 36 35 37 36 #ifdef CONFIG_COMPAT 38 - #include <linux/compat.h> 39 37 #include "signal32.h" 40 38 #endif 41 39 ··· 468 468 sigaddset(&current->blocked,sig); 469 469 recalc_sigpending(); 470 470 spin_unlock_irq(&current->sighand->siglock); 471 + 472 + tracehook_signal_handler(sig, info, ka, regs, 0); 473 + 471 474 return 1; 472 475 } 473 476
+14 -8
arch/parisc/kernel/syscall.S
··· 288 288 STREG %r18,PT_GR18(%r2) 289 289 /* Finished saving things for the debugger */ 290 290 291 - ldil L%syscall_trace,%r1 291 + copy %r2,%r26 292 + ldil L%do_syscall_trace_enter,%r1 292 293 ldil L%tracesys_next,%r2 293 - be R%syscall_trace(%sr7,%r1) 294 + be R%do_syscall_trace_enter(%sr7,%r1) 294 295 ldo R%tracesys_next(%r2),%r2 295 296 296 - tracesys_next: 297 + tracesys_next: 298 + /* do_syscall_trace_enter either returned the syscallno, or -1L, 299 + * so we skip restoring the PT_GR20 below, since we pulled it from 300 + * task->thread.regs.gr[20] above. 301 + */ 302 + copy %ret0,%r20 297 303 ldil L%sys_call_table,%r1 298 304 ldo R%sys_call_table(%r1), %r19 299 305 300 306 ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */ 301 307 LDREG TI_TASK(%r1), %r1 302 - LDREG TASK_PT_GR20(%r1), %r20 303 308 LDREG TASK_PT_GR26(%r1), %r26 /* Restore the users args */ 304 309 LDREG TASK_PT_GR25(%r1), %r25 305 310 LDREG TASK_PT_GR24(%r1), %r24 ··· 341 336 #ifdef CONFIG_64BIT 342 337 ldo -16(%r30),%r29 /* Reference param save area */ 343 338 #endif 344 - bl syscall_trace, %r2 339 + ldo TASK_REGS(%r1),%r26 340 + bl do_syscall_trace_exit,%r2 345 341 STREG %r28,TASK_PT_GR28(%r1) /* save return value now */ 346 342 ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */ 347 343 LDREG TI_TASK(%r1), %r1 ··· 359 353 360 354 tracesys_sigexit: 361 355 ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */ 362 - LDREG 0(%r1), %r1 356 + LDREG TI_TASK(%r1), %r1 363 357 #ifdef CONFIG_64BIT 364 358 ldo -16(%r30),%r29 /* Reference param save area */ 365 359 #endif 366 - bl syscall_trace, %r2 367 - nop 360 + bl do_syscall_trace_exit,%r2 361 + ldo TASK_REGS(%r1),%r26 368 362 369 363 ldil L%syscall_exit_rfi,%r1 370 364 be,n R%syscall_exit_rfi(%sr7,%r1)
+10
arch/parisc/kernel/vmlinux.lds.S
··· 28 28 #include <asm/cache.h> 29 29 #include <asm/page.h> 30 30 #include <asm/asm-offsets.h> 31 + #include <asm/thread_info.h> 31 32 32 33 /* ld script to make hppa Linux kernel */ 33 34 #ifndef CONFIG_64BIT ··· 135 134 __init_begin = .; 136 135 INIT_TEXT_SECTION(16384) 137 136 INIT_DATA_SECTION(16) 137 + /* we have to discard exit text and such at runtime, not link time */ 138 + .exit.text : 139 + { 140 + EXIT_TEXT 141 + } 142 + .exit.data : 143 + { 144 + EXIT_DATA 145 + } 138 146 139 147 PERCPU(PAGE_SIZE) 140 148 . = ALIGN(PAGE_SIZE);
+6 -5
arch/parisc/mm/init.c
··· 434 434 #define SET_MAP_OFFSET(x) ((void *)(((unsigned long)(x) + VM_MAP_OFFSET) \ 435 435 & ~(VM_MAP_OFFSET-1))) 436 436 437 - void *vmalloc_start __read_mostly; 438 - EXPORT_SYMBOL(vmalloc_start); 437 + void *parisc_vmalloc_start __read_mostly; 438 + EXPORT_SYMBOL(parisc_vmalloc_start); 439 439 440 440 #ifdef CONFIG_PA11 441 441 unsigned long pcxl_dma_start __read_mostly; ··· 496 496 #ifdef CONFIG_PA11 497 497 if (hppa_dma_ops == &pcxl_dma_ops) { 498 498 pcxl_dma_start = (unsigned long)SET_MAP_OFFSET(MAP_START); 499 - vmalloc_start = SET_MAP_OFFSET(pcxl_dma_start + PCXL_DMA_MAP_SIZE); 499 + parisc_vmalloc_start = SET_MAP_OFFSET(pcxl_dma_start 500 + + PCXL_DMA_MAP_SIZE); 500 501 } else { 501 502 pcxl_dma_start = 0; 502 - vmalloc_start = SET_MAP_OFFSET(MAP_START); 503 + parisc_vmalloc_start = SET_MAP_OFFSET(MAP_START); 503 504 } 504 505 #else 505 - vmalloc_start = SET_MAP_OFFSET(MAP_START); 506 + parisc_vmalloc_start = SET_MAP_OFFSET(MAP_START); 506 507 #endif 507 508 508 509 printk(KERN_INFO "Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, %dk init)\n",
+1 -1
drivers/char/agp/parisc-agp.c
··· 217 217 .configure = parisc_agp_configure, 218 218 .fetch_size = parisc_agp_fetch_size, 219 219 .tlb_flush = parisc_agp_tlbflush, 220 - .mask_memory = parisc_agp_page_mask_memory, 220 + .mask_memory = parisc_agp_mask_memory, 221 221 .masks = parisc_agp_masks, 222 222 .agp_enable = parisc_agp_enable, 223 223 .cache_flush = global_cache_flush,