1: /*
   2:  * Copyright (c) 1986 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  *
   6:  *	@(#)user.h	1.6 (2.11BSD) 1999/9/13
   7:  */
   8: 
   9: #ifdef KERNEL
  10: #include "../machine/fperr.h"
  11: #include "dir.h"
  12: #include "exec.h"
  13: #include "time.h"
  14: #include "resource.h"
  15: #else
  16: #include <machine/fperr.h>
  17: #include <sys/dir.h>
  18: #include <sys/exec.h>
  19: #include <sys/time.h>
  20: #include <sys/resource.h>
  21: #endif
  22: 
  23: /*
  24:  * data that doesn't need to be referenced while the process is swapped.
  25:  * The user block is USIZE*64 bytes long; resides at virtual kernel loc
  26:  * 0140000; contains the system stack (and possibly network stack) per
  27:  * user; is cross referenced with the proc structure for the same process.
  28:  */
  29: #define MAXCOMLEN   MAXNAMLEN   /* <= MAXNAMLEN, >= sizeof(ac_comm) */
  30: 
  31: struct  pcb {           /* fake pcb structure */
  32:     int (*pcb_sigc)();  /* pointer to trampoline code in user space */
  33: };
  34: 
  35: struct  fps {
  36:     short   u_fpsr;     /* FP status register */
  37:     double  u_fpregs[6];    /* FP registers */
  38: };
  39: 
  40: struct user {
  41:     struct  pcb u_pcb;
  42:     struct  fps u_fps;
  43:     short   u_fpsaved;      /* FP regs saved for this proc */
  44:     struct  fperr u_fperr;      /* floating point error save */
  45:     struct  proc *u_procp;      /* pointer to proc structure */
  46:     int *u_ar0;         /* address of users saved R0 */
  47:     char    u_comm[MAXCOMLEN + 1];
  48: 
  49: /* syscall parameters, results and catches */
  50:     int u_arg[6];       /* arguments to current system call */
  51:     int *u_ap;          /* pointer to arglist */
  52:     label_t u_qsave;        /* for non-local gotos on interrupts */
  53:     union {             /* syscall return values */
  54:         struct  {
  55:             int R_val1;
  56:             int R_val2;
  57:         } u_rv;
  58: #define r_val1  u_rv.R_val1
  59: #define r_val2  u_rv.R_val2
  60:         long    r_long;
  61:         off_t   r_off;
  62:         time_t  r_time;
  63:     } u_r;
  64:     char    u_error;        /* return error code */
  65:     char    u_dummy0;
  66: 
  67: /* 1.1 - processes and protection */
  68:     uid_t   u_uid;          /* effective user id */
  69:     uid_t   u_svuid;        /* saved user id */
  70:     uid_t   u_ruid;         /* real user id */
  71:     gid_t   u_svgid;        /* saved group id */
  72:     gid_t   u_rgid;         /* real group id */
  73:     gid_t   u_groups[NGROUPS];  /* groups, 0 terminated */
  74: 
  75: /* 1.2 - memory management */
  76:     size_t  u_tsize;        /* text size (clicks) */
  77:     size_t  u_dsize;        /* data size (clicks) */
  78:     size_t  u_ssize;        /* stack size (clicks) */
  79:     label_t u_ssave;        /* label variable for swapping */
  80:     label_t u_rsave;        /* save info when exchanging stacks */
  81:     short   u_uisa[16];     /* segmentation address prototypes */
  82:     short   u_uisd[16];     /* segmentation descriptor prototypes */
  83:     char    u_sep;          /* flag for I and D separation */
  84:     char    dummy1;         /* room for another char */
  85:                     /* overlay information */
  86:     struct  u_ovd {         /* automatic overlay data */
  87:         short   uo_curov;   /* current overlay */
  88:         short   uo_ovbase;  /* base of overlay area, seg. */
  89:         u_short uo_dbase;   /* start of data, clicks */
  90:         u_short uo_ov_offst[NOVL+1];    /* overlay offsets in text */
  91:         short   uo_nseg;    /* number of overlay seg. regs. */
  92:     } u_ovdata;
  93: 
  94: /* 1.3 - signal management */
  95:     int (*u_signal[NSIG])();    /* disposition of signals */
  96:     long    u_sigmask[NSIG];    /* signals to be blocked */
  97:     long    u_sigonstack;       /* signals to take on sigstack */
  98:     long    u_sigintr;      /* signals that interrupt syscalls */
  99:     long    u_oldmask;      /* saved mask from before sigpause */
 100:     int u_code;         /* ``code'' to trap */
 101:     char    dummy2;         /* Room for another flags byte */
 102:     char    u_psflags;      /* Process Signal flags */
 103:     struct  sigaltstack u_sigstk;   /* signal stack info */
 104: 
 105: /* 1.4 - descriptor management */
 106:     struct  file *u_ofile[NOFILE];  /* file structures for open files */
 107:     char    u_pofile[NOFILE];   /* per-process flags of open files */
 108:     int u_lastfile;     /* high-water mark of u_ofile */
 109: #define UF_EXCLOSE  0x1     /* auto-close on exec */
 110: #define UF_MAPPED   0x2     /* mapped from device */
 111:     struct  inode *u_cdir;      /* current directory */
 112:     struct  inode *u_rdir;      /* root directory of current process */
 113:     struct  tty *u_ttyp;        /* controlling tty pointer */
 114:     dev_t   u_ttyd;         /* controlling tty dev */
 115:     short   u_cmask;        /* mask for file creation */
 116: 
 117: /* 1.5 - timing and statistics */
 118:     struct  k_rusage u_ru;      /* stats for this proc */
 119:     struct  k_rusage u_cru;     /* sum of stats for reaped children */
 120:     struct  k_itimerval u_timer[2]; /* profile/virtual timers */
 121:     long    u_start;
 122:     char    u_acflag;
 123:     char    u_dupfd;        /* XXX - see kern_descrip.c/fdopen */
 124: 
 125:     struct uprof {          /* profile arguments */
 126:         short   *pr_base;   /* buffer base */
 127:         unsigned pr_size;   /* buffer size */
 128:         unsigned pr_off;    /* pc offset */
 129:         unsigned pr_scale;  /* pc scaling */
 130:     } u_prof;
 131: 
 132: /* 1.6 - resource controls */
 133:     struct  rlimit u_rlimit[RLIM_NLIMITS];
 134:     struct  quota *u_quota;     /* user's quota structure */
 135: 
 136: /* namei & co. */
 137:     struct  nameicache {        /* last successful directory search */
 138:         off_t nc_prevoffset;    /* offset at which last entry found */
 139:         ino_t nc_inumber;   /* inum of cached directory */
 140:         dev_t nc_dev;       /* dev of cached directory */
 141:     } u_ncache;
 142:     short   u_xxxx[2];      /* spare */
 143:     char    u_login[MAXLOGNAME];    /* setlogin/getlogin */
 144:     short   u_stack[1];     /* kernel stack per user
 145: 					 * extends from u + USIZE*64
 146: 					 * backward not to reach here
 147: 					 */
 148: };
 149: 
 150: #include <sys/errno.h>
 151: 
 152: #ifdef KERNEL
 153: extern  struct user u;
 154: #endif

Defined struct's

fps defined in line 35; used 8 times
nameicache defined in line 137; never used
pcb defined in line 31; used 2 times
  • in line 41(2)
u_ovd defined in line 86; used 2 times
uprof defined in line 125; used 2 times

Defined macros

MAXCOMLEN defined in line 29; used 8 times
UF_MAPPED defined in line 110; never used

Usage of this include

user.h used 108 times
Last modified: 1999-09-14
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 4014
Valid CSS Valid XHTML 1.0 Strict