home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / utilities / utilss / sockets / include / sys / h / text < prev    next >
Encoding:
Text File  |  1995-01-11  |  3.5 KB  |  105 lines

  1. /*
  2.  * $Header: /ax/networking:include/sys/text.h:networking  1.1  $
  3.  * $Source: /ax/networking:include/sys/text.h: $
  4.  *
  5.  * Copyright (c) 1988 Acorn Computers Ltd., Cambridge, England
  6.  *
  7.  * $Log:    text.h,v $
  8.  * Revision 1.1  95/01/11  10:19:57  kwelton
  9.  * Initial revision
  10.  * 
  11.  * Revision 1.7  88/11/01  18:07:14  brian
  12.  * Comments improved; no code changes.
  13.  * 
  14.  * Revision 1.6  88/10/26  11:07:10  brian
  15.  * Struct text now has field `x_liblevel' (replacing `x_type').
  16.  * 
  17.  * Revision 1.5  88/10/25  13:20:07  brian
  18.  * Text structure altered to support shared libraries.
  19.  * 
  20.  * Revision 1.4  88/08/11  15:58:51  keith
  21.  * Addition of XUNSQUEEZE flag for QMAGIC images.
  22.  * 
  23.  * Revision 1.3  88/06/17  20:21:46  beta
  24.  * Acorn Unix initial beta version
  25.  * 
  26.  */
  27. /* @(#)text.h    1.5 87/06/30 3.2/4.3NFSSRC */
  28. /*
  29.  * Copyright (c) 1982, 1986 Regents of the University of California.
  30.  * All rights reserved.  The Berkeley software License Agreement
  31.  * specifies the terms and conditions for redistribution.
  32.  *
  33.  *    @(#)text.h    7.1 (Berkeley) 6/4/86
  34.  */
  35.  
  36. /*
  37.  * Text structure.
  38.  * One allocated per program image and per shared library.
  39.  * Manipulated by vm_text.c
  40.  */
  41. #define    NXDAD    12        /* param.h:MAXTSIZ / vmparam.h:DMTEXT */
  42.  
  43. struct text
  44. {
  45.     struct    text *x_forw;    /* forward link in free list */
  46.     struct    text **x_back;    /* backward link in free list */
  47.     swblk_t    x_daddr[NXDAD];    /* disk addresses of dmtext-page segments */
  48.     swblk_t    x_ptdaddr;    /* disk address of page table */
  49.     short    x_size;        /* size (pages) */
  50.     short   x_offset;    /* offset (pages) in process text segment */
  51.     struct proc *x_caddr;    /* ptr to linked proc, if loaded */
  52.     struct vnode *x_vptr;    /* vnode of prototype */
  53.     short    x_rssize;
  54.     short    x_swrss;
  55.     short    x_count;    /* reference count. For main program texts */
  56.                 /* this is the number of processes sharing */
  57.                 /* this text. For libraries, it is the     */
  58.                 /* number of references from other text    */
  59.                 /* structs (through x_shlptr).             */
  60.     short    x_ccount;    /* number of loaded references (not used */
  61.                 /* for shared library texts).            */
  62.     u_char    x_flag;        /* traced, written flags */
  63.     char    x_slptime;
  64.     u_char    x_poip;        /* page out in progress count */
  65.     u_char    x_liblevel;    /* level of shared library: 0 for most      */
  66.                 /* deeply nested. Main text is always given */
  67.                 /* level MAXSHLIBS.                         */
  68.     struct text *x_shlptr;    /* pointer to next shared library segment */
  69. };
  70.  
  71. #ifdef    KERNEL
  72. #ifdef    DYNALLOC
  73. struct    text *text, *textNTEXT;
  74. #else    DYNALLOC
  75. struct    text stat_text[NTEXT], *text, *textNTEXT;
  76. #endif    DYNALLOC
  77. int    ntext;
  78. #endif
  79.  
  80. #define    XTRC    0x01        /* Text may be written, exclusive use */
  81. #define    XWRIT    0x02        /* Text written into, must swap out */
  82. #define    XLOAD    0x04        /* Currently being read from file */
  83. #define    XLOCK    0x08        /* Being swapped in or out */
  84. #define    XWANT    0x10        /* Wanted for swapping */
  85. #define    XPAGV    0x20        /* Page in on demand from vnode */
  86. #define    XUNUSED    0x40        /* unused since swapped out for cache */
  87. #define XUNSQUEEZE 0x80        /* Text needs unsqueezing after paging in */
  88.  
  89. /*
  90.  * Text table statistics
  91.  */
  92. struct xstats {
  93.     u_long    alloc;            /* calls to xalloc */
  94.     u_long    alloc_inuse;        /*    found in use/sticky */
  95.     u_long    alloc_cachehit;        /*    found in cache */
  96.     u_long    alloc_cacheflush;    /*    flushed cached text */
  97.     u_long    alloc_unused;        /*    flushed unused cached text */
  98.     u_long    free;            /* calls to xfree */
  99.     u_long    free_inuse;        /*    still in use/sticky */
  100.     u_long    free_cache;        /*    placed in cache */
  101.     u_long    free_cacheswap;        /*    swapped out to place in cache */
  102. };
  103.  
  104. /* EOF text.h */
  105.