home *** CD-ROM | disk | FTP | other *** search
- /*
- * $Header: /ax/networking:include/sys/text.h:networking 1.1 $
- * $Source: /ax/networking:include/sys/text.h: $
- *
- * Copyright (c) 1988 Acorn Computers Ltd., Cambridge, England
- *
- * $Log: text.h,v $
- * Revision 1.1 95/01/11 10:19:57 kwelton
- * Initial revision
- *
- * Revision 1.7 88/11/01 18:07:14 brian
- * Comments improved; no code changes.
- *
- * Revision 1.6 88/10/26 11:07:10 brian
- * Struct text now has field `x_liblevel' (replacing `x_type').
- *
- * Revision 1.5 88/10/25 13:20:07 brian
- * Text structure altered to support shared libraries.
- *
- * Revision 1.4 88/08/11 15:58:51 keith
- * Addition of XUNSQUEEZE flag for QMAGIC images.
- *
- * Revision 1.3 88/06/17 20:21:46 beta
- * Acorn Unix initial beta version
- *
- */
- /* @(#)text.h 1.5 87/06/30 3.2/4.3NFSSRC */
- /*
- * Copyright (c) 1982, 1986 Regents of the University of California.
- * All rights reserved. The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
- *
- * @(#)text.h 7.1 (Berkeley) 6/4/86
- */
-
- /*
- * Text structure.
- * One allocated per program image and per shared library.
- * Manipulated by vm_text.c
- */
- #define NXDAD 12 /* param.h:MAXTSIZ / vmparam.h:DMTEXT */
-
- struct text
- {
- struct text *x_forw; /* forward link in free list */
- struct text **x_back; /* backward link in free list */
- swblk_t x_daddr[NXDAD]; /* disk addresses of dmtext-page segments */
- swblk_t x_ptdaddr; /* disk address of page table */
- short x_size; /* size (pages) */
- short x_offset; /* offset (pages) in process text segment */
- struct proc *x_caddr; /* ptr to linked proc, if loaded */
- struct vnode *x_vptr; /* vnode of prototype */
- short x_rssize;
- short x_swrss;
- short x_count; /* reference count. For main program texts */
- /* this is the number of processes sharing */
- /* this text. For libraries, it is the */
- /* number of references from other text */
- /* structs (through x_shlptr). */
- short x_ccount; /* number of loaded references (not used */
- /* for shared library texts). */
- u_char x_flag; /* traced, written flags */
- char x_slptime;
- u_char x_poip; /* page out in progress count */
- u_char x_liblevel; /* level of shared library: 0 for most */
- /* deeply nested. Main text is always given */
- /* level MAXSHLIBS. */
- struct text *x_shlptr; /* pointer to next shared library segment */
- };
-
- #ifdef KERNEL
- #ifdef DYNALLOC
- struct text *text, *textNTEXT;
- #else DYNALLOC
- struct text stat_text[NTEXT], *text, *textNTEXT;
- #endif DYNALLOC
- int ntext;
- #endif
-
- #define XTRC 0x01 /* Text may be written, exclusive use */
- #define XWRIT 0x02 /* Text written into, must swap out */
- #define XLOAD 0x04 /* Currently being read from file */
- #define XLOCK 0x08 /* Being swapped in or out */
- #define XWANT 0x10 /* Wanted for swapping */
- #define XPAGV 0x20 /* Page in on demand from vnode */
- #define XUNUSED 0x40 /* unused since swapped out for cache */
- #define XUNSQUEEZE 0x80 /* Text needs unsqueezing after paging in */
-
- /*
- * Text table statistics
- */
- struct xstats {
- u_long alloc; /* calls to xalloc */
- u_long alloc_inuse; /* found in use/sticky */
- u_long alloc_cachehit; /* found in cache */
- u_long alloc_cacheflush; /* flushed cached text */
- u_long alloc_unused; /* flushed unused cached text */
- u_long free; /* calls to xfree */
- u_long free_inuse; /* still in use/sticky */
- u_long free_cache; /* placed in cache */
- u_long free_cacheswap; /* swapped out to place in cache */
- };
-
- /* EOF text.h */
-