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

1.1       root        1: /*
                      2:  * Copyright (C) 2012 Free Software Foundation
                      3:  *
                      4:  * This program is free software; you can redistribute it and/or modify
                      5:  * it under the terms of the GNU General Public License as published by
                      6:  * the Free Software Foundation; either version 2 of the License, or
                      7:  * (at your option) any later version.
                      8:  *
                      9:  * This program is distributed in the hope that it will be useful,
                     10:  * but WITHOUT ANY WARRANTY; without even the implied warranty of
                     11:  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                     12:  * GNU General Public License for more details.
                     13:  *
                     14:  * You should have received a copy of the GNU General Public License along
                     15:  * with this program; if not, write to the Free Software Foundation, Inc.,
                     16:  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
                     17:  */
                     18: 
                     19: subsystem
                     20: #if    KERNEL_SERVER
                     21:          KernelServer
                     22: #endif /* KERNEL_SERVER */
                     23: #if    KERNEL_USER
                     24:          KernelUser
                     25: #endif /* KERNEL_USER */
                     26:                       gnumach 4200;
                     27: 
                     28: #include <mach/std_types.defs>
                     29: #include <mach/mach_types.defs>
1.1.1.2   root       30: #include <mach_debug/mach_debug_types.defs>
                     31: 
                     32: #ifdef GNUMACH_IMPORTS
                     33: GNUMACH_IMPORTS
                     34: #endif
1.1       root       35: 
                     36: type vm_cache_statistics_data_t = struct[11] of integer_t;
                     37: 
                     38: /*
                     39:  * Return page cache statistics for the host on which the target task
                     40:  * resides.
                     41:  */
                     42: routine vm_cache_statistics(
                     43:                target_task     : vm_task_t;
                     44:        out     vm_cache_stats  : vm_cache_statistics_data_t);
1.1.1.2   root       45: 
                     46: /*
                     47:  * Terminate a thread and release rights and memory.
                     48:  *
                     49:  * Intended to be used by threading libraries to provide a clean way for
                     50:  * threads to terminate themselves. The resources a thread wouldn't be able
                     51:  * to release without this call when terminating itself are its
                     52:  * last reference to its kernel port, its reply port, and its stack.
                     53:  *
                     54:  * This call is semantically equivalent to :
                     55:  *  - mach_port_deallocate(task, thread_name);
                     56:  *  - if (reply_port != MACH_PORT_NULL)
                     57:  *      mach_port_destroy(task, reply_port);
                     58:  *  - if ((address != 0) || (size != 0))
                     59:  *      vm_deallocate(task, address, size)
                     60:  *  - thread_terminate(thread)
                     61:  *
                     62:  * Implemented as a simple routine so a reply port isn't required.
                     63:  */
                     64: simpleroutine thread_terminate_release(
                     65:                thread          : thread_t;
                     66:                task            : task_t;
                     67:                thread_name     : mach_port_name_t;
                     68:                reply_port      : mach_port_name_t;
                     69:                address         : vm_address_t;
                     70:                size            : vm_size_t);
                     71: 
                     72: /*
                     73:  *     Set the name of task TASK to NAME.  This is a debugging aid.
                     74:  *     NAME will be used in error messages printed by the kernel.
                     75:  */
                     76: simpleroutine task_set_name(
                     77:                task    : task_t;
                     78:                name    : kernel_debug_name_t);
                     79: 
                     80: /*
                     81:  * Register a port to which a notification about newly created tasks
                     82:  * are sent.
                     83:  */
                     84: routine register_new_task_notification(
                     85:                host_priv       : host_priv_t;
                     86:                notification    : mach_port_send_t);
1.1.1.3 ! root       87: 
        !            88: /* Test that the contents of ADDR are equal to the 32-bit integer VAL1.
        !            89:  * If they are not, return immediately, otherwise, block until a
        !            90:  * matching 'gsync_wake' is done on the same address. FLAGS is used
        !            91:  * to control how the thread waits, and may be composed of:
        !            92:  * - GSYNC_SHARED: The address may be shared among tasks. If this
        !            93:      bit is not set, the address is assumed to be task-local.
        !            94:  * - GSYNC_QUAD: Additionally check that the adjacent 32-bit word
        !            95:      following ADDR matches the value VAL2.
        !            96:  * - GSYNC_TIMED: The call only blocks for MSEC milliseconds. */
        !            97: routine gsync_wait(
        !            98:   task : task_t;
        !            99:   addr : vm_offset_t;
        !           100:   val1 : unsigned;
        !           101:   val2 : unsigned;
        !           102:   msec : natural_t;
        !           103:   flags : int);
        !           104: 
        !           105: /* Wake up threads waiting on the address ADDR. Much like with
        !           106:  * 'gsync_wait', the parameter FLAGS controls how it is done. In this
        !           107:  * case, it may be composed of the following:
        !           108:  * - GSYNC_SHARED: Same as with 'gsync_wait'.
        !           109:  * - GSYNC_BROADCAST: Wake up every thread waiting on the address. If
        !           110:  *   this flag is not set, the call wakes (at most) 1 thread.
        !           111:  * - GSYNC_MUTATE: Before waking any potential waiting threads, set the
        !           112:  *   contents of ADDR to VAL.
        !           113:  *
        !           114:  * This RPC is implemented as a simple routine for efficiency reasons,
        !           115:  * and because the return value rarely matters. */
        !           116: simpleroutine gsync_wake(
        !           117:   task : task_t;
        !           118:   addr : vm_offset_t;
        !           119:   val : unsigned;
        !           120:   flags : int);
        !           121: 
        !           122: /* Arrange for threads waiting on address SRC_ADDR to instead
        !           123:  * wait on address DST_ADDR. If WAKE_ONE is true, additionally
        !           124:  * wake one of the threads waiting on SRC_ADDR. For this function,
        !           125:  * the parameter flags may be a combination of:
        !           126:  * - GSYNC_SHARED: Just like with 'gsync_wait' and 'gsync_wake'.
        !           127:  * - GSYNC_BROADCAST: Move all the threads waiting on SRC_ADDR. If
        !           128:      this flag is not set, the call moves (at most) 1 thread.
        !           129:  *
        !           130:  * This RPC is also a simple routine, and for the same reasons as
        !           131:  * with 'gsync_wake'. */
        !           132: simpleroutine gsync_requeue(
        !           133:   task : task_t;
        !           134:   src_addr : vm_offset_t;
        !           135:   dst_addr : vm_offset_t;
        !           136:   wake_one : boolean_t;
        !           137:   flags : int);
        !           138: 

unix.superglobalmegacorp.com

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