|
|
1.1 ! root 1: /* ! 2: * Mach Operating System ! 3: * Copyright (c) 1991,1990,1989,1988,1987 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: * File: mach/memory_object.defs ! 28: * ! 29: * Abstract: ! 30: * Basic Mach external memory management interface declaration. ! 31: */ ! 32: ! 33: subsystem ! 34: #if KERNEL_USER ! 35: KernelUser ! 36: #endif /* KERNEL_USER */ ! 37: #if KERNEL_SERVER ! 38: KernelServer ! 39: #endif /* KERNEL_SERVER */ ! 40: memory_object 2200; ! 41: ! 42: #ifdef KERNEL ! 43: #include <norma_vm.h> ! 44: #if NORMA_VM ! 45: userprefix k_; ! 46: #endif /* NORMA_VM */ ! 47: #endif /* KERNEL */ ! 48: ! 49: #include <mach/std_types.defs> ! 50: #include <mach/mach_types.defs> ! 51: ! 52: #if SEQNOS ! 53: serverprefix seqnos_; ! 54: serverdemux seqnos_memory_object_server; ! 55: #endif /* SEQNOS */ ! 56: ! 57: /* ! 58: * Initialize the specified memory object, providing ! 59: * a reqeust port on which control calls can be made, and ! 60: * a name port that identifies this object to callers of ! 61: * vm_regions. ! 62: * [To allow the mapping of this object to be used, the ! 63: * memory manager must call memory_object_set_attributes, ! 64: * specifying the "ready" parameter as TRUE. To reject ! 65: * all mappings of this object, the memory manager may ! 66: * use memory_object_destroy.] ! 67: */ ! 68: simpleroutine memory_object_init( ! 69: memory_object : memory_object_t; ! 70: #if SEQNOS ! 71: msgseqno seqno : mach_port_seqno_t; ! 72: #endif /* SEQNOS */ ! 73: memory_control : memory_object_control_t = ! 74: MACH_MSG_TYPE_MAKE_SEND ! 75: ctype: mach_port_t; ! 76: memory_object_name : memory_object_name_t = ! 77: MACH_MSG_TYPE_MAKE_SEND ! 78: ctype: mach_port_t; ! 79: memory_object_page_size : vm_size_t); ! 80: ! 81: /* ! 82: * Indicates that the specified memory object is no longer ! 83: * mapped (or cached -- see memory_object_set_attributes), ! 84: * and that further mappings will cause another memory_object_init ! 85: * call to be made. No further calls will be made on ! 86: * the memory object by this kernel. ! 87: * ! 88: * [All rights to the control and name ports are included ! 89: * in this call. The memory manager should use port_deallocate ! 90: * to release them once they are no longer needed.] ! 91: */ ! 92: simpleroutine memory_object_terminate( ! 93: memory_object : memory_object_t = ! 94: MACH_MSG_TYPE_MOVE_SEND ! 95: ctype: mach_port_t; ! 96: #if SEQNOS ! 97: msgseqno seqno : mach_port_seqno_t; ! 98: #endif /* SEQNOS */ ! 99: memory_control : memory_object_control_t = ! 100: MACH_MSG_TYPE_MOVE_RECEIVE ! 101: ctype: mach_port_t ! 102: #if KERNEL_USER ! 103: /* for compatibility with Mach 2.5 kernels */ ! 104: , dealloc ! 105: #endif /* KERNEL_USER */ ! 106: ; ! 107: memory_object_name : memory_object_name_t = ! 108: MACH_MSG_TYPE_MOVE_RECEIVE ! 109: ctype: mach_port_t ! 110: #if KERNEL_USER ! 111: /* for compatibility with Mach 2.5 kernels */ ! 112: , dealloc ! 113: #endif /* KERNEL_USER */ ! 114: ); ! 115: ! 116: /* ! 117: * Indicates that a copy has been made of the specified range of ! 118: * the given original memory object. The kernel will use the new ! 119: * memory object, control and name ports to refer to the new copy ! 120: * (once the memory manager has asserted its "ready" attribute). ! 121: * ! 122: * Cached pages from the original memory object at the time of ! 123: * the copy operation are handled as follows: ! 124: * Readable pages may be silently copied to the new ! 125: * memory object (with all access permissions). ! 126: * Pages not copied are locked to prevent write access. ! 127: * ! 128: * This call includes only the new memory object itself; a ! 129: * memory_object_init call will be made on the new memory ! 130: * object after the actions above are completed. ! 131: * ! 132: * The new memory object is *temporary*, meaning that the ! 133: * memory manager should not change its contents or allow ! 134: * the memory object to be mapped in another client. The ! 135: * memory manager may use the memory_object_data_unavailable ! 136: * call to indicate that the appropriate page of the original ! 137: * memory object may be used to fulfill a data request. ! 138: * ! 139: * [Reply should be memory_object_set_attributes on the ! 140: * new memory object control port to indicate readiness.] ! 141: */ ! 142: simpleroutine memory_object_copy( ! 143: old_memory_object : memory_object_t; ! 144: #if SEQNOS ! 145: msgseqno seqno : mach_port_seqno_t; ! 146: #endif /* SEQNOS */ ! 147: old_memory_control : memory_object_control_t = ! 148: MACH_MSG_TYPE_MAKE_SEND ! 149: ctype: mach_port_t; ! 150: offset : vm_offset_t; ! 151: length : vm_size_t; ! 152: new_memory_object : memory_object_t = ! 153: MACH_MSG_TYPE_MOVE_RECEIVE ! 154: ctype: mach_port_t ! 155: #if KERNEL_USER ! 156: /* for compatibility with Mach 2.5 kernels */ ! 157: , dealloc ! 158: #endif /* KERNEL_USER */ ! 159: ); ! 160: ! 161: /* ! 162: * Request data from this memory object. At least ! 163: * the specified data should be returned with at ! 164: * least the specified access permitted. ! 165: * ! 166: * [Reply should be memory_object_data_provided.] ! 167: */ ! 168: simpleroutine memory_object_data_request( ! 169: memory_object : memory_object_t; ! 170: #if SEQNOS ! 171: msgseqno seqno : mach_port_seqno_t; ! 172: #endif /* SEQNOS */ ! 173: memory_control : memory_object_control_t = ! 174: MACH_MSG_TYPE_MAKE_SEND ! 175: ctype: mach_port_t; ! 176: offset : vm_offset_t; ! 177: length : vm_size_t; ! 178: desired_access : vm_prot_t); ! 179: ! 180: /* ! 181: * Request that the specified portion of this ! 182: * memory object be unlocked to allow the specified ! 183: * forms of access; the kernel already has the data. ! 184: * ! 185: * [Reply should be memory_object_lock_request.] ! 186: */ ! 187: simpleroutine memory_object_data_unlock( ! 188: memory_object : memory_object_t; ! 189: #if SEQNOS ! 190: msgseqno seqno : mach_port_seqno_t; ! 191: #endif /* SEQNOS */ ! 192: memory_control : memory_object_control_t = ! 193: MACH_MSG_TYPE_MAKE_SEND ! 194: ctype: mach_port_t; ! 195: offset : vm_offset_t; ! 196: length : vm_size_t; ! 197: desired_access : vm_prot_t); ! 198: ! 199: /* ! 200: * Write back modifications made to this portion of ! 201: * the memory object while in memory. ! 202: * ! 203: * Unless explicitly requested by a memory_object_lock_request ! 204: * (clean, but not flush), the kernel will not retain ! 205: * the data. ! 206: * ! 207: * [Reply should be vm_deallocate to release the data.] ! 208: */ ! 209: simpleroutine memory_object_data_write( ! 210: memory_object : memory_object_t; ! 211: #if SEQNOS ! 212: msgseqno seqno : mach_port_seqno_t; ! 213: #endif /* SEQNOS */ ! 214: memory_control : memory_object_control_t = ! 215: MACH_MSG_TYPE_MAKE_SEND ! 216: ctype: mach_port_t; ! 217: offset : vm_offset_t; ! 218: data : pointer_t); ! 219: ! 220: /* ! 221: * Indicate that a previous memory_object_lock_reqeust has been ! 222: * completed. Note that this call is made on whatever ! 223: * port is specified in the memory_object_lock_request; that port ! 224: * need not be the memory object port itself. ! 225: * ! 226: * [No reply expected.] ! 227: */ ! 228: simpleroutine memory_object_lock_completed( ! 229: memory_object : memory_object_t = ! 230: polymorphic|MACH_MSG_TYPE_PORT_SEND_ONCE ! 231: ctype: mach_port_t; ! 232: #if SEQNOS ! 233: msgseqno seqno : mach_port_seqno_t; ! 234: #endif /* SEQNOS */ ! 235: memory_control : memory_object_control_t = ! 236: MACH_MSG_TYPE_MAKE_SEND ! 237: ctype: mach_port_t; ! 238: offset : vm_offset_t; ! 239: length : vm_size_t); ! 240: ! 241: /* ! 242: * Indicate that a previous memory_object_data_supply has been ! 243: * completed. Note that this call is made on whatever ! 244: * port is specified in the memory_object_data_supply; that port ! 245: * need not be the memory object port itself. ! 246: * ! 247: * The result parameter indicates what happened during the supply. ! 248: * If it is not KERN_SUCCESS, then error_offset identifies the ! 249: * first offset at which a problem occurred. The pagein operation ! 250: * stopped at this point. Note that the only failures reported ! 251: * by this mechanism are KERN_MEMORY_PRESENT. All other failures ! 252: * (invalid argument, error on pagein of supplied data in manager's ! 253: * address space) cause the entire operation to fail. ! 254: * ! 255: * XXX Check what actually happens in latter case! ! 256: * ! 257: * [No reply expected.] ! 258: */ ! 259: simpleroutine memory_object_supply_completed( ! 260: memory_object : memory_object_t = ! 261: polymorphic|MACH_MSG_TYPE_PORT_SEND_ONCE ! 262: ctype: mach_port_t; ! 263: #if SEQNOS ! 264: msgseqno seqno : mach_port_seqno_t; ! 265: #endif /* SEQNOS */ ! 266: memory_control : memory_object_control_t = ! 267: MACH_MSG_TYPE_MAKE_SEND ! 268: ctype: mach_port_t; ! 269: offset : vm_offset_t; ! 270: length : vm_size_t; ! 271: result : kern_return_t; ! 272: error_offset : vm_offset_t); ! 273: ! 274: /* ! 275: * Return data to manager. This call is used in place of data_write ! 276: * for objects initialized by object_ready instead of set_attributes. ! 277: * This call indicates whether the returned data is dirty and whether ! 278: * the kernel kept a copy. Precious data remains precious if the ! 279: * kernel keeps a copy. The indication that the kernel kept a copy ! 280: * is only a hint if the data is not precious; the cleaned copy may ! 281: * be discarded without further notifying the manager. ! 282: * ! 283: * [Reply should be vm_deallocate to release the data.] ! 284: */ ! 285: simpleroutine memory_object_data_return( ! 286: memory_object : memory_object_t; ! 287: #if SEQNOS ! 288: msgseqno seqno : mach_port_seqno_t; ! 289: #endif /* SEQNOS */ ! 290: memory_control : memory_object_control_t = ! 291: MACH_MSG_TYPE_MAKE_SEND ! 292: ctype: mach_port_t; ! 293: offset : vm_offset_t; ! 294: data : pointer_t; ! 295: dirty : boolean_t; ! 296: kernel_copy : boolean_t); ! 297: ! 298: /* ! 299: * XXX Warning: This routine does NOT contain a memory_object_control_t ! 300: * XXX because the memory_object_change_attributes call may cause ! 301: * XXX memory object termination (by uncaching the object). This would ! 302: * XXX yield an invalid port. ! 303: */ ! 304: ! 305: simpleroutine memory_object_change_completed( ! 306: memory_object : memory_object_t = ! 307: polymorphic|MACH_MSG_TYPE_PORT_SEND_ONCE ! 308: ctype: mach_port_t; ! 309: #if SEQNOS ! 310: msgseqno seqno : mach_port_seqno_t; ! 311: #endif /* SEQNOS */ ! 312: may_cache : boolean_t; ! 313: copy_strategy : memory_object_copy_strategy_t);
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.