proc.h: Add PHOLD()/PRELE() macros to ensure the U area is not swapped
while doing ptrace/procfs in it. ptrace.h: uncomment PT_ATTACH/PT_DETACH, I am committing code to do this.
This commit is contained in:
parent
1f8d3d7485
commit
bf5bfe45ab
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=13606
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)proc.h 8.8 (Berkeley) 1/21/94
|
||||
* $Id: proc.h,v 1.17 1995/03/16 18:16:22 bde Exp $
|
||||
* $Id: proc.h,v 1.18 1995/07/13 08:48:03 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef _SYS_PROC_H_
|
||||
@ -234,6 +234,13 @@ struct pcred {
|
||||
FREE(s, M_SESSION); \
|
||||
}
|
||||
|
||||
/* hold process U-area in memory, normally for ptrace/procfs work */
|
||||
#define PHOLD(p) { \
|
||||
if ((p)->p_lock++ == 0 && ((p)->p_flag & P_INMEM) == 0) \
|
||||
faultin(p); \
|
||||
}
|
||||
#define PRELE(p) (--(p)->p_lock)
|
||||
|
||||
extern struct proc *pidhash[]; /* In param.c. */
|
||||
extern struct pgrp *pgrphash[]; /* In param.c. */
|
||||
extern struct proc *curproc; /* Current running proc. */
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)ptrace.h 8.2 (Berkeley) 1/4/94
|
||||
* $Id: ptrace.h,v 1.3 1994/08/08 13:00:27 davidg Exp $
|
||||
* $Id: ptrace.h,v 1.4 1995/03/16 18:16:23 bde Exp $
|
||||
*/
|
||||
|
||||
#ifndef _SYS_PTRACE_H_
|
||||
@ -48,10 +48,8 @@
|
||||
#define PT_KILL 8 /* kill the child process */
|
||||
#define PT_STEP 9 /* single step the child */
|
||||
|
||||
#ifdef notdef
|
||||
#define PT_ATTACH 10 /* trace some running process */
|
||||
#define PT_DETACH 11 /* stop tracing a process */
|
||||
#endif
|
||||
|
||||
#define PT_FIRSTMACH 32 /* for machine-specific requests */
|
||||
#include <machine/ptrace.h> /* machine-specific requests, if any */
|
||||
|
Loading…
Reference in New Issue
Block a user