Commit 0afc2edf authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
  [SPARC32]: Use regsets in arch_ptrace().
  [SPARC64]: Use regsets in arch_ptrace().
  [SPARC32]: Use regsets for ELF core dumping.
  [SPARC64]: Use regsets for ELF core dumping.
  [SPARC64]: Remove unintentional ptrace debugging messages.
  [SPARC]: Move over to arch_ptrace().
  [SPARC]: Remove PTRACE_SUN* handling.
  [SPARC]: Kill DEBUG_PTRACE code.
  [SPARC32]: Add user regset support.
  [SPARC64]: Add user regsets.
  [SPARC64]: Fix booting on non-zero cpu.
parents a8e98d6d d256eb8d
...@@ -1224,23 +1224,6 @@ sys_nis_syscall: ...@@ -1224,23 +1224,6 @@ sys_nis_syscall:
call c_sys_nis_syscall call c_sys_nis_syscall
mov %l5, %o7 mov %l5, %o7
.align 4
.globl sys_ptrace
sys_ptrace:
call do_ptrace
add %sp, STACKFRAME_SZ, %o0
ld [%curptr + TI_FLAGS], %l5
andcc %l5, _TIF_SYSCALL_TRACE, %g0
be 1f
nop
call syscall_trace
nop
1:
RESTORE_ALL
.align 4 .align 4
.globl sys_execve .globl sys_execve
sys_execve: sys_execve:
......
This diff is collapsed.
/* /*
* binfmt_elf32.c: Support 32-bit Sparc ELF binaries on Ultra. * binfmt_elf32.c: Support 32-bit Sparc ELF binaries on Ultra.
* *
* Copyright (C) 1995, 1996, 1997, 1998 David S. Miller (davem@davemloft.net) * Copyright (C) 1995, 1996, 1997, 1998, 2008 David S. Miller (davem@davemloft.net)
* Copyright (C) 1995, 1996, 1997, 1998 Jakub Jelinek (jj@ultra.linux.cz) * Copyright (C) 1995, 1996, 1997, 1998 Jakub Jelinek (jj@ultra.linux.cz)
*/ */
...@@ -9,13 +9,6 @@ ...@@ -9,13 +9,6 @@
#define ELF_CLASS ELFCLASS32 #define ELF_CLASS ELFCLASS32
#define ELF_DATA ELFDATA2MSB; #define ELF_DATA ELFDATA2MSB;
/* For the most part we present code dumps in the format
* Solaris does.
*/
typedef unsigned int elf_greg_t;
#define ELF_NGREG 38
typedef elf_greg_t elf_gregset_t[ELF_NGREG];
/* Format is: /* Format is:
* G0 --> G7 * G0 --> G7
* O0 --> O7 * O0 --> O7
...@@ -23,25 +16,9 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG]; ...@@ -23,25 +16,9 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG];
* I0 --> I7 * I0 --> I7
* PSR, PC, nPC, Y, WIM, TBR * PSR, PC, nPC, Y, WIM, TBR
*/ */
#include <asm/psrcompat.h> typedef unsigned int elf_greg_t;
#define ELF_CORE_COPY_REGS(__elf_regs, __pt_regs) \ #define ELF_NGREG 38
do { unsigned int *dest = &(__elf_regs[0]); \ typedef elf_greg_t elf_gregset_t[ELF_NGREG];
struct pt_regs *src = (__pt_regs); \
unsigned int __user *sp; \
int i; \
for(i = 0; i < 16; i++) \
dest[i] = (unsigned int) src->u_regs[i];\
/* Don't try this at home kids... */ \
sp = (unsigned int __user *) (src->u_regs[14] & \
0x00000000fffffffc); \
for(i = 0; i < 16; i++) \
__get_user(dest[i+16], &sp[i]); \
dest[32] = tstate_to_psr(src->tstate); \
dest[33] = (unsigned int) src->tpc; \
dest[34] = (unsigned int) src->tnpc; \
dest[35] = src->y; \
dest[36] = dest[37] = 0; /* XXX */ \
} while(0);
typedef struct { typedef struct {
union { union {
......
...@@ -1477,10 +1477,6 @@ sys32_rt_sigreturn: ...@@ -1477,10 +1477,6 @@ sys32_rt_sigreturn:
add %o7, 1f-.-4, %o7 add %o7, 1f-.-4, %o7
nop nop
#endif #endif
sys_ptrace: add %sp, PTREGS_OFF, %o0
call do_ptrace
add %o7, 1f-.-4, %o7
nop
.align 32 .align 32
1: ldx [%curptr + TI_FLAGS], %l5 1: ldx [%curptr + TI_FLAGS], %l5
andcc %l5, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT), %g0 andcc %l5, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT), %g0
......
...@@ -632,11 +632,36 @@ tlb_fixup_done: ...@@ -632,11 +632,36 @@ tlb_fixup_done:
/* Not reached... */ /* Not reached... */
1: 1:
/* If we boot on a non-zero cpu, all of the per-cpu
* variable references we make before setting up the
* per-cpu areas will use a bogus offset. Put a
* compensating factor into __per_cpu_base to handle
* this cleanly.
*
* What the per-cpu code calculates is:
*
* __per_cpu_base + (cpu << __per_cpu_shift)
*
* These two variables are zero initially, so to
* make it all cancel out to zero we need to put
* "0 - (cpu << 0)" into __per_cpu_base so that the
* above formula evaluates to zero.
*
* We cannot even perform a printk() until this stuff
* is setup as that calls cpu_clock() which uses
* per-cpu variables.
*/
sub %g0, %o0, %o1
sethi %hi(__per_cpu_base), %o2
stx %o1, [%o2 + %lo(__per_cpu_base)]
#else #else
mov 0, %o0 mov 0, %o0
#endif #endif
sth %o0, [%g6 + TI_CPU] sth %o0, [%g6 + TI_CPU]
call prom_init_report
nop
/* Off we go.... */ /* Off we go.... */
call start_kernel call start_kernel
nop nop
......
This diff is collapsed.
...@@ -48,7 +48,10 @@ void __init prom_init(void *cif_handler, void *cif_stack) ...@@ -48,7 +48,10 @@ void __init prom_init(void *cif_handler, void *cif_stack)
prom_getstring(node, "version", prom_version, sizeof(prom_version)); prom_getstring(node, "version", prom_version, sizeof(prom_version));
prom_printf("\n"); prom_printf("\n");
}
void __init prom_init_report(void)
{
printk("PROMLIB: Sun IEEE Boot Prom '%s'\n", prom_version); printk("PROMLIB: Sun IEEE Boot Prom '%s'\n", prom_version);
printk("PROMLIB: Root node compatible: %s\n", prom_root_compatible); printk("PROMLIB: Root node compatible: %s\n", prom_root_compatible);
} }
...@@ -65,8 +65,14 @@ ...@@ -65,8 +65,14 @@
#define HWCAP_SPARC_V9 16 #define HWCAP_SPARC_V9 16
#define HWCAP_SPARC_ULTRA3 32 #define HWCAP_SPARC_ULTRA3 32
/* For the most part we present code dumps in the format #define CORE_DUMP_USE_REGSET
* Solaris does.
/* Format is:
* G0 --> G7
* O0 --> O7
* L0 --> L7
* I0 --> I7
* PSR, PC, nPC, Y, WIM, TBR
*/ */
typedef unsigned long elf_greg_t; typedef unsigned long elf_greg_t;
#define ELF_NGREG 38 #define ELF_NGREG 38
...@@ -86,34 +92,6 @@ typedef struct { ...@@ -86,34 +92,6 @@ typedef struct {
} elf_fpregset_t; } elf_fpregset_t;
#include <asm/mbus.h> #include <asm/mbus.h>
#include <asm/uaccess.h>
/* Format is:
* G0 --> G7
* O0 --> O7
* L0 --> L7
* I0 --> I7
* PSR, PC, nPC, Y, WIM, TBR
*/
#define ELF_CORE_COPY_REGS(__elf_regs, __pt_regs) \
do { unsigned long *dest = &(__elf_regs[0]); \
struct pt_regs *src = (__pt_regs); \
unsigned long __user *sp; \
memcpy(&dest[0], &src->u_regs[0], \
sizeof(unsigned long) * 16); \
/* Don't try this at home kids... */ \
sp = (unsigned long __user *) src->u_regs[14]; \
copy_from_user(&dest[16], sp, \
sizeof(unsigned long) * 16); \
dest[32] = src->psr; \
dest[33] = src->pc; \
dest[34] = src->npc; \
dest[35] = src->y; \
dest[36] = dest[37] = 0; /* XXX */ \
} while(0); /* Janitors: Don't touch this semicolon. */
#define ELF_CORE_COPY_TASK_REGS(__tsk, __elf_regs) \
({ ELF_CORE_COPY_REGS((*(__elf_regs)), (__tsk)->thread.kregs); 1; })
/* /*
* This is used to ensure we don't load something for the wrong architecture. * This is used to ensure we don't load something for the wrong architecture.
......
...@@ -61,8 +61,6 @@ struct sparc_stackf { ...@@ -61,8 +61,6 @@ struct sparc_stackf {
#ifdef __KERNEL__ #ifdef __KERNEL__
#define __ARCH_SYS_PTRACE 1
#define user_mode(regs) (!((regs)->psr & PSR_PS)) #define user_mode(regs) (!((regs)->psr & PSR_PS))
#define instruction_pointer(regs) ((regs)->pc) #define instruction_pointer(regs) ((regs)->pc)
unsigned long profile_pc(struct pt_regs *); unsigned long profile_pc(struct pt_regs *);
...@@ -151,8 +149,6 @@ extern void show_regs(struct pt_regs *); ...@@ -151,8 +149,6 @@ extern void show_regs(struct pt_regs *);
#define SF_XXARG 0x5c #define SF_XXARG 0x5c
/* Stuff for the ptrace system call */ /* Stuff for the ptrace system call */
#define PTRACE_SUNATTACH 10
#define PTRACE_SUNDETACH 11
#define PTRACE_GETREGS 12 #define PTRACE_GETREGS 12
#define PTRACE_SETREGS 13 #define PTRACE_SETREGS 13
#define PTRACE_GETFPREGS 14 #define PTRACE_GETFPREGS 14
...@@ -164,7 +160,4 @@ extern void show_regs(struct pt_regs *); ...@@ -164,7 +160,4 @@ extern void show_regs(struct pt_regs *);
#define PTRACE_GETFPAREGS 20 #define PTRACE_GETFPAREGS 20
#define PTRACE_SETFPAREGS 21 #define PTRACE_SETFPAREGS 21
#define PTRACE_GETUCODE 29 /* stupid bsd-ism */
#endif /* !(_SPARC_PTRACE_H) */ #endif /* !(_SPARC_PTRACE_H) */
...@@ -70,6 +70,8 @@ ...@@ -70,6 +70,8 @@
#define HWCAP_SPARC_BLKINIT 64 #define HWCAP_SPARC_BLKINIT 64
#define HWCAP_SPARC_N2 128 #define HWCAP_SPARC_N2 128
#define CORE_DUMP_USE_REGSET
/* /*
* These are used to set parameters in the core dumps. * These are used to set parameters in the core dumps.
*/ */
...@@ -78,10 +80,6 @@ ...@@ -78,10 +80,6 @@
#define ELF_CLASS ELFCLASS64 #define ELF_CLASS ELFCLASS64
#define ELF_DATA ELFDATA2MSB #define ELF_DATA ELFDATA2MSB
typedef unsigned long elf_greg_t;
#define ELF_NGREG 36
typedef elf_greg_t elf_gregset_t[ELF_NGREG];
/* Format of 64-bit elf_gregset_t is: /* Format of 64-bit elf_gregset_t is:
* G0 --> G7 * G0 --> G7
* O0 --> O7 * O0 --> O7
...@@ -92,24 +90,9 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG]; ...@@ -92,24 +90,9 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG];
* TNPC * TNPC
* Y * Y
*/ */
#define ELF_CORE_COPY_REGS(__elf_regs, __pt_regs) \ typedef unsigned long elf_greg_t;
do { unsigned long *dest = &(__elf_regs[0]); \ #define ELF_NGREG 36
struct pt_regs *src = (__pt_regs); \ typedef elf_greg_t elf_gregset_t[ELF_NGREG];
unsigned long __user *sp; \
int i; \
for(i = 0; i < 16; i++) \
dest[i] = src->u_regs[i]; \
/* Don't try this at home kids... */ \
sp = (unsigned long __user *) \
((src->u_regs[14] + STACK_BIAS) \
& 0xfffffffffffffff8UL); \
for(i = 0; i < 16; i++) \
__get_user(dest[i+16], &sp[i]); \
dest[32] = src->tstate; \
dest[33] = src->tpc; \
dest[34] = src->tnpc; \
dest[35] = src->y; \
} while (0);
typedef struct { typedef struct {
unsigned long pr_regs[32]; unsigned long pr_regs[32];
...@@ -119,9 +102,6 @@ typedef struct { ...@@ -119,9 +102,6 @@ typedef struct {
} elf_fpregset_t; } elf_fpregset_t;
#endif #endif
#define ELF_CORE_COPY_TASK_REGS(__tsk, __elf_regs) \
({ ELF_CORE_COPY_REGS((*(__elf_regs)), task_pt_regs(__tsk)); 1; })
/* /*
* This is used to ensure we don't load something for the wrong architecture. * This is used to ensure we don't load something for the wrong architecture.
*/ */
......
...@@ -95,8 +95,6 @@ struct sparc_trapf { ...@@ -95,8 +95,6 @@ struct sparc_trapf {
#ifdef __KERNEL__ #ifdef __KERNEL__
#define __ARCH_SYS_PTRACE 1
#define force_successful_syscall_return() \ #define force_successful_syscall_return() \
do { current_thread_info()->syscall_noerror = 1; \ do { current_thread_info()->syscall_noerror = 1; \
} while (0) } while (0)
...@@ -261,8 +259,6 @@ extern void show_regs(struct pt_regs *); ...@@ -261,8 +259,6 @@ extern void show_regs(struct pt_regs *);
#define SF_XXARG 0x5c #define SF_XXARG 0x5c
/* Stuff for the ptrace system call */ /* Stuff for the ptrace system call */
#define PTRACE_SUNATTACH 10
#define PTRACE_SUNDETACH 11
#define PTRACE_GETREGS 12 #define PTRACE_GETREGS 12
#define PTRACE_SETREGS 13 #define PTRACE_SETREGS 13
#define PTRACE_GETFPREGS 14 #define PTRACE_GETFPREGS 14
...@@ -284,18 +280,4 @@ extern void show_regs(struct pt_regs *); ...@@ -284,18 +280,4 @@ extern void show_regs(struct pt_regs *);
#define PTRACE_GETFPREGS64 25 #define PTRACE_GETFPREGS64 25
#define PTRACE_SETFPREGS64 26 #define PTRACE_SETFPREGS64 26
#define PTRACE_GETUCODE 29 /* stupid bsd-ism */
/* These are for 32-bit processes debugging 64-bit ones.
* Here addr and addr2 are passed in %g2 and %g3 respectively.
*/
#define PTRACE_PEEKTEXT64 (30 + PTRACE_PEEKTEXT)
#define PTRACE_POKETEXT64 (30 + PTRACE_POKETEXT)
#define PTRACE_PEEKDATA64 (30 + PTRACE_PEEKDATA)
#define PTRACE_POKEDATA64 (30 + PTRACE_POKEDATA)
#define PTRACE_READDATA64 (30 + PTRACE_READDATA)
#define PTRACE_WRITEDATA64 (30 + PTRACE_WRITEDATA)
#define PTRACE_READTEXT64 (30 + PTRACE_READTEXT)
#define PTRACE_WRITETEXT64 (30 + PTRACE_WRITETEXT)
#endif /* !(_SPARC64_PTRACE_H) */ #endif /* !(_SPARC64_PTRACE_H) */
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