diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-02-08 00:04:22 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-02-08 00:04:22 +0000 |
commit | a02783ea75d6b976caa9ce511e0338c622745aa8 (patch) | |
tree | d80d454b1578159bbdb054d91d7864d3ab496bea /sys | |
parent | 9af9f9c63736a116bd2919417bdef06365b1a4fe (diff) |
restored & repaired wcookie support; kettenis@chello.nl
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/sparc/include/ptrace.h | 6 | ||||
-rw-r--r-- | sys/arch/sparc/sparc/process_machdep.c | 9 | ||||
-rw-r--r-- | sys/kern/sys_process.c | 14 |
3 files changed, 26 insertions, 3 deletions
diff --git a/sys/arch/sparc/include/ptrace.h b/sys/arch/sparc/include/ptrace.h index 3928caf8c75..cc878120b64 100644 --- a/sys/arch/sparc/include/ptrace.h +++ b/sys/arch/sparc/include/ptrace.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ptrace.h,v 1.4 2003/06/02 23:27:54 millert Exp $ */ +/* $OpenBSD: ptrace.h,v 1.5 2004/02/08 00:04:20 deraadt Exp $ */ /* $NetBSD: ptrace.h,v 1.4 1994/11/20 20:53:27 deraadt Exp $ */ /* @@ -49,3 +49,7 @@ #define PT_GETFPREGS (PT_FIRSTMACH + 2) #define PT_SETFPREGS (PT_FIRSTMACH + 3) #define PT_WCOOKIE (PT_FIRSTMACH + 4) + +#ifdef _KERNEL +register_t process_get_wcookie(struct proc *p); +#endif diff --git a/sys/arch/sparc/sparc/process_machdep.c b/sys/arch/sparc/sparc/process_machdep.c index 7c1cb4e569d..a3b2e940c24 100644 --- a/sys/arch/sparc/sparc/process_machdep.c +++ b/sys/arch/sparc/sparc/process_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: process_machdep.c,v 1.6 2003/06/02 23:27:55 millert Exp $ */ +/* $OpenBSD: process_machdep.c,v 1.7 2004/02/08 00:04:21 deraadt Exp $ */ /* $NetBSD: process_machdep.c,v 1.6 1996/03/14 21:09:26 christos Exp $ */ /* @@ -140,4 +140,11 @@ process_write_fpregs(p, regs) return 0; } +register_t +process_get_wcookie(p) + struct proc *p; +{ + return p->p_addr->u_pcb.pcb_wcookie; +} + #endif /* PTRACE */ diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 7646bea1a26..37664becb7d 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_process.c,v 1.26 2003/08/15 20:32:18 tedu Exp $ */ +/* $OpenBSD: sys_process.c,v 1.27 2004/02/08 00:04:21 deraadt Exp $ */ /* $NetBSD: sys_process.c,v 1.55 1996/05/15 06:17:47 tls Exp $ */ /*- @@ -86,6 +86,9 @@ sys_ptrace(p, v, retval) struct uio uio; struct iovec iov; struct ptrace_io_desc piod; +#ifdef PT_WCOOKIE + register_t wcookie; +#endif int error, write; int temp; @@ -174,6 +177,9 @@ sys_ptrace(p, v, retval) #ifdef PT_SETFPREGS case PT_SETFPREGS: #endif +#ifdef PT_WCOOKIE + case PT_WCOOKIE: +#endif /* * You can't do what you want to the process if: * (1) It's not being traced at all, @@ -422,6 +428,12 @@ sys_ptrace(p, v, retval) return (procfs_dofpregs(p, t, NULL, &uio)); } #endif +#ifdef PT_WCOOKIE + case PT_WCOOKIE: + wcookie = process_get_wcookie (t); + return (copyout(&wcookie, SCARG(uap, addr), + sizeof (register_t))); +#endif } #ifdef DIAGNOSTIC |