xref: /netbsd-src/sys/miscfs/procfs/procfs_regs.c (revision 168cd830d22e1f4a4c2bde1105f9f94d40fb870d)
1*168cd830Schristos /*	$NetBSD: procfs_regs.c,v 1.23 2006/11/16 01:33:38 christos Exp $	*/
2aad01611Sagc 
3aad01611Sagc /*
4aad01611Sagc  * Copyright (c) 1993
5aad01611Sagc  *	The Regents of the University of California.  All rights reserved.
6aad01611Sagc  *
7aad01611Sagc  * This code is derived from software contributed to Berkeley by
8aad01611Sagc  * Jan-Simon Pendry.
9aad01611Sagc  *
10aad01611Sagc  * Redistribution and use in source and binary forms, with or without
11aad01611Sagc  * modification, are permitted provided that the following conditions
12aad01611Sagc  * are met:
13aad01611Sagc  * 1. Redistributions of source code must retain the above copyright
14aad01611Sagc  *    notice, this list of conditions and the following disclaimer.
15aad01611Sagc  * 2. Redistributions in binary form must reproduce the above copyright
16aad01611Sagc  *    notice, this list of conditions and the following disclaimer in the
17aad01611Sagc  *    documentation and/or other materials provided with the distribution.
18aad01611Sagc  * 3. Neither the name of the University nor the names of its contributors
19aad01611Sagc  *    may be used to endorse or promote products derived from this software
20aad01611Sagc  *    without specific prior written permission.
21aad01611Sagc  *
22aad01611Sagc  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23aad01611Sagc  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24aad01611Sagc  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25aad01611Sagc  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26aad01611Sagc  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27aad01611Sagc  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28aad01611Sagc  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29aad01611Sagc  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30aad01611Sagc  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31aad01611Sagc  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32aad01611Sagc  * SUCH DAMAGE.
33aad01611Sagc  *
34aad01611Sagc  *	@(#)procfs_regs.c	8.4 (Berkeley) 6/15/94
35aad01611Sagc  */
36cf92afd6Scgd 
37699e3be9Scgd /*
38699e3be9Scgd  * Copyright (c) 1993 Jan-Simon Pendry
39699e3be9Scgd  *
40699e3be9Scgd  * This code is derived from software contributed to Berkeley by
41699e3be9Scgd  * Jan-Simon Pendry.
42699e3be9Scgd  *
43699e3be9Scgd  * Redistribution and use in source and binary forms, with or without
44699e3be9Scgd  * modification, are permitted provided that the following conditions
45699e3be9Scgd  * are met:
46699e3be9Scgd  * 1. Redistributions of source code must retain the above copyright
47699e3be9Scgd  *    notice, this list of conditions and the following disclaimer.
48699e3be9Scgd  * 2. Redistributions in binary form must reproduce the above copyright
49699e3be9Scgd  *    notice, this list of conditions and the following disclaimer in the
50699e3be9Scgd  *    documentation and/or other materials provided with the distribution.
51699e3be9Scgd  * 3. All advertising materials mentioning features or use of this software
52699e3be9Scgd  *    must display the following acknowledgement:
53699e3be9Scgd  *	This product includes software developed by the University of
54699e3be9Scgd  *	California, Berkeley and its contributors.
55699e3be9Scgd  * 4. Neither the name of the University nor the names of its contributors
56699e3be9Scgd  *    may be used to endorse or promote products derived from this software
57699e3be9Scgd  *    without specific prior written permission.
58699e3be9Scgd  *
59699e3be9Scgd  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
60699e3be9Scgd  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
61699e3be9Scgd  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
62699e3be9Scgd  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
63699e3be9Scgd  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
64699e3be9Scgd  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
65699e3be9Scgd  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
66699e3be9Scgd  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
67699e3be9Scgd  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
68699e3be9Scgd  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
69699e3be9Scgd  * SUCH DAMAGE.
70699e3be9Scgd  *
71cf92afd6Scgd  *	@(#)procfs_regs.c	8.4 (Berkeley) 6/15/94
72699e3be9Scgd  */
73699e3be9Scgd 
74e4b00f43Slukem #include <sys/cdefs.h>
75*168cd830Schristos __KERNEL_RCSID(0, "$NetBSD: procfs_regs.c,v 1.23 2006/11/16 01:33:38 christos Exp $");
76e4b00f43Slukem 
77699e3be9Scgd #include <sys/param.h>
78699e3be9Scgd #include <sys/proc.h>
79699e3be9Scgd #include <sys/vnode.h>
80f1f51aa2Sthorpej #include <sys/ptrace.h>
81f1f51aa2Sthorpej 
82699e3be9Scgd #include <miscfs/procfs/procfs.h>
83699e3be9Scgd 
84cde1d475Smycroft int
procfs_doregs(struct lwp * curl,struct lwp * l,struct pfsnode * pfs,struct uio * uio)854d595fd7Schristos procfs_doregs(
864d595fd7Schristos     struct lwp *curl,		/* tracer */
874d595fd7Schristos     struct lwp *l,		/* traced */
88*168cd830Schristos     struct pfsnode *pfs,
894d595fd7Schristos     struct uio *uio
904d595fd7Schristos )
91699e3be9Scgd {
92699e3be9Scgd 
9395e1ffb1Schristos 	return (process_doregs(curl, l, uio));
9489a86e61Scgd }
9589a86e61Scgd 
96656b05ccScgd int
procfs_validregs(struct lwp * l,struct mount * mp)97*168cd830Schristos procfs_validregs(struct lwp *l, struct mount *mp)
9889a86e61Scgd {
9989a86e61Scgd 
10095e1ffb1Schristos 	return (process_validregs(l));
101656b05ccScgd }
102