Annotation of 40BSD/sys/h/user.h, revision 1.1.1.1

1.1       root        1: /*     user.h  4.1     11/9/80 */
                      2: 
                      3: #ifdef KERNEL
                      4: #include "../h/pcb.h"
                      5: #include "../h/dmap.h"
                      6: #include "../h/vtimes.h"
                      7: #ifdef FASTVAX
                      8: asm(".set U_ARG,120");
                      9: asm(".set U_QSAV,140");
                     10: #endif
                     11: #else
                     12: #include <sys/pcb.h>
                     13: #include <sys/dmap.h>
                     14: #include <sys/vtimes.h>
                     15: #endif
                     16: /*
                     17:  * The user structure.
                     18:  * One allocated per process.
                     19:  * Contains all per process data
                     20:  * that doesn't need to be referenced
                     21:  * while the process is swapped.
                     22:  * The user block is UPAGES*NBPG bytes
                     23:  * long; resides at virtual user
                     24:  * loc 0x80000000-UPAGES*NBPG; contains the system
                     25:  * stack per user; is cross referenced
                     26:  * with the proc structure for the
                     27:  * same process.
                     28:  */
                     29:  
                     30: #define        EXCLOSE 01
                     31:  
                     32: struct user
                     33: {
                     34:        struct  pcb u_pcb;
                     35:        int     u_arg[5];               /* arguments to current system call */
                     36:        label_t u_qsav;                 /* for non-local gotos on interrupts */
                     37:        char    u_segflg;               /* 0:user D; 1:system; 2:user I */
                     38:        char    u_error;                /* return error code */
                     39:        short   u_uid;                  /* effective user id */
                     40:        short   u_gid;                  /* effective group id */
                     41:        short   u_ruid;                 /* real user id */
                     42:        short   u_rgid;                 /* real group id */
                     43:        struct  proc *u_procp;          /* pointer to proc structure */
                     44:        int     *u_ap;                  /* pointer to arglist */
                     45:        union {                         /* syscall return values */
                     46:                struct  {
                     47:                        int     R_val1;
                     48:                        int     R_val2;
                     49:                } u_rv;
                     50: #define        r_val1  u_rv.R_val1
                     51: #define        r_val2  u_rv.R_val2
                     52:                off_t   r_off;
                     53:                time_t  r_time;
                     54:        } u_r;
                     55:        caddr_t u_base;                 /* base address for IO */
                     56:        unsigned int u_count;           /* bytes remaining for IO */
                     57:        off_t   u_offset;               /* offset in file for IO */
                     58:        struct  inode *u_cdir;          /* pointer to inode of current directory */
                     59:        struct  inode *u_rdir;          /* root directory of current process */
                     60:        char    u_dbuf[DIRSIZ];         /* current pathname component */
                     61:        caddr_t u_dirp;                 /* pathname pointer */
                     62:        struct  direct u_dent;          /* current directory entry */
                     63:        struct  inode *u_pdir;          /* inode of parent directory of dirp */
                     64:        struct  file *u_ofile[NOFILE];  /* pointers to file structures of open files */
                     65:        char    u_pofile[NOFILE];       /* per-process flags of open files */
                     66:        label_t u_ssav;                 /* label variable for swapping */
                     67:        int     (*u_signal[NSIG])();    /* disposition of signals */
                     68:        int     u_cfcode;               /* ``code'' to trap when CM faulted */
                     69:        int     *u_ar0;                 /* address of users saved R0 */
                     70:        struct uprof {                  /* profile arguments */
                     71:                short   *pr_base;       /* buffer base */
                     72:                unsigned pr_size;       /* buffer size */
                     73:                unsigned pr_off;        /* pc offset */
                     74:                unsigned pr_scale;      /* pc scaling */
                     75:        } u_prof;
                     76:        char    u_eosys;                /* special action on end of syscall */
                     77:        char    u_sep;                  /* flag for I and D separation */
                     78:        struct  tty *u_ttyp;            /* controlling tty pointer */
                     79:        dev_t   u_ttyd;                 /* controlling tty dev */
                     80:        struct {                        /* header of executable file */
                     81:                int     ux_mag;         /* magic number */
                     82:                unsigned ux_tsize;      /* text size */
                     83:                unsigned ux_dsize;      /* data size */
                     84:                unsigned ux_bsize;      /* bss size */
                     85:                unsigned ux_ssize;      /* symbol table size */
                     86:                unsigned ux_entloc;     /* entry location */
                     87:                unsigned ux_unused;
                     88:                unsigned ux_relflg;
                     89:        } u_exdata;
                     90:        char    u_comm[DIRSIZ];
                     91:        time_t  u_start;
                     92:        char    u_acflag;
                     93:        short   u_fpflag;               /* unused now, will be later */
                     94:        short   u_cmask;                /* mask for file creation */
                     95:        size_t  u_tsize;                /* text size (clicks) */
                     96:        size_t  u_dsize;                /* data size (clicks) */
                     97:        size_t  u_ssize;                /* stack size (clicks) */
                     98:        struct  vtimes u_vm;            /* stats for this proc */
                     99:        struct  vtimes u_cvm;           /* sum of stats for reaped children */
                    100:        struct  dmap u_dmap;            /* disk map for data segment */
                    101:        struct  dmap u_smap;            /* disk map for stack segment */
                    102:        struct  dmap u_cdmap, u_csmap;  /* shadows of u_dmap, u_smap, for
                    103:                                           use of parent during fork */
                    104:        time_t  u_outime;               /* user time at last sample */
                    105:        size_t  u_odsize, u_ossize;     /* for (clumsy) expansion swaps */
                    106:        size_t  u_vrpages[NOFILE];      /* number vread pages hanging on fd */
                    107:        int     u_limit[8];             /* see <sys/limit.h> */
                    108:        int     u_stack[1];
                    109: 
                    110:                                        /*
                    111:                                         * kernel stack per user
                    112:                                         * extends from u + UPAGES*512
                    113:                                         * backward not to reach here
                    114:                                         */
                    115: };
                    116: 
                    117: /* u_eosys values */
                    118: #define        JUSTRETURN      0
                    119: #define        RESTARTSYS      1
                    120: #define        SIMULATERTI     2
                    121: 
                    122: /* u_error codes */
                    123: #include <errno.h>
                    124: 
                    125: #ifdef KERNEL
                    126: extern struct user u;
                    127: extern struct user swaputl;
                    128: extern struct user forkutl;
                    129: extern struct user xswaputl;
                    130: extern struct user xswap2utl;
                    131: extern struct user pushutl;
                    132: extern struct user vfutl;
                    133: #endif

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.