procfs_regs.c (331722) | procfs_regs.c (341491) |
---|---|
1/*- 2 * Copyright (c) 1993 Jan-Simon Pendry 3 * Copyright (c) 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Jan-Simon Pendry. 8 * --- 20 unchanged lines hidden (view full) --- 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)procfs_regs.c 8.4 (Berkeley) 6/15/94 34 * 35 * From: 36 * $Id: procfs_regs.c,v 3.2 1993/12/15 09:40:17 jsp Exp $ | 1/*- 2 * Copyright (c) 1993 Jan-Simon Pendry 3 * Copyright (c) 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Jan-Simon Pendry. 8 * --- 20 unchanged lines hidden (view full) --- 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)procfs_regs.c 8.4 (Berkeley) 6/15/94 34 * 35 * From: 36 * $Id: procfs_regs.c,v 3.2 1993/12/15 09:40:17 jsp Exp $ |
37 * $FreeBSD: stable/11/sys/fs/procfs/procfs_regs.c 331722 2018-03-29 02:50:57Z eadler $ | 37 * $FreeBSD: stable/11/sys/fs/procfs/procfs_regs.c 341491 2018-12-04 19:07:10Z markj $ |
38 */ 39 40#include "opt_compat.h" 41 42#include <sys/param.h> 43#include <sys/systm.h> 44#include <sys/lock.h> 45#include <sys/mutex.h> --- 51 unchanged lines hidden (view full) --- 97 PROC_UNLOCK(p); 98 return (EPERM); 99 } 100 if (!P_SHOULDSTOP(p)) { 101 PROC_UNLOCK(p); 102 return (EBUSY); 103 } 104 | 38 */ 39 40#include "opt_compat.h" 41 42#include <sys/param.h> 43#include <sys/systm.h> 44#include <sys/lock.h> 45#include <sys/mutex.h> --- 51 unchanged lines hidden (view full) --- 97 PROC_UNLOCK(p); 98 return (EPERM); 99 } 100 if (!P_SHOULDSTOP(p)) { 101 PROC_UNLOCK(p); 102 return (EBUSY); 103 } 104 |
105 /* XXXKSE: */ | |
106 td2 = FIRST_THREAD_IN_PROC(p); 107#ifdef COMPAT_FREEBSD32 108 if (SV_CURPROC_FLAG(SV_ILP32)) { 109 if ((SV_PROC_FLAG(td2->td_proc, SV_ILP32)) == 0) { 110 PROC_UNLOCK(p); 111 return (EINVAL); 112 } 113 wrap32 = 1; | 105 td2 = FIRST_THREAD_IN_PROC(p); 106#ifdef COMPAT_FREEBSD32 107 if (SV_CURPROC_FLAG(SV_ILP32)) { 108 if ((SV_PROC_FLAG(td2->td_proc, SV_ILP32)) == 0) { 109 PROC_UNLOCK(p); 110 return (EINVAL); 111 } 112 wrap32 = 1; |
114 } | 113 memset(&r32, 0, sizeof(r32)); 114 } else |
115#endif | 115#endif |
116 memset(&r, 0, sizeof(r)); |
|
116 error = PROC(read, regs, td2, &r); 117 if (error == 0) { 118 PROC_UNLOCK(p); 119 error = UIOMOVE_FROMBUF(r, uio); 120 PROC_LOCK(p); 121 } 122 if (error == 0 && uio->uio_rw == UIO_WRITE) { 123 if (!P_SHOULDSTOP(p)) 124 error = EBUSY; 125 else 126 /* XXXKSE: */ 127 error = PROC(write, regs, td2, &r); 128 } 129 PROC_UNLOCK(p); 130 131 return (error); 132} | 117 error = PROC(read, regs, 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)) 125 error = EBUSY; 126 else 127 /* XXXKSE: */ 128 error = PROC(write, regs, td2, &r); 129 } 130 PROC_UNLOCK(p); 131 132 return (error); 133} |