|
|
1.1.1.2 root 1: /*
1.1 root 2: * Mach Operating System
3: * Copyright (c) 1991,1990,1989 Carnegie Mellon University
4: * All Rights Reserved.
1.1.1.2 root 5: *
1.1 root 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.
1.1.1.2 root 11: *
1.1 root 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.
1.1.1.2 root 15: *
1.1 root 16: * Carnegie Mellon requests users of this software to return to
1.1.1.2 root 17: *
1.1 root 18: * Software Distribution Coordinator or [email protected]
19: * School of Computer Science
20: * Carnegie Mellon University
21: * Pittsburgh PA 15213-3890
1.1.1.2 root 22: *
1.1 root 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: */
1.1.1.4 ! root 49: #if 0
! 50: /* XXX: Currently, existence_count is not used. I guess it
! 51: could be useful to get rid of the map if the count drops to
! 52: zero. */
1.1 root 53: int existence_count;/* Number of bits turned on in
54: * existence_map.
55: */
1.1.1.4 ! root 56: #endif
1.1 root 57: } *vm_external_t;
58:
59: #define VM_EXTERNAL_NULL ((vm_external_t) 0)
60:
61: #define VM_EXTERNAL_SMALL_SIZE 128
62: #define VM_EXTERNAL_LARGE_SIZE 8192
63:
64: /*
65: * The states that may be recorded for a page of external storage.
66: */
67:
68: typedef int vm_external_state_t;
69: #define VM_EXTERNAL_STATE_EXISTS 1
70: #define VM_EXTERNAL_STATE_UNKNOWN 2
71: #define VM_EXTERNAL_STATE_ABSENT 3
72:
73:
74: /*
75: * Routines exported by this module.
76: */
77:
1.1.1.3 root 78: /* Initialize the module */
79: extern void vm_external_module_initialize(void);
80: /* Create a vm_external_t */
81: extern vm_external_t vm_external_create(vm_offset_t);
82: /* Destroy one */
83: extern void vm_external_destroy(vm_external_t);
1.1 root 84:
1.1.1.3 root 85: /* Set state of a page. */
86: extern void vm_external_state_set(vm_external_t, vm_offset_t,
87: vm_external_state_t);
88: /* Retrieve the state for a given page, if known. */
1.1 root 89: #define vm_external_state_get(e,offset) (((e) != VM_EXTERNAL_NULL) ? \
90: _vm_external_state_get(e, offset) : \
91: VM_EXTERNAL_STATE_UNKNOWN)
1.1.1.3 root 92: /* HIDDEN routine */
93: extern vm_external_state_t _vm_external_state_get(vm_external_t, vm_offset_t);
1.1 root 94:
1.1.1.2 root 95: #endif /* _VM_VM_EXTERNAL_H_ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.