1: /*
   2:  * One structure allocated per active
   3:  * process. It contains all data needed
   4:  * about the process while the
   5:  * process may be swapped out.
   6:  * Other per process data (user.h)
   7:  * is swapped with the process.
   8:  */
   9: struct  proc {
  10:     char    p_stat;
  11:     char    p_pri;      /* priority, negative is high */
  12: #ifndef MENLO_JCL
  13:     char    p_flag;
  14: #else
  15:     short   p_flag;
  16: #endif
  17:     char    p_time;     /* resident time for scheduling */
  18:     char    p_cpu;      /* cpu usage for scheduling */
  19:     char    p_nice;     /* nice for cpu usage */
  20: #ifdef  UCB_METER
  21:     char    p_slptime;  /* secs sleeping */
  22:                 /* there is room for a char here */
  23: #endif
  24: #ifdef  MENLO_JCL
  25:     char    p_cursig;
  26:     long    p_sig;      /* signals pending to this process */
  27:     long    p_siga0;    /* low bit of 2 bit signal action */
  28:     long    p_siga1;    /* high bit of 2 bit signal action */
  29: #define p_ignsig    p_siga0 /* ignored signal mask */
  30: #else
  31:     short   p_sig;      /* signals pending to this process */
  32: #endif
  33: #if defined(MENLO_JCL) || defined(VIRUS_VFORK)
  34:     struct  proc    *p_pptr;/* pointer to parent's process structure */
  35: #endif
  36:     short   p_uid;      /* user id, used to direct tty signals */
  37:     short   p_pgrp;     /* name of process group leader */
  38:     short   p_pid;      /* unique process id */
  39:     short   p_ppid;     /* process id of parent */
  40:         /*
  41: 		 * union (supercedes xproc)
  42: 		 * to replace part with times
  43: 		 * to be passed to parent process
  44: 		 * in ZOMBIE state.
  45: 		 */
  46:     union {
  47:         struct {
  48: #ifdef  VIRUS_VFORK
  49:         memaddr P_addr;     /* address of u. area */
  50:         memaddr P_daddr;    /* address of data area */
  51:         memaddr P_saddr;    /* address of stack area */
  52:         size_t  P_dsize;    /* size of data area (clicks) */
  53:         size_t  P_ssize;    /* size of stack segment (clicks) */
  54: #else
  55:         memaddr P_addr;     /* address of swappable image */
  56:         size_t  P_size;     /* size of swappable image (clicks) */
  57: #endif
  58:         caddr_t P_wchan;    /* event process is awaiting */
  59:         struct  text    *P_textp;/* pointer to text structure */
  60:         struct  proc    *P_link;/* linked list of running processes */
  61:         short   P_clktim;   /* time to alarm clock signal */
  62:         } p_p;
  63: #define p_addr      p_un.p_p.P_addr
  64: #ifdef  VIRUS_VFORK
  65: #define p_daddr     p_un.p_p.P_daddr
  66: #define p_saddr     p_un.p_p.P_saddr
  67: #define p_dsize     p_un.p_p.P_dsize
  68: #define p_ssize     p_un.p_p.P_ssize
  69: #else
  70: #define p_size      p_un.p_p.P_size
  71: #endif
  72: #define p_wchan     p_un.p_p.P_wchan
  73: #define p_textp     p_un.p_p.P_textp
  74: #define p_link      p_un.p_p.P_link
  75: #define p_clktim    p_un.p_p.P_clktim
  76:         struct {
  77:         short   Xp_xstat;   /* Exit status for wait */
  78:         time_t  Xp_utime;   /* user time, this proc */
  79:         time_t  Xp_stime;   /* system time, this proc */
  80: #ifdef  UCB_LOGIN
  81:         short   Xp_login;   /* login flag */
  82: #endif
  83:         } p_xp;
  84: #define xp_xstat    p_xp.Xp_xstat
  85: #define xp_utime    p_xp.Xp_utime
  86: #define xp_stime    p_xp.Xp_stime
  87: #ifdef  UCB_LOGIN
  88: #define xp_login    p_xp.Xp_login
  89: #endif
  90:     } p_un;
  91: };
  92: 
  93: #ifdef  KERNEL
  94: extern struct proc proc[];  /* the proc table itself */
  95: #endif
  96: 
  97: /* stat codes */
  98: #define SSLEEP  1       /* awaiting an event */
  99: #define SWAIT   2       /* (abandoned state) */
 100: #define SRUN    3       /* running */
 101: #define SIDL    4       /* intermediate state in process creation */
 102: #define SZOMB   5       /* intermediate state in process termination */
 103: #define SSTOP   6       /* process being traced */
 104: 
 105: /* flag codes */
 106: #define SLOAD   01      /* in core */
 107: #define SSYS    02      /* scheduling process */
 108: #define SLOCK   04      /* process cannot be swapped */
 109: #define SSWAP   010     /* process is being swapped out */
 110: #define STRC    020     /* process is being traced */
 111: #define SWTED   040     /* another tracing flag */
 112: #define SULOCK  0100        /* user settable lock in core */
 113: #ifdef  MENLO_JCL
 114: #define SDETACH 0200        /* detached inherited by init */
 115: #define SNUSIG  0400        /* using new signal mechanism */
 116: #endif
 117: #ifdef  VIRUS_VFORK
 118: #define SVFORK  01000       /* child in vfork, using parent's data */
 119: #define SVFPARENT 02000     /* parent in vfork, waiting for child */
 120: #define SVFDONE 04000       /* parent has relesed child in vfork */
 121: #endif
 122: #ifdef  UCB_NET
 123: #define SSEL    010000      /* selecting, cleared if rescan needed */
 124: #define STIMO   020000      /* timing out during sleep */
 125: #endif
 126: 
 127: #ifdef  VIRUS_VFORK
 128: /* arguments to expand() to expand specified segment */
 129: #define S_DATA  0
 130: #define S_STACK 1
 131: #endif

Defined struct's

proc defined in line 9; used 194 times

Defined macros

SIDL defined in line 101; used 3 times
SLOAD defined in line 106; used 26 times
SRUN defined in line 100; used 21 times
SSEL defined in line 123; used 6 times
SSWAP defined in line 109; used 7 times
SSYS defined in line 107; used 2 times
STIMO defined in line 124; used 5 times
STRC defined in line 110; used 23 times
SVFDONE defined in line 120; used 3 times
SVFPARENT defined in line 119; used 4 times
SWAIT defined in line 99; never used
SWTED defined in line 111; used 5 times
S_DATA defined in line 129; used 5 times
p_dsize defined in line 67; used 27 times
p_ignsig defined in line 29; used 2 times
p_link defined in line 74; used 21 times
p_ssize defined in line 68; used 29 times
xp_login defined in line 88; used 1 times
xp_stime defined in line 86; used 2 times
xp_utime defined in line 85; used 2 times
xp_xstat defined in line 84; used 3 times

Usage of this include

Last modified: 1983-08-28
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1584
Valid CSS Valid XHTML 1.0 Strict