procfs_dbregs.c (331722) | procfs_dbregs.c (341491) |
---|---|
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: stable/11/sys/fs/procfs/procfs_dbregs.c 331722 2018-03-29 02:50:57Z eadler $ | 43 * $FreeBSD: stable/11/sys/fs/procfs/procfs_dbregs.c 341491 2018-12-04 19:07:10Z markj $ |
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> --- 55 unchanged lines hidden (view full) --- 107 td2 = FIRST_THREAD_IN_PROC(p); 108#ifdef COMPAT_FREEBSD32 109 if (SV_CURPROC_FLAG(SV_ILP32)) { 110 if (SV_PROC_FLAG(td2->td_proc, SV_ILP32) == 0) { 111 PROC_UNLOCK(p); 112 return (EINVAL); 113 } 114 wrap32 = 1; | 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> --- 55 unchanged lines hidden (view full) --- 107 td2 = FIRST_THREAD_IN_PROC(p); 108#ifdef COMPAT_FREEBSD32 109 if (SV_CURPROC_FLAG(SV_ILP32)) { 110 if (SV_PROC_FLAG(td2->td_proc, SV_ILP32) == 0) { 111 PROC_UNLOCK(p); 112 return (EINVAL); 113 } 114 wrap32 = 1; |
115 } | 115 memset(&r32, 0, sizeof(r32)); 116 } else |
116#endif | 117#endif |
118 memset(&r, 0, sizeof(r)); |
|
117 error = PROC(read, dbregs, td2, &r); 118 if (error == 0) { 119 PROC_UNLOCK(p); 120 error = UIOMOVE_FROMBUF(r, uio); 121 PROC_LOCK(p); 122 } 123 if (error == 0 && uio->uio_rw == UIO_WRITE) { 124 if (!P_SHOULDSTOP(p)) /* XXXKSE should be P_TRACED? */ 125 error = EBUSY; 126 else 127 /* XXXKSE: */ 128 error = PROC(write, dbregs, td2, &r); 129 } 130 PROC_UNLOCK(p); 131 132 return (error); 133} | 119 error = PROC(read, dbregs, td2, &r); 120 if (error == 0) { 121 PROC_UNLOCK(p); 122 error = UIOMOVE_FROMBUF(r, uio); 123 PROC_LOCK(p); 124 } 125 if (error == 0 && uio->uio_rw == UIO_WRITE) { 126 if (!P_SHOULDSTOP(p)) /* XXXKSE should be P_TRACED? */ 127 error = EBUSY; 128 else 129 /* XXXKSE: */ 130 error = PROC(write, dbregs, td2, &r); 131 } 132 PROC_UNLOCK(p); 133 134 return (error); 135} |