Annotation of OSKit-Mach/include/mach/mach.defs, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Mach Operating System
                      3:  * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University.
                      4:  * Copyright (c) 1993,1994 The University of Utah and
                      5:  * the Computer Systems Laboratory (CSL).
                      6:  * All rights reserved.
                      7:  *
                      8:  * Permission to use, copy, modify and distribute this software and its
                      9:  * documentation is hereby granted, provided that both the copyright
                     10:  * notice and this permission notice appear in all copies of the
                     11:  * software, derivative works or modified versions, and any portions
                     12:  * thereof, and that both notices appear in supporting documentation.
                     13:  *
                     14:  * CARNEGIE MELLON, THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF
                     15:  * THIS SOFTWARE IN ITS "AS IS" CONDITION, AND DISCLAIM ANY LIABILITY
                     16:  * OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF
                     17:  * THIS SOFTWARE.
                     18:  *
                     19:  * Carnegie Mellon requests users of this software to return to
                     20:  *
                     21:  *  Software Distribution Coordinator  or  [email protected]
                     22:  *  School of Computer Science
                     23:  *  Carnegie Mellon University
                     24:  *  Pittsburgh PA 15213-3890
                     25:  *
                     26:  * any improvements or extensions that they make and grant Carnegie Mellon
                     27:  * the rights to redistribute these changes.
                     28:  */
                     29: /*
                     30:  *     Matchmaker definitions file for Mach kernel interface.
                     31:  */
                     32: 
                     33: #ifdef MACH_KERNEL
                     34: #include <mach_ipc_compat.h>
                     35: 
                     36: simport <kern/compat_xxx_defs.h>;      /* for obsolete routines */
                     37: #endif /* MACH_KERNEL */
                     38: 
                     39: subsystem
                     40: #if    KERNEL_USER
                     41:          KernelUser
                     42: #endif /* KERNEL_USER */
                     43: #if    KERNEL_SERVER
                     44:          KernelServer
                     45: #endif /* KERNEL_SERVER */
                     46:                       mach 2000;
                     47: 
                     48: #ifdef KERNEL_USER
                     49: userprefix r_;
                     50: #endif /* KERNEL_USER */
                     51: 
                     52: #include <mach/std_types.defs>
                     53: #include <mach/mach_types.defs>
                     54: 
                     55: skip;  /* old port_allocate */
                     56: skip;  /* old port_deallocate */
                     57: skip;  /* old port_enable */
                     58: skip;  /* old port_disable */
                     59: skip;  /* old port_select */
                     60: skip;  /* old port_set_backlog */
                     61: skip;  /* old port_status */
                     62: 
                     63: /*
                     64:  *     Create a new task with an empty set of IPC rights,
                     65:  *     and having an address space constructed from the
                     66:  *     target task (or empty, if inherit_memory is FALSE).
                     67:  */
                     68: routine task_create(
                     69:                target_task     : task_t;
                     70:                inherit_memory  : boolean_t;
                     71:        out     child_task      : task_t);
                     72: 
                     73: /*
                     74:  *     Destroy the target task, causing all of its threads
                     75:  *     to be destroyed, all of its IPC rights to be deallocated,
                     76:  *     and all of its address space to be deallocated.
                     77:  */
                     78: routine task_terminate(
                     79:                target_task     : task_t);
                     80: 
                     81: /*
                     82:  *     Get user-level handler entry points for all
                     83:  *     emulated system calls.
                     84:  */
                     85: routine task_get_emulation_vector(
                     86:                task            : task_t;
                     87:        out     vector_start    : int;
                     88:        out     emulation_vector: emulation_vector_t);
                     89: 
                     90: /*
                     91:  *     Establish user-level handlers for the specified
                     92:  *     system calls. Non-emulated system calls are specified
                     93:  *     with emulation_vector[i] == EML_ROUTINE_NULL.
                     94:  */
                     95: routine task_set_emulation_vector(
                     96:                task            : task_t;
                     97:                vector_start    : int;
                     98:                emulation_vector: emulation_vector_t);
                     99: 
                    100: 
                    101: /*
                    102:  *     Returns the set of threads belonging to the target task.
                    103:  */
                    104: routine task_threads(
                    105:                target_task     : task_t;
                    106:        out     thread_list     : thread_array_t);
                    107: 
                    108: /*
                    109:  *     Returns information about the target task.
                    110:  */
                    111: routine        task_info(
                    112:                target_task     : task_t;
                    113:                flavor          : int;
                    114:        out     task_info_out   : task_info_t, CountInOut);
                    115: 
                    116: 
                    117: skip;  /* old task_status */
                    118: skip;  /* old task_set_notify */
                    119: skip;  /* old thread_create */
                    120: 
                    121: /*
                    122:  *     Destroy the target thread.
                    123:  */
                    124: routine thread_terminate(
                    125:                target_thread   : thread_t);
                    126: 
                    127: /*
                    128:  *     Return the selected state information for the target
                    129:  *     thread.  If the thread is currently executing, the results
                    130:  *     may be stale.  [Flavor THREAD_STATE_FLAVOR_LIST provides a
                    131:  *     list of valid flavors for the target thread.]
                    132:  */
                    133: routine thread_get_state(
                    134:                target_thread   : thread_t;
                    135:                flavor          : int;
                    136:        out     old_state       : thread_state_t, CountInOut);
                    137: 
                    138: /*
                    139:  *     Set the selected state information for the target thread.
                    140:  *     If the thread is currently executing, the state change
                    141:  *     may be ill-defined.
                    142:  */
                    143: routine        thread_set_state(
                    144:                target_thread   : thread_t;
                    145:                flavor          : int;
                    146:                new_state       : thread_state_t);
                    147: 
                    148: /*
                    149:  *     Returns information about the target thread.
                    150:  */
                    151: routine        thread_info(
                    152:                target_thread   : thread_t;
                    153:                flavor          : int;
                    154:        out     thread_info_out : thread_info_t, CountInOut);
                    155: 
                    156: skip;  /* old thread_mutate */
                    157: 
                    158: /*
                    159:  *     Allocate zero-filled memory in the address space
                    160:  *     of the target task, either at the specified address,
                    161:  *     or wherever space can be found (if anywhere is TRUE),
                    162:  *     of the specified size.  The address at which the
                    163:  *     allocation actually took place is returned.
                    164:  */
                    165: #ifdef EMULATOR
                    166: skip;  /* the emulator redefines vm_allocate using vm_map */
                    167: #else  /* EMULATOR */
                    168: routine vm_allocate(
                    169:                target_task     : vm_task_t;
                    170:        inout   address         : vm_address_t;
                    171:                size            : vm_size_t;
                    172:                anywhere        : boolean_t);
                    173: #endif /* EMULATOR */
                    174: 
                    175: skip;  /* old vm_allocate_with_pager */
                    176: 
                    177: /*
                    178:  *     Deallocate the specified range from the virtual
                    179:  *     address space of the target task.
                    180:  */
                    181: routine vm_deallocate(
                    182:                target_task     : vm_task_t;
                    183:                address         : vm_address_t;
                    184:                size            : vm_size_t);
                    185: 
                    186: /*
                    187:  *     Set the current or maximum protection attribute
                    188:  *     for the specified range of the virtual address
                    189:  *     space of the target task.  The current protection
                    190:  *     limits the memory access rights of threads within
                    191:  *     the task; the maximum protection limits the accesses
                    192:  *     that may be given in the current protection.
                    193:  *     Protections are specified as a set of {read, write, execute}
                    194:  *     *permissions*.
                    195:  */
                    196: routine vm_protect(
                    197:                target_task     : vm_task_t;
                    198:                address         : vm_address_t;
                    199:                size            : vm_size_t;
                    200:                set_maximum     : boolean_t;
                    201:                new_protection  : vm_prot_t);
                    202: 
                    203: /*
                    204:  *     Set the inheritance attribute for the specified range
                    205:  *     of the virtual address space of the target task.
                    206:  *     The inheritance value is one of {none, copy, share}, and
                    207:  *     specifies how the child address space should acquire
                    208:  *     this memory at the time of a task_create call.
                    209:  */
                    210: routine vm_inherit(
                    211:                target_task     : vm_task_t;
                    212:                address         : vm_address_t;
                    213:                size            : vm_size_t;
                    214:                new_inheritance : vm_inherit_t);
                    215: 
                    216: /*
                    217:  *     Returns the contents of the specified range of the
                    218:  *     virtual address space of the target task.  [The
                    219:  *     range must be aligned on a virtual page boundary,
                    220:  *     and must be a multiple of pages in extent.  The
                    221:  *     protection on the specified range must permit reading.]
                    222:  */
                    223: routine vm_read(
                    224:                target_task     : vm_task_t;
                    225:                address         : vm_address_t;
                    226:                size            : vm_size_t;
                    227:        out     data            : pointer_t);
                    228: 
                    229: /*
                    230:  *     Writes the contents of the specified range of the
                    231:  *     virtual address space of the target task.  [The
                    232:  *     range must be aligned on a virtual page boundary,
                    233:  *     and must be a multiple of pages in extent.  The
                    234:  *     protection on the specified range must permit writing.]
                    235:  */
                    236: routine vm_write(
                    237:                target_task     : vm_task_t;
                    238:                address         : vm_address_t;
                    239:                data            : pointer_t);
                    240: 
                    241: /*
                    242:  *     Copy the contents of the source range of the virtual
                    243:  *     address space of the target task to the destination
                    244:  *     range in that same address space.  [Both of the
                    245:  *     ranges must be aligned on a virtual page boundary,
                    246:  *     and must be multiples of pages in extent.  The
                    247:  *     protection on the source range must permit reading,
                    248:  *     and the protection on the destination range must
                    249:  *     permit writing.]
                    250:  */
                    251: routine vm_copy(
                    252:                target_task     : vm_task_t;
                    253:                source_address  : vm_address_t;
                    254:                size            : vm_size_t;
                    255:                dest_address    : vm_address_t);
                    256: 
                    257: /*
                    258:  *     Returns information about the contents of the virtual
                    259:  *     address space of the target task at the specified
                    260:  *     address.  The returned protection, inheritance, sharing
                    261:  *     and memory object values apply to the entire range described
                    262:  *     by the address range returned; the memory object offset
                    263:  *     corresponds to the beginning of the address range.
                    264:  *     [If the specified address is not allocated, the next
                    265:  *     highest address range is described.  If no addresses beyond
                    266:  *     the one specified are allocated, the call returns KERN_NO_SPACE.]
                    267:  */
                    268: routine vm_region(
                    269:                target_task     : vm_task_t;
                    270:        inout   address         : vm_address_t;
                    271:        out     size            : vm_size_t;
                    272:        out     protection      : vm_prot_t;
                    273:        out     max_protection  : vm_prot_t;
                    274:        out     inheritance     : vm_inherit_t;
                    275:        out     is_shared       : boolean_t;
                    276:        /* avoid out-translation of the argument */
                    277:        out     object_name     : memory_object_name_t =
                    278:                                        MACH_MSG_TYPE_MOVE_SEND
                    279:                                        ctype: mach_port_t;
                    280:        out     offset          : vm_offset_t);
                    281: 
                    282: /*
                    283:  *     Return virtual memory statistics for the host
                    284:  *     on which the target task resides.  [Note that the
                    285:  *     statistics are not specific to the target task.]
                    286:  */
                    287: routine vm_statistics(
                    288:                target_task     : vm_task_t;
                    289:        out     vm_stats        : vm_statistics_data_t);
                    290: 
                    291: skip;  /* old task_by_u*x_pid */
                    292: skip;  /* old vm_pageable */
                    293: 
                    294: /*
                    295:  *     Stash a handful of ports for the target task; child
                    296:  *     tasks inherit this stash at task_create time.
                    297:  */
                    298: routine        mach_ports_register(
                    299:                target_task     : task_t;
                    300:                init_port_set   : mach_port_array_t =
                    301:                                        ^array[] of mach_port_t);
                    302: 
                    303: /*
                    304:  *     Retrieve the stashed ports for the target task.
                    305:  */
                    306: routine        mach_ports_lookup(
                    307:                target_task     : task_t;
                    308:        out     init_port_set   : mach_port_array_t =
                    309:                                        ^array[] of mach_port_t);
                    310: 
                    311: skip;  /* old u*x_pid */
                    312: skip;  /* old netipc_listen */
                    313: skip;  /* old netipc_ignore */
                    314: 
                    315: /*
                    316:  *     Provide the data contents of a range of the given memory
                    317:  *     object, with the access restriction specified.  [Only
                    318:  *     whole virtual pages of data can be accepted; partial pages
                    319:  *     will be discarded.  Data should be provided on request, but
                    320:  *     may be provided in advance as desired.  When data already
                    321:  *     held by this kernel is provided again, the new data is ignored.
                    322:  *     The access restriction is the subset of {read, write, execute}
                    323:  *     which are prohibited.  The kernel may not provide any data (or
                    324:  *     protection) consistency among pages with different virtual page
                    325:  *     alignments within the same object.]
                    326:  */
                    327: simpleroutine memory_object_data_provided(
                    328:                memory_control  : memory_object_control_t;
                    329:                offset          : vm_offset_t;
                    330:                data            : pointer_t;
                    331:                lock_value      : vm_prot_t);
                    332: 
                    333: /*
                    334:  *     Indicate that a range of the given temporary memory object does
                    335:  *     not exist, and that the backing memory object should be used
                    336:  *     instead (or zero-fill memory be used, if no backing object exists).
                    337:  *     [This call is intended for use only by the default memory manager.
                    338:  *     It should not be used to indicate a real error --
                    339:  *     memory_object_data_error should be used for that purpose.]
                    340:  */
                    341: simpleroutine memory_object_data_unavailable(
                    342:                memory_control  : memory_object_control_t;
                    343:                offset          : vm_offset_t;
                    344:                size            : vm_size_t);
                    345: 
                    346: /*
                    347:  *     Retrieves the attributes currently associated with
                    348:  *     a memory object.
                    349:  */
                    350: routine memory_object_get_attributes(
                    351:                memory_control  : memory_object_control_t;
                    352:        out     object_ready    : boolean_t;
                    353:        out     may_cache       : boolean_t;
                    354:        out     copy_strategy   : memory_object_copy_strategy_t);
                    355: 
                    356: /*
                    357:  *     Sets the default memory manager, the port to which
                    358:  *     newly-created temporary memory objects are delivered.
                    359:  *     [See (memory_object_default)memory_object_create.]
                    360:  *     The old memory manager port is returned.
                    361:  */
                    362: routine vm_set_default_memory_manager(
                    363:                host_priv       : host_priv_t;
                    364:        inout   default_manager : mach_port_make_send_t);
                    365: 
                    366: skip;  /* old pager_flush_request */
                    367: 
                    368: /*
                    369:  *     Control use of the data associated with the given
                    370:  *     memory object.  For each page in the given range,
                    371:  *     perform the following operations, in order:
                    372:  *             1)  restrict access to the page (disallow
                    373:  *                 forms specified by "prot");
                    374:  *             2)  write back modifications (if "should_return"
                    375:  *                 is RETURN_DIRTY and the page is dirty, or
                    376:  *                 "should_return" is RETURN_ALL and the page
                    377:  *                 is either dirty or precious); and,
                    378:  *             3)  flush the cached copy (if "should_flush"
                    379:  *                 is asserted).
                    380:  *     The set of pages is defined by a starting offset
                    381:  *     ("offset") and size ("size").  Only pages with the
                    382:  *     same page alignment as the starting offset are
                    383:  *     considered.
                    384:  *
                    385:  *     A single acknowledgement is sent (to the "reply_to"
                    386:  *     port) when these actions are complete.
                    387:  *
                    388:  *     There are two versions of this routine because IPC distinguishes
                    389:  *     between booleans and integers (a 2-valued integer is NOT a
                    390:  *     boolean).  The new routine is backwards compatible at the C
                    391:  *     language interface.
                    392:  */
                    393: simpleroutine xxx_memory_object_lock_request(
                    394:                memory_control  : memory_object_control_t;
                    395:                offset          : vm_offset_t;
                    396:                size            : vm_size_t;
                    397:                should_clean    : boolean_t;
                    398:                should_flush    : boolean_t;
                    399:                lock_value      : vm_prot_t;
                    400:                reply_to        : mach_port_t =
                    401:                        MACH_MSG_TYPE_MAKE_SEND_ONCE|polymorphic);
                    402: 
                    403: 
                    404: simpleroutine memory_object_lock_request(
                    405:                memory_control  : memory_object_control_t;
                    406:                offset          : vm_offset_t;
                    407:                size            : vm_size_t;
                    408:                should_return   : memory_object_return_t;
                    409:                should_flush    : boolean_t;
                    410:                lock_value      : vm_prot_t;
                    411:                reply_to        : mach_port_t =
                    412:                        MACH_MSG_TYPE_MAKE_SEND_ONCE|polymorphic);
                    413: 
                    414: /* obsolete */
                    415: routine xxx_task_get_emulation_vector(
                    416:                task            : task_t;
                    417:        out     vector_start    : int;
                    418:        out     emulation_vector: xxx_emulation_vector_t, IsLong);
                    419: 
                    420: /* obsolete */
                    421: routine xxx_task_set_emulation_vector(
                    422:                task            : task_t;
                    423:                vector_start    : int;
                    424:                emulation_vector: xxx_emulation_vector_t, IsLong);
                    425: 
                    426: /*
                    427:  *     Returns information about the host on which the
                    428:  *     target object resides.  [This object may be
                    429:  *     a task, thread, or memory_object_control port.]
                    430:  */
                    431: routine xxx_host_info(
                    432:                target_task     : mach_port_t;
                    433:        out     info            : machine_info_data_t);
                    434: 
                    435: /*
                    436:  *     Returns information about a particular processor on
                    437:  *     the host on which the target task resides.
                    438:  */
                    439: routine xxx_slot_info(
                    440:                target_task     : task_t;
                    441:                slot            : int;
                    442:        out     info            : machine_slot_data_t);
                    443: 
                    444: /*
                    445:  *     Performs control operations (currently only
                    446:  *     turning off or on) on a particular processor on
                    447:  *     the host on which the target task resides.
                    448:  */
                    449: routine xxx_cpu_control(
                    450:                target_task     : task_t;
                    451:                cpu             : int;
                    452:                running         : boolean_t);
                    453: 
                    454: skip;  /* old thread_statistics */
                    455: skip;  /* old task_statistics */
                    456: skip;  /* old netport_init */
                    457: skip;  /* old netport_enter */
                    458: skip;  /* old netport_remove */
                    459: skip;  /* old thread_set_priority */
                    460: 
                    461: /*
                    462:  *     Increment the suspend count for the target task.
                    463:  *     No threads within a task may run when the suspend
                    464:  *     count for that task is non-zero.
                    465:  */
                    466: routine        task_suspend(
                    467:                target_task     : task_t);
                    468: 
                    469: /*
                    470:  *     Decrement the suspend count for the target task,
                    471:  *     if the count is currently non-zero.  If the resulting
                    472:  *     suspend count is zero, then threads within the task
                    473:  *     that also have non-zero suspend counts may execute.
                    474:  */
                    475: routine        task_resume(
                    476:                target_task     : task_t);
                    477: 
                    478: /*
                    479:  *     Returns the current value of the selected special port
                    480:  *     associated with the target task.
                    481:  */
                    482: routine task_get_special_port(
                    483:                task            : task_t;
                    484:                which_port      : int;
                    485:        out     special_port    : mach_port_t);
                    486: 
                    487: /*
                    488:  *     Set one of the special ports associated with the
                    489:  *     target task.
                    490:  */
                    491: routine task_set_special_port(
                    492:                task            : task_t;
                    493:                which_port      : int;
                    494:                special_port    : mach_port_t);
                    495: 
                    496: /* obsolete */
                    497: routine        xxx_task_info(
                    498:                target_task     : task_t;
                    499:                flavor          : int;
                    500:        out     task_info_out   : task_info_t, IsLong);
                    501: 
                    502: 
                    503: /*
                    504:  *     Create a new thread within the target task, returning
                    505:  *     the port representing that new thread.  The
                    506:  *     initial execution state of the thread is undefined.
                    507:  */
                    508: routine thread_create(
                    509:                parent_task     : task_t;
                    510:        out     child_thread    : thread_t);
                    511: 
                    512: /*
                    513:  *     Increment the suspend count for the target thread.
                    514:  *     Once this call has completed, the thread will not
                    515:  *     execute any further user or meta- instructions.
                    516:  *     Once suspended, a thread may not execute again until
                    517:  *     its suspend count is zero, and the suspend count
                    518:  *     for its task is also zero.
                    519:  */
                    520: routine        thread_suspend(
                    521:                target_thread   : thread_t);
                    522: 
                    523: /*
                    524:  *     Decrement the suspend count for the target thread,
                    525:  *     if that count is not already zero.
                    526:  */
                    527: routine        thread_resume(
                    528:                target_thread   : thread_t);
                    529: 
                    530: /*
                    531:  *     Cause any user or meta- instructions currently being
                    532:  *     executed by the target thread to be aborted.  [Meta-
                    533:  *     instructions consist of the basic traps for IPC
                    534:  *     (e.g., msg_send, msg_receive) and self-identification
                    535:  *     (e.g., task_self, thread_self, thread_reply).  Calls
                    536:  *     described by MiG interfaces are not meta-instructions
                    537:  *     themselves.]
                    538:  */
                    539: routine thread_abort(
                    540:                target_thread   : thread_t);
                    541: 
                    542: /* obsolete */
                    543: routine xxx_thread_get_state(
                    544:                target_thread   : thread_t;
                    545:                flavor          : int;
                    546:        out     old_state       : thread_state_t, IsLong);
                    547: 
                    548: /* obsolete */
                    549: routine        xxx_thread_set_state(
                    550:                target_thread   : thread_t;
                    551:                flavor          : int;
                    552:                new_state       : thread_state_t, IsLong);
                    553: 
                    554: /*
                    555:  *     Returns the current value of the selected special port
                    556:  *     associated with the target thread.
                    557:  */
                    558: routine thread_get_special_port(
                    559:                thread          : thread_t;
                    560:                which_port      : int;
                    561:        out     special_port    : mach_port_t);
                    562: 
                    563: /*
                    564:  *     Set one of the special ports associated with the
                    565:  *     target thread.
                    566:  */
                    567: routine thread_set_special_port(
                    568:                thread          : thread_t;
                    569:                which_port      : int;
                    570:                special_port    : mach_port_t);
                    571: 
                    572: /* obsolete */
                    573: routine        xxx_thread_info(
                    574:                target_thread   : thread_t;
                    575:                flavor          : int;
                    576:        out     thread_info_out : thread_info_t, IsLong);
                    577: 
                    578: /*
                    579:  *     Establish a user-level handler for the specified
                    580:  *     system call.
                    581:  */
                    582: routine task_set_emulation(
                    583:                target_port     : task_t;
                    584:                routine_entry_pt: vm_address_t;
                    585:                routine_number  : int);
                    586: 
                    587: /*
                    588:  *      Establish restart pc for interrupted atomic sequences.
                    589:  *     This reuses the message number for the old task_get_io_port.
                    590:  *     See task_info.h for description of flavors.
                    591:  *
                    592:  */
                    593: routine task_ras_control(
                    594:                target_task     : task_t;
                    595:                basepc          : vm_address_t;
                    596:                boundspc        : vm_address_t;
                    597:                flavor          : int);
                    598: 
                    599: 
                    600: 
                    601: skip;  /* old host_ipc_statistics */
                    602: 
                    603: 
                    604: #if    MACH_IPC_COMPAT
                    605: 
                    606: /*
                    607:  *     Returns the set of port and port set names
                    608:  *     to which the target task has access, along with
                    609:  *     the type (set or port) for each name.
                    610:  */
                    611: routine port_names(
                    612:                task            : ipc_space_t;
                    613:        out     port_names_p    : port_name_array_t;
                    614:        out     port_types      : port_type_array_t);
                    615: 
                    616: /*
                    617:  *     Returns the type (set or port) for the port name
                    618:  *     within the target task.
                    619:  */
                    620: routine port_type(
                    621:                task            : ipc_space_t;
                    622:                port_name       : port_name_t;
                    623:        out     port_type_p     : port_type_t);
                    624: 
                    625: /*
                    626:  *     Changes the name by which a port (or port set) is known to
                    627:  *     the target task.
                    628:  */
                    629: routine port_rename(
                    630:                task            : ipc_space_t;
                    631:                old_name        : port_name_t;
                    632:                new_name        : port_name_t);
                    633: 
                    634: /*
                    635:  *     Allocate a new port (with all rights) in the target task.
                    636:  *     The port name in that task is returned.
                    637:  */
                    638: routine port_allocate(
                    639:                task            : ipc_space_t;
                    640:        out     port_name       : port_name_t);
                    641: 
                    642: /*
                    643:  *     Deallocate the port with the given name from the target task.
                    644:  */
                    645: routine port_deallocate(
                    646:                task            : ipc_space_t;
                    647:                port_name       : port_name_t);
                    648: 
                    649: /*
                    650:  *     Set the number of messages that may be queued to
                    651:  *     the port in the target task with the given name
                    652:  *     before further message queueing operations block.
                    653:  *     The target task must hold receive rights for the
                    654:  *     port named.
                    655:  */
                    656: routine port_set_backlog(
                    657:                task            : ipc_space_t;
                    658:                port_name       : port_name_t;
                    659:                backlog         : int);
                    660: 
                    661: /*
                    662:  *     Return information about the port with the given
                    663:  *     name in the target task.  Only the ownership and
                    664:  *     receive_rights results are meaningful unless the
                    665:  *     target task holds receive rights for the port.
                    666:  */
                    667: routine port_status(
                    668:                task            : ipc_space_t;
                    669:                port_name       : port_name_t;
                    670:        out     enabled         : port_set_name_t;
                    671:        out     num_msgs        : int;
                    672:        out     backlog         : int;
                    673:        out     ownership       : boolean_t;
                    674:        out     receive_rights  : boolean_t);
                    675: 
                    676: /*
                    677:  *     Allocate a new port set in the target task, returning
                    678:  *     the name of that new port set.  [The new set is
                    679:  *     initially empty.]
                    680:  */
                    681: routine port_set_allocate(
                    682:                task            : ipc_space_t;
                    683:        out     set_name        : port_set_name_t);
                    684: 
                    685: /*
                    686:  *     Deallocate the named port set from the target task.
                    687:  *     Ports that are currently members of the named port
                    688:  *     set are first removed from the set.
                    689:  */
                    690: routine port_set_deallocate(
                    691:                task            : ipc_space_t;
                    692:                set_name        : port_set_name_t);
                    693: 
                    694: /*
                    695:  *     Add the named port to the port set named within
                    696:  *     the target task.  [If the port currently is a member
                    697:  *     of another port set, it is removed from that set.]
                    698:  */
                    699: routine port_set_add(
                    700:                task            : ipc_space_t;
                    701:                set_name        : port_set_name_t;
                    702:                port_name       : port_name_t);
                    703: 
                    704: /*
                    705:  *     Remove the named port from the port set named within
                    706:  *     the target task.
                    707:  */
                    708: routine port_set_remove(
                    709:                task            : ipc_space_t;
                    710:                port_name       : port_name_t);
                    711: 
                    712: /*
                    713:  *     Returns the current set of ports that are members
                    714:  *     of the named port set in the target task.
                    715:  */
                    716: routine port_set_status(
                    717:                task            : ipc_space_t;
                    718:                set_name        : port_set_name_t;
                    719:        out     members         : port_name_array_t);
                    720: 
                    721: /*
                    722:  *     Insert send rights for the specified port into
                    723:  *     the target task with the specified port name.
                    724:  *     [If the name is in use, or the target task already
                    725:  *     has another name for the specified port, then
                    726:  *     the operation will fail.]
                    727:  */
                    728: routine port_insert_send(
                    729:                task            : ipc_space_t;
                    730:                my_port         : port_t;
                    731:                his_name        : port_name_t);
                    732: 
                    733: /*
                    734:  *     Returns send rights for the named port in the
                    735:  *     target task, removing that port name and port
                    736:  *     send rights from the target task.  [If the
                    737:  *     target task holds receive rights for this port,
                    738:  *     the operation will fail.]
                    739:  */
                    740: routine port_extract_send(
                    741:                task            : ipc_space_t;
                    742:                his_name        : port_name_t;
                    743:        out     his_port        : port_t);
                    744: 
                    745: /*
                    746:  *     Insert receive rights for the specified port into
                    747:  *     the target task with the specified port name.
                    748:  *     [If the name is in use, or the target task already
                    749:  *     has another name for the specified port, then
                    750:  *     the operation will fail.
                    751:  */
                    752: routine port_insert_receive(
                    753:                task            : ipc_space_t;
                    754:                my_port         : port_all_t;
                    755:                his_name        : port_name_t);
                    756: 
                    757: /*
                    758:  *     Returns receive rights for the named port in the
                    759:  *     target task, removing that port name and all port
                    760:  *     rights from the target task.
                    761:  */
                    762: routine port_extract_receive(
                    763:                task            : ipc_space_t;
                    764:                his_name        : port_name_t;
                    765:        out     his_port        : port_all_t);
                    766: 
                    767: #else  /* MACH_IPC_COMPAT */
                    768: 
                    769: skip;  /* old port_names */
                    770: skip;  /* old port_type */
                    771: skip;  /* old port_rename */
                    772: skip;  /* old port_allocate */
                    773: skip;  /* old port_deallocate */
                    774: skip;  /* old port_set_backlog */
                    775: skip;  /* old port_status */
                    776: skip;  /* old port_set_allocate */
                    777: skip;  /* old port_set_deallocate */
                    778: skip;  /* old port_set_add */
                    779: skip;  /* old port_set_remove */
                    780: skip;  /* old port_set_status */
                    781: skip;  /* old port_insert_send */
                    782: skip;  /* old port_extract_send */
                    783: skip;  /* old port_insert_receive */
                    784: skip;  /* old port_extract_receive */
                    785: 
                    786: #endif /* MACH_IPC_COMPAT */
                    787: 
                    788: /*
                    789:  *     Map a user-defined memory object into the virtual address
                    790:  *     space of the target task.  If desired (anywhere is TRUE),
                    791:  *     the kernel will find a suitable address range of the
                    792:  *     specified size; else, the specific address will be allocated.
                    793:  *
                    794:  *     The beginning address of the range will be aligned on a virtual
                    795:  *     page boundary, be at or beyond the address specified, and
                    796:  *     meet the mask requirements (bits turned on in the mask must not
                    797:  *     be turned on in the result); the size of the range, in bytes,
                    798:  *     will be rounded up to an integral number of virtual pages.
                    799:  *
                    800:  *     The memory in the resulting range will be associated with the
                    801:  *     specified memory object, with the beginning of the memory range
                    802:  *     referring to the specified offset into the memory object.
                    803:  *
                    804:  *     The mapping will take the current and maximum protections and
                    805:  *     the inheritance attributes specified; see the vm_protect and
                    806:  *     vm_inherit calls for a description of these attributes.
                    807:  *
                    808:  *     If desired (copy is TRUE), the memory range will be filled
                    809:  *     with a copy of the data from the memory object; this copy will
                    810:  *     be private to this mapping in this target task.  Otherwise,
                    811:  *     the memory in this mapping will be shared with other mappings
                    812:  *     of the same memory object at the same offset (in this task or
                    813:  *     in other tasks).  [The Mach kernel only enforces shared memory
                    814:  *     consistency among mappings on one host with similar page alignments.
                    815:  *     The user-defined memory manager for this object is responsible
                    816:  *     for further consistency.]
                    817:  */
                    818: #ifdef EMULATOR
                    819: routine htg_vm_map(
                    820:                target_task     : vm_task_t;
                    821:        ureplyport reply_port   : mach_port_make_send_once_t;
                    822:        inout   address         : vm_address_t;
                    823:                size            : vm_size_t;
                    824:                mask            : vm_address_t;
                    825:                anywhere        : boolean_t;
                    826:                memory_object   : memory_object_t;
                    827:                offset          : vm_offset_t;
                    828:                copy            : boolean_t;
                    829:                cur_protection  : vm_prot_t;
                    830:                max_protection  : vm_prot_t;
                    831:                inheritance     : vm_inherit_t);
                    832: #else  /* EMULATOR */
                    833: routine vm_map(
                    834:                target_task     : vm_task_t;
                    835:        inout   address         : vm_address_t;
                    836:                size            : vm_size_t;
                    837:                mask            : vm_address_t;
                    838:                anywhere        : boolean_t;
                    839:                memory_object   : memory_object_t;
                    840:                offset          : vm_offset_t;
                    841:                copy            : boolean_t;
                    842:                cur_protection  : vm_prot_t;
                    843:                max_protection  : vm_prot_t;
                    844:                inheritance     : vm_inherit_t);
                    845: #endif /* EMULATOR */
                    846: 
                    847: /*
                    848:  *     Indicate that a range of the specified memory object cannot
                    849:  *     be provided at this time.  [Threads waiting for memory pages
                    850:  *     specified by this call will experience a memory exception.
                    851:  *     Only threads waiting at the time of the call are affected.]
                    852:  */
                    853: simpleroutine memory_object_data_error(
                    854:                memory_control  : memory_object_control_t;
                    855:                offset          : vm_offset_t;
                    856:                size            : vm_size_t;
                    857:                error_value     : kern_return_t);
                    858: 
                    859: /*
                    860:  *     Make decisions regarding the use of the specified
                    861:  *     memory object.
                    862:  */
                    863: simpleroutine memory_object_set_attributes(
                    864:                memory_control  : memory_object_control_t;
                    865:                object_ready    : boolean_t;
                    866:                may_cache       : boolean_t;
                    867:                copy_strategy   : memory_object_copy_strategy_t);
                    868: 
                    869: /*
                    870:  */
                    871: simpleroutine memory_object_destroy(
                    872:                memory_control  : memory_object_control_t;
                    873:                reason          : kern_return_t);
                    874: 
                    875: /*
                    876:  *     Provide the data contents of a range of the given memory
                    877:  *     object, with the access restriction specified, optional
                    878:  *     precious attribute, and reply message.  [Only
                    879:  *     whole virtual pages of data can be accepted; partial pages
                    880:  *     will be discarded.  Data should be provided on request, but
                    881:  *     may be provided in advance as desired.  When data already
                    882:  *     held by this kernel is provided again, the new data is ignored.
                    883:  *     The access restriction is the subset of {read, write, execute}
                    884:  *     which are prohibited.  The kernel may not provide any data (or
                    885:  *     protection) consistency among pages with different virtual page
                    886:  *     alignments within the same object.  The precious value controls
                    887:  *     how the kernel treats the data.  If it is FALSE, the kernel treats
                    888:  *     its copy as a temporary and may throw it away if it hasn't been
                    889:  *     changed.  If the precious value is TRUE, the kernel treats its
                    890:  *     copy as a data repository and promises to return it to the manager;
                    891:  *     the manager may tell the kernel to throw it away instead by flushing
                    892:  *     and not cleaning the data -- see memory_object_lock_request.  The
                    893:  *     reply_to port is for a compeletion message; it will be
                    894:  *     memory_object_supply_completed.]
                    895:  */
                    896: 
                    897: simpleroutine memory_object_data_supply(
                    898:                memory_control  : memory_object_control_t;
                    899:                offset          : vm_offset_t;
                    900:                data            : pointer_t, Dealloc[];
                    901:                lock_value      : vm_prot_t;
                    902:                precious        : boolean_t;
                    903:                reply_to        : mach_port_t =
                    904:                        MACH_MSG_TYPE_MAKE_SEND_ONCE|polymorphic);
                    905: 
                    906: simpleroutine memory_object_ready(
                    907:                memory_control  : memory_object_control_t;
                    908:                may_cache       : boolean_t;
                    909:                copy_strategy   : memory_object_copy_strategy_t);
                    910: 
                    911: simpleroutine memory_object_change_attributes(
                    912:                memory_control  : memory_object_control_t;
                    913:                may_cache       : boolean_t;
                    914:                copy_strategy   : memory_object_copy_strategy_t;
                    915:                reply_to        : mach_port_t =
                    916:                        MACH_MSG_TYPE_MAKE_SEND_ONCE|polymorphic);
                    917: 
                    918: skip;  /* old host_callout_statistics_reset */
                    919: skip;  /* old port_set_select */
                    920: 
                    921: #if    MACH_IPC_COMPAT
                    922: 
                    923: /*
                    924:  *     Sets a backup port for the named port.  The task
                    925:  *     must have receive rights for the named port.
                    926:  *     Returns the previous backup port, if any.
                    927:  */
                    928: 
                    929: routine port_set_backup(
                    930:                task            : ipc_space_t;
                    931:                port_name       : port_name_t;
                    932:                backup          : port_t = MACH_MSG_TYPE_MAKE_SEND
                    933:                                  ctype: mach_port_t;
                    934:        out     previous        : port_t);
                    935: 
                    936: #else  /* MACH_IPC_COMPAT */
                    937: 
                    938: skip;  /* old port_set_backup */
                    939: 
                    940: #endif /* MACH_IPC_COMPAT */
                    941: 
                    942: /*
                    943:  *     Set/Get special properties of memory associated
                    944:  *     to some virtual address range, such as cachability,
                    945:  *     migrability, replicability.  Machine-dependent.
                    946:  */
                    947: routine vm_machine_attribute(
                    948:                target_task     : vm_task_t;
                    949:                address         : vm_address_t;
                    950:                size            : vm_size_t;
                    951:                attribute       : vm_machine_attribute_t;
                    952:        inout   value           : vm_machine_attribute_val_t);
                    953: 
                    954: skip;  /* old host_fpa_counters_reset */
                    955: 
                    956: /*
                    957:  *     There is no more room in this interface for additional calls.
                    958:  */

unix.superglobalmegacorp.com

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