procfs_dbregs.c (177091) | procfs_dbregs.c (189282) |
---|---|
1/*- 2 * Copyright (c) 1999 Brian Scott Dean, brdean@unx.sas.com. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Jan-Simon Pendry under the following copyrights and conditions: 7 * 8 * Copyright (c) 1993 Jan-Simon Pendry --- 26 unchanged lines hidden (view full) --- 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * SUCH DAMAGE. 38 * 39 * From: @(#)procfs_regs.c 8.4 (Berkeley) 6/15/94 40 * 41 * From: 42 * $Id: procfs_regs.c,v 3.2 1993/12/15 09:40:17 jsp Exp $ | 1/*- 2 * Copyright (c) 1999 Brian Scott Dean, brdean@unx.sas.com. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Jan-Simon Pendry under the following copyrights and conditions: 7 * 8 * Copyright (c) 1993 Jan-Simon Pendry --- 26 unchanged lines hidden (view full) --- 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * SUCH DAMAGE. 38 * 39 * From: @(#)procfs_regs.c 8.4 (Berkeley) 6/15/94 40 * 41 * From: 42 * $Id: procfs_regs.c,v 3.2 1993/12/15 09:40:17 jsp Exp $ |
43 * $FreeBSD: head/sys/fs/procfs/procfs_dbregs.c 177091 2008-03-12 10:12:01Z jeff $ | 43 * $FreeBSD: head/sys/fs/procfs/procfs_dbregs.c 189282 2009-03-02 18:43:50Z kib $ |
44 */ 45 46#include "opt_compat.h" 47 48#include <sys/param.h> 49#include <sys/systm.h> 50#include <sys/lock.h> 51#include <sys/mutex.h> 52#include <sys/proc.h> 53#include <sys/ptrace.h> | 44 */ 45 46#include "opt_compat.h" 47 48#include <sys/param.h> 49#include <sys/systm.h> 50#include <sys/lock.h> 51#include <sys/mutex.h> 52#include <sys/proc.h> 53#include <sys/ptrace.h> |
54#include <sys/sysent.h> |
|
54#include <sys/uio.h> 55 56#include <machine/reg.h> 57 58#include <fs/pseudofs/pseudofs.h> 59#include <fs/procfs/procfs.h> 60 61#ifdef COMPAT_IA32 62#include <sys/procfs.h> 63#include <machine/fpu.h> 64#include <compat/ia32/ia32_reg.h> 65 | 55#include <sys/uio.h> 56 57#include <machine/reg.h> 58 59#include <fs/pseudofs/pseudofs.h> 60#include <fs/procfs/procfs.h> 61 62#ifdef COMPAT_IA32 63#include <sys/procfs.h> 64#include <machine/fpu.h> 65#include <compat/ia32/ia32_reg.h> 66 |
66extern struct sysentvec ia32_freebsd_sysvec; | |
67/* 68 * PROC(write, dbregs, td2, &r) becomes 69 * proc_write_dbregs(td2, &r) or 70 * proc_write_dbregs32(td2, &r32) 71 * 72 * UIOMOVE_FROMBUF(r, uio) becomes 73 * uiomove_frombuf(&r, sizeof(r), uio) or 74 * uiomove_frombuf(&r32, sizeof(r32), uio) --- 27 unchanged lines hidden (view full) --- 102 KASSERT(p->p_lock > 0, ("proc not held")); 103 if (p_candebug(td, p) != 0) { 104 PROC_UNLOCK(p); 105 return (EPERM); 106 } 107 108 td2 = FIRST_THREAD_IN_PROC(p); 109#ifdef COMPAT_IA32 | 67/* 68 * PROC(write, dbregs, td2, &r) becomes 69 * proc_write_dbregs(td2, &r) or 70 * proc_write_dbregs32(td2, &r32) 71 * 72 * UIOMOVE_FROMBUF(r, uio) becomes 73 * uiomove_frombuf(&r, sizeof(r), uio) or 74 * uiomove_frombuf(&r32, sizeof(r32), uio) --- 27 unchanged lines hidden (view full) --- 102 KASSERT(p->p_lock > 0, ("proc not held")); 103 if (p_candebug(td, p) != 0) { 104 PROC_UNLOCK(p); 105 return (EPERM); 106 } 107 108 td2 = FIRST_THREAD_IN_PROC(p); 109#ifdef COMPAT_IA32 |
110 if (td->td_proc->p_sysent == &ia32_freebsd_sysvec) { 111 if (td2->td_proc->p_sysent != &ia32_freebsd_sysvec) { | 110 if (SV_CURPROC_FLAG(SV_ILP32)) { 111 if ((td2->td_proc->p_sysent->sv_flags & SV_ILP32) == 0) { |
112 PROC_UNLOCK(p); 113 return (EINVAL); 114 } 115 wrap32 = 1; 116 } 117#endif 118 error = PROC(read, dbregs, td2, &r); 119 if (error == 0) { --- 15 unchanged lines hidden --- | 112 PROC_UNLOCK(p); 113 return (EINVAL); 114 } 115 wrap32 = 1; 116 } 117#endif 118 error = PROC(read, dbregs, td2, &r); 119 if (error == 0) { --- 15 unchanged lines hidden --- |