xref: /original-bsd/sys/sys/user.h (revision 381fb7ab)
1 /*
2  * Copyright (c) 1982, 1986, 1989, 1991 Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)user.h	7.20 (Berkeley) 02/05/92
8  */
9 
10 #include <machine/pcb.h>
11 #ifndef KERNEL
12 /* stuff that *used* to be included by user.h, or is now needed */
13 #include <errno.h>
14 #include <sys/time.h>
15 #include <sys/resource.h>
16 #include <sys/ucred.h>
17 #include <sys/uio.h>
18 #endif
19 #include <sys/resourcevar.h>
20 #include <sys/signalvar.h>
21 #include <vm/vm.h>		/* XXX */
22 #include <sys/kinfo_proc.h>
23 
24 
25 /*
26  * Per process structure containing data that isn't needed in core
27  * when the process isn't running (esp. when swapped out).
28  * This structure may or may not be at the same kernel address
29  * in all processes.
30  */
31 
32 struct	user {
33 	struct	pcb u_pcb;
34 
35 	struct	sigacts u_sigacts;	/* p_sigacts points here (use it!) */
36 	struct	pstats u_stats;		/* p_stats points here (use it!) */
37 
38 	/*
39 	 * Remaining fields only for core dump and/or ptrace--
40 	 * not valid at other times!
41 	 */
42 	struct	kinfo_proc u_kproc;	/* proc + eproc */
43 };
44 
45 /*
46  * Redefinitions to make the debuggers happy for now...
47  * This subterfuge brought to you by coredump() and procxmt().
48  * These fields are *only* valid at those times!
49  */
50 #define	U_ar0	u_kproc.kp_proc.p_md.md_regs /* copy of curproc->p_md.md_regs */
51 #define	U_tsize	u_kproc.kp_eproc.e_vm.vm_tsize
52 #define	U_dsize	u_kproc.kp_eproc.e_vm.vm_dsize
53 #define	U_ssize	u_kproc.kp_eproc.e_vm.vm_ssize
54 #define	U_sig	u_sigacts.ps_sig
55 #define	U_code	u_sigacts.ps_code
56 
57 #ifndef KERNEL
58 #define	u_ar0	U_ar0
59 #define	u_tsize	U_tsize
60 #define	u_dsize	U_dsize
61 #define	u_ssize	U_ssize
62 #define	u_sig	U_sig
63 #define	u_code	U_code
64 #endif /* KERNEL */
65