|
|
1.1 root 1: /*
2: * Copyright (c) 1982, 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: * @(#)text.h 7.1 (Berkeley) 6/4/86
7: */
8:
9: /*
10: * Text structure.
11: * One allocated per pure
12: * procedure on swap device.
13: * Manipulated by text.c
14: */
15: #define NXDAD 12 /* param.h:MAXTSIZ / vmparam.h:DMTEXT */
16:
17: struct text
18: {
19: struct text *x_forw; /* forward link in free list */
20: struct text **x_back; /* backward link in free list */
21: swblk_t x_daddr[NXDAD]; /* disk addresses of dmtext-page segments */
22: swblk_t x_ptdaddr; /* disk address of page table */
23: size_t x_size; /* size (clicks) */
24: struct proc *x_caddr; /* ptr to linked proc, if loaded */
25: struct inode *x_iptr; /* inode of prototype */
26: short x_rssize;
27: short x_swrss;
28: short x_count; /* reference count */
29: short x_ccount; /* number of loaded references */
30: char x_flag; /* traced, written flags */
31: char x_slptime;
32: short x_poip; /* page out in progress count */
33: };
34:
35: #ifdef KERNEL
36: struct text *text, *textNTEXT;
37: int ntext;
38: #endif
39:
40: #define XTRC 0x01 /* Text may be written, exclusive use */
41: #define XWRIT 0x02 /* Text written into, must swap out */
42: #define XLOAD 0x04 /* Currently being read from file */
43: #define XLOCK 0x08 /* Being swapped in or out */
44: #define XWANT 0x10 /* Wanted for swapping */
45: #define XPAGI 0x20 /* Page in on demand from inode */
46: #define XUNUSED 0x40 /* unused since swapped out for cache */
47:
48: /*
49: * Text table statistics
50: */
51: struct xstats {
52: u_long alloc; /* calls to xalloc */
53: u_long alloc_inuse; /* found in use/sticky */
54: u_long alloc_cachehit; /* found in cache */
55: u_long alloc_cacheflush; /* flushed cached text */
56: u_long alloc_unused; /* flushed unused cached text */
57: u_long free; /* calls to xfree */
58: u_long free_inuse; /* still in use/sticky */
59: u_long free_cache; /* placed in cache */
60: u_long free_cacheswap; /* swapped out to place in cache */
61: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.