BSD 4_3_Reno release
[unix-history] / usr / src / sys / sys / text.h
CommitLineData
95f51977 1/*
1c15e888
C
2 * Copyright (c) 1982, 1986, 1989 Regents of the University of California.
3 * All rights reserved.
95f51977 4 *
1c15e888
C
5 * Redistribution is only permitted until one year after the first shipment
6 * of 4.4BSD by the Regents. Otherwise, redistribution and use in source and
7 * binary forms are permitted provided that: (1) source distributions retain
8 * this entire copyright notice and comment, and (2) distributions including
9 * binaries display the following acknowledgement: This product includes
10 * software developed by the University of California, Berkeley and its
11 * contributors'' in the documentation or other materials provided with the
12 * distribution and in all advertising materials mentioning features or use
13 * of this software. Neither the name of the University nor the names of
14 * its contributors may be used to endorse or promote products derived from
15 * this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19 *
20 * @(#)text.h 7.7 (Berkeley) 6/28/90
95f51977 21 */
59703a43
C
22
23/*
24 * Text structure.
25 * One allocated per pure
26 * procedure on swap device.
27 * Manipulated by text.c
28 */
95f51977 29#define NXDAD 12 /* param.h:MAXTSIZ / vmparam.h:DMTEXT */
59703a43
C
30
31struct text
32{
95f51977
C
33 struct text *x_forw; /* forward link in free list */
34 struct text **x_back; /* backward link in free list */
35 swblk_t x_daddr[NXDAD]; /* disk addresses of dmtext-page segments */
59703a43 36 swblk_t x_ptdaddr; /* disk address of page table */
1c15e888 37 segsz_t x_size; /* size (clicks) */
59703a43 38 struct proc *x_caddr; /* ptr to linked proc, if loaded */
1c15e888
C
39 struct vnode *x_vptr; /* vnode of prototype */
40 time_t x_mtime; /* last time modified */
59703a43
C
41 short x_rssize;
42 short x_swrss;
95f51977
C
43 short x_count; /* reference count */
44 short x_ccount; /* number of loaded references */
59703a43
C
45 char x_flag; /* traced, written flags */
46 char x_slptime;
47 short x_poip; /* page out in progress count */
ca67e7b4
C
48#if defined(tahoe)
49 short x_ckey; /* code cache key */
50#endif
59703a43
C
51};
52
53#ifdef KERNEL
54struct text *text, *textNTEXT;
55int ntext;
56#endif
57
95f51977
C
58#define XTRC 0x01 /* Text may be written, exclusive use */
59#define XWRIT 0x02 /* Text written into, must swap out */
60#define XLOAD 0x04 /* Currently being read from file */
61#define XLOCK 0x08 /* Being swapped in or out */
62#define XWANT 0x10 /* Wanted for swapping */
1c15e888
C
63#define XPAGV 0x20 /* Page in on demand from vnode */
64#define XUNUSED 0x40 /* Unused since swapped out for cache */
65#define XCACHED 0x80 /* Cached but not sticky */
95f51977
C
66
67/*
68 * Text table statistics
69 */
70struct xstats {
71 u_long alloc; /* calls to xalloc */
72 u_long alloc_inuse; /* found in use/sticky */
73 u_long alloc_cachehit; /* found in cache */
74 u_long alloc_cacheflush; /* flushed cached text */
75 u_long alloc_unused; /* flushed unused cached text */
76 u_long free; /* calls to xfree */
77 u_long free_inuse; /* still in use/sticky */
78 u_long free_cache; /* placed in cache */
79 u_long free_cacheswap; /* swapped out to place in cache */
1c15e888 80 u_long purge; /* calls to xpurge */
95f51977 81};