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.18 (Berkeley) 04/20/91 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 27 * isn't needed in core when the process is swapped out. 28 */ 29 30 struct user { 31 struct pcb u_pcb; 32 label_t u_ssave; /* label variable for swapping XXX */ 33 34 struct sigacts u_sigacts; /* p_sigacts points here (use it!) */ 35 struct pstats u_stats; /* p_stats points here (use it!) */ 36 37 /* 38 * Remaining fields only for core dump and/or ptrace-- 39 * not valid at other times! 40 */ 41 struct kinfo_proc u_kproc; /* proc + eproc */ 42 }; 43 44 /* 45 * Redefinitions to make the debuggers happy for now... 46 * This subterfuge brought to you by coredump() and procxmt(). 47 * These fields are *only* valid at those times! 48 */ 49 #define U_ar0 u_kproc.kp_proc.p_regs /* copy of curproc->p_regs */ 50 #define U_tsize u_kproc.kp_eproc.e_vm.vm_tsize 51 #define U_dsize u_kproc.kp_eproc.e_vm.vm_dsize 52 #define U_ssize u_kproc.kp_eproc.e_vm.vm_ssize 53 #define U_sig u_sigacts.ps_sig 54 #define U_code u_sigacts.ps_code 55 56 #ifdef KERNEL 57 extern struct user u; 58 #else 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