xref: /original-bsd/sys/sys/user.h (revision e2c1afbf)
1 /*
2  * Copyright (c) 1982, 1986, 1989, 1991, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)user.h	8.2 (Berkeley) 09/23/93
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/sysctl.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 	struct	md_coredump u_md;	/* machine dependent glop */
44 };
45 
46 /*
47  * Redefinitions to make the debuggers happy for now...  This subterfuge
48  * brought to you by coredump() and trace_req().  These fields are *only*
49  * valid at those times!
50  */
51 #define	U_ar0	u_kproc.kp_proc.p_md.md_regs /* copy of curproc->p_md.md_regs */
52 #define	U_tsize	u_kproc.kp_eproc.e_vm.vm_tsize
53 #define	U_dsize	u_kproc.kp_eproc.e_vm.vm_dsize
54 #define	U_ssize	u_kproc.kp_eproc.e_vm.vm_ssize
55 #define	U_sig	u_sigacts.ps_sig
56 #define	U_code	u_sigacts.ps_code
57 
58 #ifndef KERNEL
59 #define	u_ar0	U_ar0
60 #define	u_tsize	U_tsize
61 #define	u_dsize	U_dsize
62 #define	u_ssize	U_ssize
63 #define	u_sig	U_sig
64 #define	u_code	U_code
65 #endif /* KERNEL */
66