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

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