Annotation of Gnu-Mach/include/mach/memory_object.defs, revision 1.1.1.3

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

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.