procfs_fpregs.c (85297) | procfs_fpregs.c (87321) |
---|---|
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 * --- 23 unchanged lines hidden (view full) --- 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * 37 * @(#)procfs_fpregs.c 8.2 (Berkeley) 6/15/94 38 * 39 * From: | 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 * --- 23 unchanged lines hidden (view full) --- 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * 37 * @(#)procfs_fpregs.c 8.2 (Berkeley) 6/15/94 38 * 39 * From: |
40 * $FreeBSD: head/sys/fs/procfs/procfs_fpregs.c 85297 2001-10-21 23:57:24Z des $ | 40 * $FreeBSD: head/sys/fs/procfs/procfs_fpregs.c 87321 2001-12-04 01:35:06Z des $ |
41 */ 42 43#include <sys/param.h> 44#include <sys/systm.h> 45#include <sys/lock.h> 46#include <sys/mutex.h> 47#include <sys/proc.h> 48#include <sys/ptrace.h> | 41 */ 42 43#include <sys/param.h> 44#include <sys/systm.h> 45#include <sys/lock.h> 46#include <sys/mutex.h> 47#include <sys/proc.h> 48#include <sys/ptrace.h> |
49#include <sys/vnode.h> | 49#include <sys/uio.h> |
50 51#include <machine/reg.h> 52 | 50 51#include <machine/reg.h> 52 |
53#include <fs/pseudofs/pseudofs.h> |
|
53#include <fs/procfs/procfs.h> 54 | 54#include <fs/procfs/procfs.h> 55 |
55#include <vm/vm.h> 56 | |
57int | 56int |
58procfs_dofpregs(curp, p, pfs, uio) 59 struct proc *curp; 60 struct proc *p; 61 struct pfsnode *pfs; 62 struct uio *uio; | 57procfs_doprocfpregs(PFS_FILL_ARGS) |
63{ 64 int error; 65 struct fpreg r; 66 char *kv; 67 int kl; 68 | 58{ 59 int error; 60 struct fpreg r; 61 char *kv; 62 int kl; 63 |
69 if (p_candebug(curp, p)) | 64 if (p_candebug(td->td_proc, p)) |
70 return EPERM; 71 kl = sizeof(r); 72 kv = (char *) &r; 73 74 kv += uio->uio_offset; 75 kl -= uio->uio_offset; 76 if (kl > uio->uio_resid) 77 kl = uio->uio_resid; --- 12 unchanged lines hidden (view full) --- 90 else 91 error = proc_write_fpregs(&p->p_thread, &r); 92 } 93 PRELE(p); 94 95 uio->uio_offset = 0; 96 return (error); 97} | 65 return EPERM; 66 kl = sizeof(r); 67 kv = (char *) &r; 68 69 kv += uio->uio_offset; 70 kl -= uio->uio_offset; 71 if (kl > uio->uio_resid) 72 kl = uio->uio_resid; --- 12 unchanged lines hidden (view full) --- 85 else 86 error = proc_write_fpregs(&p->p_thread, &r); 87 } 88 PRELE(p); 89 90 uio->uio_offset = 0; 91 return (error); 92} |
98 99int 100procfs_validfpregs(struct thread *td) 101{ 102 103 return (( td->td_proc->p_flag & P_SYSTEM) == 0); 104} | |