Deleted Added
full compact
procfs_regs.c (85297) procfs_regs.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_regs.c 8.4 (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_regs.c 8.4 (Berkeley) 6/15/94
38 *
39 * From:
40 * $FreeBSD: head/sys/fs/procfs/procfs_regs.c 85297 2001-10-21 23:57:24Z des $
40 * $FreeBSD: head/sys/fs/procfs/procfs_regs.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 <vm/vm.h>
54#include <vm/vm_extern.h>
55
53#include <fs/pseudofs/pseudofs.h>
56#include <fs/procfs/procfs.h>
57
58int
54#include <fs/procfs/procfs.h>
55
56int
59procfs_doregs(curp, p, pfs, uio)
60 struct proc *curp;
61 struct proc *p;
62 struct pfsnode *pfs;
63 struct uio *uio;
57procfs_doprocregs(PFS_FILL_ARGS)
64{
65 int error;
66 struct reg r;
67 char *kv;
68 int kl;
69
58{
59 int error;
60 struct reg r;
61 char *kv;
62 int kl;
63
70 if (p_candebug(curp, p))
64 if (p_candebug(td->td_proc, p))
71 return EPERM;
72 kl = sizeof(r);
73 kv = (char *) &r;
74
75 kv += uio->uio_offset;
76 kl -= uio->uio_offset;
77 if (kl > uio->uio_resid)
78 kl = uio->uio_resid;

--- 12 unchanged lines hidden (view full) ---

91 else
92 error = proc_write_regs(&p->p_thread, &r); /* XXXKSE */
93 }
94 PRELE(p);
95
96 uio->uio_offset = 0;
97 return (error);
98}
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_regs(&p->p_thread, &r); /* XXXKSE */
87 }
88 PRELE(p);
89
90 uio->uio_offset = 0;
91 return (error);
92}
99
100int
101procfs_validregs(struct thread *td)
102{
103
104 return ((td->td_proc->p_flag & P_SYSTEM) == 0);
105}