Commit f79ea757 authored by Stephen Rothwell's avatar Stephen Rothwell

Merge commit 'parisc/next'

Conflicts:
	arch/parisc/include/asm/thread_info.h
	arch/parisc/kernel/entry.S
	arch/parisc/kernel/signal.c
parents c8d34f0d 1e0d061b
...@@ -3920,6 +3920,7 @@ F: drivers/block/paride/ ...@@ -3920,6 +3920,7 @@ F: drivers/block/paride/
PARISC ARCHITECTURE PARISC ARCHITECTURE
M: Kyle McMartin <kyle@mcmartin.ca> M: Kyle McMartin <kyle@mcmartin.ca>
M: Helge Deller <deller@gmx.de> M: Helge Deller <deller@gmx.de>
M: "James E.J. Bottomley" <jejb@parisc-linux.org>
L: linux-parisc@vger.kernel.org L: linux-parisc@vger.kernel.org
W: http://www.parisc-linux.org/ W: http://www.parisc-linux.org/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6.git
......
...@@ -18,6 +18,7 @@ config PARISC ...@@ -18,6 +18,7 @@ config PARISC
select BUG select BUG
select HAVE_PERF_COUNTERS select HAVE_PERF_COUNTERS
select GENERIC_ATOMIC64 if !64BIT select GENERIC_ATOMIC64 if !64BIT
select HAVE_ARCH_TRACEHOOK
help help
The PA-RISC microprocessor is designed by Hewlett-Packard and used The PA-RISC microprocessor is designed by Hewlett-Packard and used
in many of their workstations & servers (HP9000 700 and 800 series, in many of their workstations & servers (HP9000 700 and 800 series,
......
...@@ -329,6 +329,7 @@ struct pt_regs; /* forward declaration... */ ...@@ -329,6 +329,7 @@ struct pt_regs; /* forward declaration... */
#define ELF_PLAT_INIT(_r, load_addr) _r->gr[23] = 0 #define ELF_PLAT_INIT(_r, load_addr) _r->gr[23] = 0
#define USE_ELF_CORE_DUMP #define USE_ELF_CORE_DUMP
#define CORE_DUMP_USE_REGSET
#define ELF_EXEC_PAGESIZE 4096 #define ELF_EXEC_PAGESIZE 4096
/* This is the location that an ET_DYN program is loaded if exec'ed. Typical /* This is the location that an ET_DYN program is loaded if exec'ed. Typical
......
/* hardirq.h: PA-RISC hard IRQ support. /* hardirq.h: PA-RISC hard IRQ support.
* *
* Copyright (C) 2001 Matthew Wilcox <matthew@wil.cx> * Copyright (C) 2001 Matthew Wilcox <matthew@wil.cx>
*
* The locking is really quite interesting. There's a cpu-local
* count of how many interrupts are being handled, and a global
* lock. An interrupt can only be serviced if the global lock
* is free. You can't be sure no more interrupts are being
* serviced until you've acquired the lock and then checked
* all the per-cpu interrupt counts are all zero. It's a specialised
* br_lock, and that's exactly how Sparc does it. We don't because
* it's more locking for us. This way is lock-free in the interrupt path.
*/ */
#ifndef _PARISC_HARDIRQ_H #ifndef _PARISC_HARDIRQ_H
#define _PARISC_HARDIRQ_H #define _PARISC_HARDIRQ_H
#include <linux/threads.h> #include <asm-generic/hardirq.h>
#include <linux/irq.h>
typedef struct {
unsigned long __softirq_pending; /* set_bit is used on this */
} ____cacheline_aligned irq_cpustat_t;
#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
void ack_bad_irq(unsigned int irq);
#endif /* _PARISC_HARDIRQ_H */ #endif /* _PARISC_HARDIRQ_H */
...@@ -33,6 +33,35 @@ struct pt_regs { ...@@ -33,6 +33,35 @@ struct pt_regs {
unsigned long ipsw; /* CR22 */ unsigned long ipsw; /* CR22 */
}; };
/* regset as seen by PTRACE_{GET|SET}REGS and coredumps */
struct user_regset_struct {
unsigned long gr[32];
unsigned long sr[ 8];
unsigned long iaoq[2];
unsigned long iasq[2];
unsigned long sar;
unsigned long iir;
unsigned long isr;
unsigned long ior;
unsigned long cr22;
unsigned long cr0;
unsigned long cr24;
unsigned long cr25;
unsigned long cr26;
unsigned long cr27;
unsigned long cr28;
unsigned long cr29;
unsigned long cr30;
unsigned long cr31;
unsigned long cr8;
unsigned long cr9;
unsigned long cr12;
unsigned long cr13;
unsigned long cr10;
unsigned long cr15;
unsigned long __pad0[16]; /* ELF_NGREG is 80, pad it out */
};
/* /*
* The numbers chosen here are somewhat arbitrary but absolutely MUST * The numbers chosen here are somewhat arbitrary but absolutely MUST
* not overlap with any of the number assigned in <linux/ptrace.h>. * not overlap with any of the number assigned in <linux/ptrace.h>.
...@@ -42,6 +71,10 @@ struct pt_regs { ...@@ -42,6 +71,10 @@ struct pt_regs {
* since we have taken branch traps too) * since we have taken branch traps too)
*/ */
#define PTRACE_SINGLEBLOCK 12 /* resume execution until next branch */ #define PTRACE_SINGLEBLOCK 12 /* resume execution until next branch */
#define PTRACE_GETREGS 13
#define PTRACE_SETREGS 14
#define PTRACE_GETFPREGS 18
#define PTRACE_SETFPREGS 19
#ifdef __KERNEL__ #ifdef __KERNEL__
...@@ -59,8 +92,11 @@ void user_enable_block_step(struct task_struct *task); ...@@ -59,8 +92,11 @@ void user_enable_block_step(struct task_struct *task);
#define user_mode(regs) (((regs)->iaoq[0] & 3) ? 1 : 0) #define user_mode(regs) (((regs)->iaoq[0] & 3) ? 1 : 0)
#define user_space(regs) (((regs)->iasq[1] != 0) ? 1 : 0) #define user_space(regs) (((regs)->iasq[1] != 0) ? 1 : 0)
#define instruction_pointer(regs) ((regs)->iaoq[0] & ~3) #define instruction_pointer(regs) ((regs)->iaoq[0] & ~3)
#define user_stack_pointer(regs) ((regs)->gr[30])
unsigned long profile_pc(struct pt_regs *); unsigned long profile_pc(struct pt_regs *);
extern void show_regs(struct pt_regs *); extern void show_regs(struct pt_regs *);
#endif
#endif /* __KERNEL__ */
#endif #endif
/* syscall.h */
#ifndef _ASM_PARISC_SYSCALL_H_
#define _ASM_PARISC_SYSCALL_H_
#include <linux/err.h>
#include <asm/ptrace.h>
static inline long syscall_get_nr(struct task_struct *tsk,
struct pt_regs *regs)
{
return regs->gr[20];
}
static inline void syscall_get_arguments(struct task_struct *tsk,
struct pt_regs *regs, unsigned int i,
unsigned int n, unsigned long *args)
{
BUG_ON(i);
switch (n) {
case 6:
args[5] = regs->gr[21];
case 5:
args[4] = regs->gr[22];
case 4:
args[3] = regs->gr[23];
case 3:
args[2] = regs->gr[24];
case 2:
args[1] = regs->gr[25];
case 1:
args[0] = regs->gr[26];
break;
default:
BUG();
}
}
#endif /*_ASM_PARISC_SYSCALL_H_*/
...@@ -59,7 +59,9 @@ struct thread_info { ...@@ -59,7 +59,9 @@ struct thread_info {
#define TIF_MEMDIE 5 #define TIF_MEMDIE 5
#define TIF_RESTORE_SIGMASK 6 /* restore saved signal mask */ #define TIF_RESTORE_SIGMASK 6 /* restore saved signal mask */
#define TIF_FREEZE 7 /* is freezing for suspend */ #define TIF_FREEZE 7 /* is freezing for suspend */
#define TIF_NOTIFY_RESUME 8 /* callback before returning to user */ #define TIF_NOTIFY_RESUME 8 /* tracing notification pending */
#define TIF_SINGLESTEP 9 /* single stepping? */
#define TIF_BLOCKSTEP 10 /* branch stepping? */
#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
#define _TIF_SIGPENDING (1 << TIF_SIGPENDING) #define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
...@@ -69,9 +71,11 @@ struct thread_info { ...@@ -69,9 +71,11 @@ struct thread_info {
#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
#define _TIF_FREEZE (1 << TIF_FREEZE) #define _TIF_FREEZE (1 << TIF_FREEZE)
#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
#define _TIF_BLOCKSTEP (1 << TIF_BLOCKSTEP)
#define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | \ #define _TIF_DO_NOTIFY_RESUME_MASK (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK | \
_TIF_NEED_RESCHED | _TIF_RESTORE_SIGMASK) _TIF_NOTIFY_RESUME)
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
......
...@@ -270,8 +270,8 @@ int main(void) ...@@ -270,8 +270,8 @@ int main(void)
DEFINE(DTLB_OFF_COUNT, offsetof(struct pdc_cache_info, dt_off_count)); DEFINE(DTLB_OFF_COUNT, offsetof(struct pdc_cache_info, dt_off_count));
DEFINE(DTLB_LOOP, offsetof(struct pdc_cache_info, dt_loop)); DEFINE(DTLB_LOOP, offsetof(struct pdc_cache_info, dt_loop));
BLANK(); BLANK();
DEFINE(PA_BLOCKSTEP_BIT, 31-PT_BLOCKSTEP_BIT); DEFINE(TIF_BLOCKSTEP_PA_BIT, 31-TIF_BLOCKSTEP);
DEFINE(PA_SINGLESTEP_BIT, 31-PT_SINGLESTEP_BIT); DEFINE(TIF_SINGLESTEP_PA_BIT, 31-TIF_SINGLESTEP);
BLANK(); BLANK();
DEFINE(ASM_PMD_SHIFT, PMD_SHIFT); DEFINE(ASM_PMD_SHIFT, PMD_SHIFT);
DEFINE(ASM_PGDIR_SHIFT, PGDIR_SHIFT); DEFINE(ASM_PGDIR_SHIFT, PGDIR_SHIFT);
......
...@@ -948,7 +948,7 @@ intr_check_sig: ...@@ -948,7 +948,7 @@ intr_check_sig:
/* As above */ /* As above */
mfctl %cr30,%r1 mfctl %cr30,%r1
LDREG TI_FLAGS(%r1),%r19 LDREG TI_FLAGS(%r1),%r19
ldi (_TIF_SIGPENDING|_TIF_RESTORE_SIGMASK|_TIF_NOTIFY_RESUME), %r20 ldi _TIF_DO_NOTIFY_RESUME_MASK, %r20
and,COND(<>) %r19, %r20, %r0 and,COND(<>) %r19, %r20, %r0
b,n intr_restore /* skip past if we've nothing to do */ b,n intr_restore /* skip past if we've nothing to do */
...@@ -2019,7 +2019,7 @@ syscall_check_resched: ...@@ -2019,7 +2019,7 @@ syscall_check_resched:
.import do_signal,code .import do_signal,code
syscall_check_sig: syscall_check_sig:
LDREG TI_FLAGS-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r19 LDREG TI_FLAGS-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r19
ldi (_TIF_SIGPENDING|_TIF_RESTORE_SIGMASK), %r26 ldi _TIF_DO_NOTIFY_RESUME_MASK, %r26
and,COND(<>) %r19, %r26, %r0 and,COND(<>) %r19, %r26, %r0
b,n syscall_restore /* skip past if we've nothing to do */ b,n syscall_restore /* skip past if we've nothing to do */
...@@ -2047,12 +2047,13 @@ syscall_do_signal: ...@@ -2047,12 +2047,13 @@ syscall_do_signal:
b,n syscall_check_sig b,n syscall_check_sig
syscall_restore: syscall_restore:
/* Are we being ptraced? */
LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1
ldw TASK_PTRACE(%r1), %r19 /* Are we being ptraced? */
bb,< %r19,31,syscall_restore_rfi ldw TASK_FLAGS(%r1),%r19
nop ldi (_TIF_SINGLESTEP|_TIF_BLOCKSTEP),%r2
and,COND(=) %r19,%r2,%r0
b,n syscall_restore_rfi
ldo TASK_PT_FR31(%r1),%r19 /* reload fpregs */ ldo TASK_PT_FR31(%r1),%r19 /* reload fpregs */
rest_fp %r19 rest_fp %r19
...@@ -2113,16 +2114,16 @@ syscall_restore_rfi: ...@@ -2113,16 +2114,16 @@ syscall_restore_rfi:
ldi 0x0b,%r20 /* Create new PSW */ ldi 0x0b,%r20 /* Create new PSW */
depi -1,13,1,%r20 /* C, Q, D, and I bits */ depi -1,13,1,%r20 /* C, Q, D, and I bits */
/* The values of PA_SINGLESTEP_BIT and PA_BLOCKSTEP_BIT are /* The values of SINGLESTEP_BIT and BLOCKSTEP_BIT are
* set in include/linux/ptrace.h and converted to PA bitmap * set in thread_info.h and converted to PA bitmap
* numbers in asm-offsets.c */ * numbers in asm-offsets.c
*/
/* if ((%r19.PA_SINGLESTEP_BIT)) { %r20.27=1} */ /* if ((%r19.SINGLESTEP_BIT)) { %r20.27=1} */
extru,= %r19,PA_SINGLESTEP_BIT,1,%r0 extru,= %r19,TIF_SINGLESTEP_PA_BIT,1,%r0
depi -1,27,1,%r20 /* R bit */ depi -1,27,1,%r20 /* R bit */
/* if ((%r19.PA_BLOCKSTEP_BIT)) { %r20.7=1} */ /* if ((%r19.BLOCKSTEP_BIT)) { %r20.7=1} */
extru,= %r19,PA_BLOCKSTEP_BIT,1,%r0 extru,= %r19,TIF_BLOCKSTEP_PA_BIT,1,%r0
depi -1,7,1,%r20 /* T bit */ depi -1,7,1,%r20 /* T bit */
STREG %r20,TASK_PT_PSW(%r1) STREG %r20,TASK_PT_PSW(%r1)
......
...@@ -423,8 +423,3 @@ void __init init_IRQ(void) ...@@ -423,8 +423,3 @@ void __init init_IRQ(void)
set_eiem(cpu_eiem); /* EIEM : enable all external intr */ set_eiem(cpu_eiem); /* EIEM : enable all external intr */
} }
void ack_bad_irq(unsigned int irq)
{
printk(KERN_WARNING "unexpected IRQ %d\n", irq);
}
...@@ -893,7 +893,7 @@ int module_finalize(const Elf_Ehdr *hdr, ...@@ -893,7 +893,7 @@ int module_finalize(const Elf_Ehdr *hdr,
* ourselves */ * ourselves */
for (i = 1; i < hdr->e_shnum; i++) { for (i = 1; i < hdr->e_shnum; i++) {
if(sechdrs[i].sh_type == SHT_SYMTAB if(sechdrs[i].sh_type == SHT_SYMTAB
&& (sechdrs[i].sh_type & SHF_ALLOC)) { && (sechdrs[i].sh_flags & SHF_ALLOC)) {
int strindex = sechdrs[i].sh_link; int strindex = sechdrs[i].sh_link;
/* FIXME: AWFUL HACK /* FIXME: AWFUL HACK
* The cast is to drop the const from * The cast is to drop the const from
......
This diff is collapsed.
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/wait.h> #include <linux/wait.h>
#include <linux/ptrace.h> #include <linux/ptrace.h>
#include <linux/tracehook.h>
#include <linux/unistd.h> #include <linux/unistd.h>
#include <linux/stddef.h> #include <linux/stddef.h>
#include <linux/compat.h> #include <linux/compat.h>
...@@ -468,6 +469,9 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, ...@@ -468,6 +469,9 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
sigaddset(&current->blocked,sig); sigaddset(&current->blocked,sig);
recalc_sigpending(); recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock); spin_unlock_irq(&current->sighand->siglock);
tracehook_signal_handler(sig, info, ka, regs, 0);
return 1; return 1;
} }
......
...@@ -288,18 +288,23 @@ tracesys: ...@@ -288,18 +288,23 @@ tracesys:
STREG %r18,PT_GR18(%r2) STREG %r18,PT_GR18(%r2)
/* Finished saving things for the debugger */ /* Finished saving things for the debugger */
ldil L%syscall_trace,%r1 copy %r2,%r26
ldil L%do_syscall_trace_enter,%r1
ldil L%tracesys_next,%r2 ldil L%tracesys_next,%r2
be R%syscall_trace(%sr7,%r1) be R%do_syscall_trace_enter(%sr7,%r1)
ldo R%tracesys_next(%r2),%r2 ldo R%tracesys_next(%r2),%r2
tracesys_next: tracesys_next:
/* do_syscall_trace_enter either returned the syscallno, or -1L,
* so we skip restoring the PT_GR20 below, since we pulled it from
* task->thread.regs.gr[20] above.
*/
copy %ret0,%r20
ldil L%sys_call_table,%r1 ldil L%sys_call_table,%r1
ldo R%sys_call_table(%r1), %r19 ldo R%sys_call_table(%r1), %r19
ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */ ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */
LDREG TI_TASK(%r1), %r1 LDREG TI_TASK(%r1), %r1
LDREG TASK_PT_GR20(%r1), %r20
LDREG TASK_PT_GR26(%r1), %r26 /* Restore the users args */ LDREG TASK_PT_GR26(%r1), %r26 /* Restore the users args */
LDREG TASK_PT_GR25(%r1), %r25 LDREG TASK_PT_GR25(%r1), %r25
LDREG TASK_PT_GR24(%r1), %r24 LDREG TASK_PT_GR24(%r1), %r24
...@@ -336,7 +341,8 @@ tracesys_exit: ...@@ -336,7 +341,8 @@ tracesys_exit:
#ifdef CONFIG_64BIT #ifdef CONFIG_64BIT
ldo -16(%r30),%r29 /* Reference param save area */ ldo -16(%r30),%r29 /* Reference param save area */
#endif #endif
bl syscall_trace, %r2 ldo TASK_REGS(%r1),%r26
bl do_syscall_trace_exit,%r2
STREG %r28,TASK_PT_GR28(%r1) /* save return value now */ STREG %r28,TASK_PT_GR28(%r1) /* save return value now */
ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */ ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */
LDREG TI_TASK(%r1), %r1 LDREG TI_TASK(%r1), %r1
...@@ -353,12 +359,12 @@ tracesys_exit: ...@@ -353,12 +359,12 @@ tracesys_exit:
tracesys_sigexit: tracesys_sigexit:
ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */ ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */
LDREG 0(%r1), %r1 LDREG TI_TASK(%r1), %r1
#ifdef CONFIG_64BIT #ifdef CONFIG_64BIT
ldo -16(%r30),%r29 /* Reference param save area */ ldo -16(%r30),%r29 /* Reference param save area */
#endif #endif
bl syscall_trace, %r2 bl do_syscall_trace_exit,%r2
nop ldo TASK_REGS(%r1),%r26
ldil L%syscall_exit_rfi,%r1 ldil L%syscall_exit_rfi,%r1
be,n R%syscall_exit_rfi(%sr7,%r1) be,n R%syscall_exit_rfi(%sr7,%r1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment