# 2.11BSD#431 - /usr/src/sys/h/user.h

##### Macros

    MAXCOMLEN         X
    UF_EXCLOSE        X
    UF_MAPPED         X
    r_val1            X
    r_val2            X

##### struct's

    fps               X
    nameicache        X
    pcb               X
    u_ovd             X
    uprof             X
    user              X

       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

- in line 42(2)
- in /usr/src/bin/adb/print.c line 347-349(4)
- in /usr/src/bin/adb/runpcs.c line 293(2)

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

- in /usr/src/sys/sys/kern_exec.c line 435(2)

uprof defined in line 125; used 2 times

- in /usr/src/sys/sys/kern_clock.c line 323(2)

user defined in line 40; used 66 times

- in line 153(2)
- in /usr/src/bin/adb/defs.h line 78(2)
- in /usr/src/bin/adb/runpcs.c line 280(2), 291-293(4)
- in /usr/src/bin/ps.c line 49(2), 407(2)
- in /usr/src/libexec/identd/src/kernel/2.11bsd.c line 193(2), 200(2)
- in /usr/src/libexec/identd/src/kvm.c line 250(2), 256(2), 269(2), 290(2)
- in /usr/src/new/OLD/buildcore.c line 24(2)
- in /usr/src/new/crash/crash.c line 91-92(4)
- in /usr/src/sys/pdp/genassym.c line 46(2)
- in /usr/src/sys/sys/kern_sysctl.c line 978(2), 990-992(6), 1014(2)
- in /usr/src/ucb/PORT/systat/fetch.c line 61(2), 98(2)
- in /usr/src/ucb/PORT/systat/swap.c line 48(2)
- in /usr/src/ucb/w.c line 71(2)
- in /usr/src/usr.bin/fstat/fstat.c line 103(2), 239-240(4), 258(2), 278-279(4)
- in /usr/src/usr.sbin/pstat/pstat.c line 521(2)

#### Defined macros

MAXCOMLEN defined in line 29; used 8 times

- in line 47
- in /usr/src/bin/ps.c line 465
- in /usr/src/sys/sys/kern_exec.c line 56, 182-183(2), 374-376(2)
- in /usr/src/sys/sys/kern_sig.c line 624

UF_EXCLOSE defined in line 109; used 6 times

- in /usr/src/sys/sys/kern_descrip.c line 51, 74, 117
- in /usr/src/sys/sys/kern_exec.c line 350
- in /usr/src/sys/sys/sys_generic.c line 202-206(2)

UF_MAPPED defined in line 110; never used
r_val1 defined in line 58; used 47 times

- in /usr/src/sys/pdp/kern_pdp.c line 67, 103, 115
- in /usr/src/sys/pdp/trap.c line 349, 363
- in /usr/src/sys/sys/kern_descrip.c line 34, 66, 121, 129, 144, 278
- in /usr/src/sys/sys/kern_exit.c line 175
- in /usr/src/sys/sys/kern_fork.c line 74, 85
- in /usr/src/sys/sys/kern_prot.c line 24, 31, 48, 54, 61, 67, 74, 101
- in /usr/src/sys/sys/kern_resource.c line 69
- in /usr/src/sys/sys/kern_sysctl.c line 171
- in /usr/src/sys/sys/sys_generic.c line 170, 391-392(2)
- in /usr/src/sys/sys/sys_inode.c line 355
- in /usr/src/sys/sys/sys_net.c line 252
- in /usr/src/sys/sys/sys_pipe.c line 70, 78-79(2)
- in /usr/src/sys/sys/sys_process.c line 72
- in /usr/src/sys/sys/ufs_syscalls.c line 139, 162, 481
- in /usr/src/sys/sys/ufs_syscalls2.c line 114-116(2), 204
- in /usr/src/sys/sys/uipc_syscalls.c line 71, 161, 260, 270, 282, 430, 555
- in /usr/src/usr.sbin/pstat/pstat.c line 543

r_val2 defined in line 59; used 10 times

- in /usr/src/sys/pdp/kern_pdp.c line 116
- in /usr/src/sys/pdp/trap.c line 350, 364
- in /usr/src/sys/sys/kern_fork.c line 76, 91
- in /usr/src/sys/sys/kern_prot.c line 25, 55, 68
- in /usr/src/sys/sys/sys_pipe.c line 78
- in /usr/src/usr.sbin/pstat/pstat.c line 544

#### Usage of this include

user.h used 108 times

- in /usr/src/bin/adb/defs.h line 14
- in /usr/src/bin/ps.c line 26
- in /usr/src/libexec/identd/src/kernel/2.11bsd.c line 28
- in /usr/src/libexec/identd/src/kvm.c line 51, 57
- in /usr/src/new/OLD/buildcore.c line 14
- in /usr/src/new/crash/crash.c line 90
- in /usr/src/sys/conf/checksys.c line 15
- in /usr/src/sys/net/if.c line 21
- in /usr/src/sys/net/route.c line 20
- in /usr/src/sys/netinet/in.c line 22
- in /usr/src/sys/netinet/in_pcb.c line 17
- in /usr/src/sys/netinet/udp_usrreq.c line 16
- in /usr/src/sys/netns/idp_usrreq.c line 17
- in /usr/src/sys/netns/ns.c line 23
- in /usr/src/sys/netns/ns_pcb.c line 18
- in /usr/src/sys/netns/spp_usrreq.c line 18
- in /usr/src/sys/pdp/cons.c line 14
- in /usr/src/sys/pdp/genassym.c line 12
- in /usr/src/sys/pdp/kern_pdp.c line 13
- in /usr/src/sys/pdp/machdep.c line 14
- in /usr/src/sys/pdp/machdep2.c line 15
- in /usr/src/sys/pdp/mem.c line 11
- in /usr/src/sys/pdp/ram.c line 22
- in /usr/src/sys/pdp/trap.c line 18
- in /usr/src/sys/pdpuba/br.c line 45
- in /usr/src/sys/pdpuba/dh.c line 20
- in /usr/src/sys/pdpuba/dhu.c line 27
- in /usr/src/sys/pdpuba/dhv.c line 33
- in /usr/src/sys/pdpuba/dn.c line 13
- in /usr/src/sys/pdpuba/dr.c line 19
- in /usr/src/sys/pdpuba/dz.c line 18
- in /usr/src/sys/pdpuba/hk.c line 40
- in /usr/src/sys/pdpuba/ht.c line 19
- in /usr/src/sys/pdpuba/lp.c line 19
- in /usr/src/sys/pdpuba/rk.c line 20
- in /usr/src/sys/pdpuba/rl.c line 47
- in /usr/src/sys/pdpuba/tm.c line 19
- in /usr/src/sys/pdpuba/tmscp.c line 254
- in /usr/src/sys/pdpuba/ts.c line 19
- in /usr/src/sys/pdpuba/xp.c line 23
- in /usr/src/sys/sys/ingreslock.c line 14
- in /usr/src/sys/sys/init_main.c line 12
- in /usr/src/sys/sys/kern_acct.c line 17
- in /usr/src/sys/sys/kern_clock.c line 13
- in /usr/src/sys/sys/kern_descrip.c line 10
- in /usr/src/sys/sys/kern_exec.c line 15
- in /usr/src/sys/sys/kern_exit.c line 15
- in /usr/src/sys/sys/kern_fork.c line 15
- in /usr/src/sys/sys/kern_mman.c line 12
- in /usr/src/sys/sys/kern_proc.c line 10
- in /usr/src/sys/sys/kern_prot.c line 14
- in /usr/src/sys/sys/kern_prot2.c line 42
- in /usr/src/sys/sys/kern_resource.c line 10
- in /usr/src/sys/sys/kern_sig.c line 12
- in /usr/src/sys/sys/kern_sig2.c line 60
- in /usr/src/sys/sys/kern_subr.c line 13
- in /usr/src/sys/sys/kern_synch.c line 12
- in /usr/src/sys/sys/kern_sysctl.c line 44
- in /usr/src/sys/sys/kern_time.c line 10
- in /usr/src/sys/sys/kern_xxx.c line 10
- in /usr/src/sys/sys/quota_kern.c line 28
- in /usr/src/sys/sys/quota_subr.c line 17
- in /usr/src/sys/sys/quota_sys.c line 16
- in /usr/src/sys/sys/quota_ufs.c line 17
- in /usr/src/sys/sys/subr_log.c line 28
- in /usr/src/sys/sys/subr_prf.c line 10
- in /usr/src/sys/sys/subr_xxx.c line 10
- in /usr/src/sys/sys/sys_generic.c line 12
- in /usr/src/sys/sys/sys_inode.c line 12
- in /usr/src/sys/sys/sys_kern.c line 12
- in /usr/src/sys/sys/sys_net.c line 25
- in /usr/src/sys/sys/sys_pipe.c line 11
- in /usr/src/sys/sys/sys_process.c line 15
- in /usr/src/sys/sys/sys_socket.c line 18
- in /usr/src/sys/sys/tty.c line 10
- in /usr/src/sys/sys/tty_pty.c line 20
- in /usr/src/sys/sys/tty_tb.c line 18
- in /usr/src/sys/sys/tty_tty.c line 14
- in /usr/src/sys/sys/ufs_alloc.c line 16
- in /usr/src/sys/sys/ufs_bio.c line 11
- in /usr/src/sys/sys/ufs_bmap.c line 16
- in /usr/src/sys/sys/ufs_disksubr.c line 44
- in /usr/src/sys/sys/ufs_fio.c line 10
- in /usr/src/sys/sys/ufs_inode.c line 12
- in /usr/src/sys/sys/ufs_mount.c line 13
- in /usr/src/sys/sys/ufs_namei.c line 16
- in /usr/src/sys/sys/ufs_subr.c line 12
- in /usr/src/sys/sys/ufs_syscalls.c line 11
- in /usr/src/sys/sys/ufs_syscalls2.c line 11
- in /usr/src/sys/sys/uipc_mbuf.c line 11
- in /usr/src/sys/sys/uipc_socket.c line 17
- in /usr/src/sys/sys/uipc_socket2.c line 17
- in /usr/src/sys/sys/uipc_syscalls.c line 15
- in /usr/src/sys/sys/uipc_usrreq.c line 10
- in /usr/src/sys/sys/vfs_vnops.c line 43
- in /usr/src/sys/sys/vm_proc.c line 10
- in /usr/src/sys/sys/vm_sched.c line 10
- in /usr/src/sys/sys/vm_swap.c line 12
- in /usr/src/sys/sys/vm_swp.c line 12
- in /usr/src/sys/sys/vm_text.c line 13
- in /usr/src/ucb/PORT/systat/fetch.c line 13
- in /usr/src/ucb/PORT/systat/swap.c line 13
- in /usr/src/ucb/PORT/systat/vmstat.c line 24
- in /usr/src/ucb/gcore.c line 14
- in /usr/src/ucb/w.c line 18
- in /usr/src/usr.bin/fstat/fstat.c line 25
- in /usr/src/usr.sbin/pstat/pstat.c line 23

Last modified: 1999-09-14 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 852 |