|
|
1.1 root 1: /*
2: * Mach Operating System
3: * Copyright (c) 1991,1990,1989 Carnegie Mellon University
4: * All Rights Reserved.
5: *
6: * Permission to use, copy, modify and distribute this software and its
7: * documentation is hereby granted, provided that both the copyright
8: * notice and this permission notice appear in all copies of the
9: * software, derivative works or modified versions, and any portions
10: * thereof, and that both notices appear in supporting documentation.
11: *
12: * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13: * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14: * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15: *
16: * Carnegie Mellon requests users of this software to return to
17: *
18: * Software Distribution Coordinator or [email protected]
19: * School of Computer Science
20: * Carnegie Mellon University
21: * Pittsburgh PA 15213-3890
22: *
23: * any improvements or extensions that they make and grant Carnegie Mellon
24: * the rights to redistribute these changes.
25: */
26:
27: #ifndef _VM_VM_EXTERNAL_H_
28: #define _VM_VM_EXTERNAL_H_
29:
30: /*
31: * External page management hint technology
32: *
33: * The data structure exported by this module maintains
34: * a (potentially incomplete) map of the pages written
35: * to external storage for a range of virtual memory.
36: */
37:
38: /*
39: * The data structure representing the state of pages
40: * on external storage.
41: */
42:
43: typedef struct vm_external {
44: int existence_size; /* Size of the following bitmap */
45: char *existence_map; /* A bitmap of pages that have
46: * been written to backing
47: * storage.
48: */
49: int existence_count;/* Number of bits turned on in
50: * existence_map.
51: */
52: } *vm_external_t;
53:
54: #define VM_EXTERNAL_NULL ((vm_external_t) 0)
55:
56: #define VM_EXTERNAL_SMALL_SIZE 128
57: #define VM_EXTERNAL_LARGE_SIZE 8192
58:
59: /*
60: * The states that may be recorded for a page of external storage.
61: */
62:
63: typedef int vm_external_state_t;
64: #define VM_EXTERNAL_STATE_EXISTS 1
65: #define VM_EXTERNAL_STATE_UNKNOWN 2
66: #define VM_EXTERNAL_STATE_ABSENT 3
67:
68:
69: /*
70: * Routines exported by this module.
71: */
72:
73: extern void vm_external_module_initialize();
74: /* Initialize the module */
75:
76: extern vm_external_t vm_external_create(); /* Create a vm_external_t */
77: extern void vm_external_destroy(); /* Destroy one */
78:
79: extern void vm_external_state_set();/* Set state of a page. */
80: #define vm_external_state_get(e,offset) (((e) != VM_EXTERNAL_NULL) ? \
81: _vm_external_state_get(e, offset) : \
82: VM_EXTERNAL_STATE_UNKNOWN)
83: /* Retrieve the state
84: * for a given page, if known.
85: */
86: extern vm_external_state_t _vm_external_state_get();
87: /* HIDDEN routine */
88:
89: #endif /* _VM_VM_EXTERNAL_H_ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.