--- Gnu-Mach/include/mach/mach.defs 2020/09/02 04:36:57 1.1.1.1 +++ Gnu-Mach/include/mach/mach.defs 2020/09/02 04:52:28 1.1.1.5 @@ -30,12 +30,6 @@ * Matchmaker definitions file for Mach kernel interface. */ -#ifdef MACH_KERNEL -#include - -simport ; /* for obsolete routines */ -#endif /* MACH_KERNEL */ - subsystem #if KERNEL_USER KernelUser @@ -52,6 +46,10 @@ userprefix r_; #include #include +#ifdef MACH_IMPORTS +MACH_IMPORTS +#endif + skip; /* old port_allocate */ skip; /* old port_deallocate */ skip; /* old port_enable */ @@ -60,6 +58,9 @@ skip; /* old port_select */ skip; /* old port_set_backlog */ skip; /* old port_status */ +/* We use only a handful of RPCs as client. Skip the rest. */ +#if ! KERNEL_USER + /* * Create a new task with an empty set of IPC rights, * and having an address space constructed from the @@ -164,13 +165,13 @@ skip; /* old thread_mutate */ */ #ifdef EMULATOR skip; /* the emulator redefines vm_allocate using vm_map */ -#else EMULATOR +#else /* EMULATOR */ routine vm_allocate( target_task : vm_task_t; inout address : vm_address_t; size : vm_size_t; anywhere : boolean_t); -#endif EMULATOR +#endif /* EMULATOR */ skip; /* old vm_allocate_with_pager */ @@ -312,6 +313,18 @@ skip; /* old u*x_pid */ skip; /* old netipc_listen */ skip; /* old netipc_ignore */ +#else /* ! KERNEL_USER */ + +skip; skip; skip; skip; skip; +skip; skip; skip; skip; skip; +skip; skip; skip; skip; skip; +skip; skip; skip; skip; skip; +skip; skip; skip; skip; skip; +skip; skip; skip; skip; skip; +skip; + +#endif /* ! KERNEL_USER */ + /* * Provide the data contents of a range of the given memory * object, with the access restriction specified. [Only @@ -353,6 +366,8 @@ routine memory_object_get_attributes( out may_cache : boolean_t; out copy_strategy : memory_object_copy_strategy_t); +#if ! KERNEL_USER + /* * Sets the default memory manager, the port to which * newly-created temporary memory objects are delivered. @@ -363,6 +378,12 @@ routine vm_set_default_memory_manager( host_priv : host_priv_t; inout default_manager : mach_port_make_send_t); +#else /* ! KERNEL_USER */ + +skip; + +#endif /* ! KERNEL_USER */ + skip; /* old pager_flush_request */ /* @@ -390,16 +411,8 @@ skip; /* old pager_flush_request */ * boolean). The new routine is backwards compatible at the C * language interface. */ -simpleroutine xxx_memory_object_lock_request( - memory_control : memory_object_control_t; - offset : vm_offset_t; - size : vm_size_t; - should_clean : boolean_t; - should_flush : boolean_t; - lock_value : vm_prot_t; - reply_to : mach_port_t = - MACH_MSG_TYPE_MAKE_SEND_ONCE|polymorphic); +skip; /* old xxx_memory_object_lock_request */ simpleroutine memory_object_lock_request( memory_control : memory_object_control_t; @@ -411,46 +424,11 @@ simpleroutine memory_object_lock_request reply_to : mach_port_t = MACH_MSG_TYPE_MAKE_SEND_ONCE|polymorphic); -/* obsolete */ -routine xxx_task_get_emulation_vector( - task : task_t; - out vector_start : int; - out emulation_vector: xxx_emulation_vector_t, IsLong); - -/* obsolete */ -routine xxx_task_set_emulation_vector( - task : task_t; - vector_start : int; - emulation_vector: xxx_emulation_vector_t, IsLong); - -/* - * Returns information about the host on which the - * target object resides. [This object may be - * a task, thread, or memory_object_control port.] - */ -routine xxx_host_info( - target_task : mach_port_t; - out info : machine_info_data_t); - -/* - * Returns information about a particular processor on - * the host on which the target task resides. - */ -routine xxx_slot_info( - target_task : task_t; - slot : int; - out info : machine_slot_data_t); - -/* - * Performs control operations (currently only - * turning off or on) on a particular processor on - * the host on which the target task resides. - */ -routine xxx_cpu_control( - target_task : task_t; - cpu : int; - running : boolean_t); - +skip; /* old xxx_task_get_emulation_vector */ +skip; /* old xxx_task_set_emulation_vector */ +skip; /* old xxx_host_info */ +skip; /* old xxx_slot_info */ +skip; /* old xxx_cpu_control */ skip; /* old thread_statistics */ skip; /* old task_statistics */ skip; /* old netport_init */ @@ -458,6 +436,8 @@ skip; /* old netport_enter */ skip; /* old netport_remove */ skip; /* old thread_set_priority */ +#if ! KERNEL_USER + /* * Increment the suspend count for the target task. * No threads within a task may run when the suspend @@ -493,11 +473,7 @@ routine task_set_special_port( which_port : int; special_port : mach_port_t); -/* obsolete */ -routine xxx_task_info( - target_task : task_t; - flavor : int; - out task_info_out : task_info_t, IsLong); +skip; /* old xxx_task_info */ /* @@ -539,17 +515,8 @@ routine thread_resume( routine thread_abort( target_thread : thread_t); -/* obsolete */ -routine xxx_thread_get_state( - target_thread : thread_t; - flavor : int; - out old_state : thread_state_t, IsLong); - -/* obsolete */ -routine xxx_thread_set_state( - target_thread : thread_t; - flavor : int; - new_state : thread_state_t, IsLong); +skip; /* old xxx_thread_get_state */ +skip; /* old xxx_thread_set_state */ /* * Returns the current value of the selected special port @@ -569,11 +536,7 @@ routine thread_set_special_port( which_port : int; special_port : mach_port_t); -/* obsolete */ -routine xxx_thread_info( - target_thread : thread_t; - flavor : int; - out thread_info_out : thread_info_t, IsLong); +skip; /* old xxx_thread_info */ /* * Establish a user-level handler for the specified @@ -582,190 +545,23 @@ routine xxx_thread_info( routine task_set_emulation( target_port : task_t; routine_entry_pt: vm_address_t; - routine_number : int); + routine_number : int); /* * Establish restart pc for interrupted atomic sequences. * This reuses the message number for the old task_get_io_port. * See task_info.h for description of flavors. - * + * */ routine task_ras_control( target_task : task_t; basepc : vm_address_t; boundspc : vm_address_t; flavor : int); - - - -skip; /* old host_ipc_statistics */ - - -#if MACH_IPC_COMPAT - -/* - * Returns the set of port and port set names - * to which the target task has access, along with - * the type (set or port) for each name. - */ -routine port_names( - task : ipc_space_t; - out port_names_p : port_name_array_t; - out port_types : port_type_array_t); - -/* - * Returns the type (set or port) for the port name - * within the target task. - */ -routine port_type( - task : ipc_space_t; - port_name : port_name_t; - out port_type_p : port_type_t); -/* - * Changes the name by which a port (or port set) is known to - * the target task. - */ -routine port_rename( - task : ipc_space_t; - old_name : port_name_t; - new_name : port_name_t); - -/* - * Allocate a new port (with all rights) in the target task. - * The port name in that task is returned. - */ -routine port_allocate( - task : ipc_space_t; - out port_name : port_name_t); - -/* - * Deallocate the port with the given name from the target task. - */ -routine port_deallocate( - task : ipc_space_t; - port_name : port_name_t); - -/* - * Set the number of messages that may be queued to - * the port in the target task with the given name - * before further message queueing operations block. - * The target task must hold receive rights for the - * port named. - */ -routine port_set_backlog( - task : ipc_space_t; - port_name : port_name_t; - backlog : int); - -/* - * Return information about the port with the given - * name in the target task. Only the ownership and - * receive_rights results are meaningful unless the - * target task holds receive rights for the port. - */ -routine port_status( - task : ipc_space_t; - port_name : port_name_t; - out enabled : port_set_name_t; - out num_msgs : int; - out backlog : int; - out ownership : boolean_t; - out receive_rights : boolean_t); - -/* - * Allocate a new port set in the target task, returning - * the name of that new port set. [The new set is - * initially empty.] - */ -routine port_set_allocate( - task : ipc_space_t; - out set_name : port_set_name_t); - -/* - * Deallocate the named port set from the target task. - * Ports that are currently members of the named port - * set are first removed from the set. - */ -routine port_set_deallocate( - task : ipc_space_t; - set_name : port_set_name_t); - -/* - * Add the named port to the port set named within - * the target task. [If the port currently is a member - * of another port set, it is removed from that set.] - */ -routine port_set_add( - task : ipc_space_t; - set_name : port_set_name_t; - port_name : port_name_t); - -/* - * Remove the named port from the port set named within - * the target task. - */ -routine port_set_remove( - task : ipc_space_t; - port_name : port_name_t); - -/* - * Returns the current set of ports that are members - * of the named port set in the target task. - */ -routine port_set_status( - task : ipc_space_t; - set_name : port_set_name_t; - out members : port_name_array_t); - -/* - * Insert send rights for the specified port into - * the target task with the specified port name. - * [If the name is in use, or the target task already - * has another name for the specified port, then - * the operation will fail.] - */ -routine port_insert_send( - task : ipc_space_t; - my_port : port_t; - his_name : port_name_t); - -/* - * Returns send rights for the named port in the - * target task, removing that port name and port - * send rights from the target task. [If the - * target task holds receive rights for this port, - * the operation will fail.] - */ -routine port_extract_send( - task : ipc_space_t; - his_name : port_name_t; - out his_port : port_t); -/* - * Insert receive rights for the specified port into - * the target task with the specified port name. - * [If the name is in use, or the target task already - * has another name for the specified port, then - * the operation will fail. - */ -routine port_insert_receive( - task : ipc_space_t; - my_port : port_all_t; - his_name : port_name_t); - -/* - * Returns receive rights for the named port in the - * target task, removing that port name and all port - * rights from the target task. - */ -routine port_extract_receive( - task : ipc_space_t; - his_name : port_name_t; - out his_port : port_all_t); - -#else MACH_IPC_COMPAT +skip; /* old host_ipc_statistics */ skip; /* old port_names */ skip; /* old port_type */ skip; /* old port_rename */ @@ -783,8 +579,6 @@ skip; /* old port_extract_send */ skip; /* old port_insert_receive */ skip; /* old port_extract_receive */ -#endif MACH_IPC_COMPAT - /* * Map a user-defined memory object into the virtual address * space of the target task. If desired (anywhere is TRUE), @@ -829,7 +623,7 @@ routine htg_vm_map( cur_protection : vm_prot_t; max_protection : vm_prot_t; inheritance : vm_inherit_t); -#else EMULATOR +#else /* EMULATOR */ routine vm_map( target_task : vm_task_t; inout address : vm_address_t; @@ -842,7 +636,19 @@ routine vm_map( cur_protection : vm_prot_t; max_protection : vm_prot_t; inheritance : vm_inherit_t); -#endif EMULATOR +#endif /* EMULATOR */ + +#else /* ! KERNEL_USER */ + +skip; skip; skip; skip; skip; +skip; skip; skip; skip; skip; +skip; skip; skip; skip; skip; +skip; skip; skip; skip; skip; +skip; skip; skip; skip; skip; +skip; skip; skip; skip; skip; +skip; skip; skip; skip; + +#endif /* ! KERNEL_USER */ /* * Indicate that a range of the specified memory object cannot @@ -915,33 +721,15 @@ simpleroutine memory_object_change_attri reply_to : mach_port_t = MACH_MSG_TYPE_MAKE_SEND_ONCE|polymorphic); +#if ! KERNEL_USER + skip; /* old host_callout_statistics_reset */ skip; /* old port_set_select */ - -#if MACH_IPC_COMPAT - -/* - * Sets a backup port for the named port. The task - * must have receive rights for the named port. - * Returns the previous backup port, if any. - */ - -routine port_set_backup( - task : ipc_space_t; - port_name : port_name_t; - backup : port_t = MACH_MSG_TYPE_MAKE_SEND - ctype: mach_port_t; - out previous : port_t); - -#else MACH_IPC_COMPAT - skip; /* old port_set_backup */ -#endif MACH_IPC_COMPAT - /* * Set/Get special properties of memory associated - * to some virtual address range, such as cachability, + * to some virtual address range, such as cachability, * migrability, replicability. Machine-dependent. */ routine vm_machine_attribute( @@ -953,6 +741,8 @@ routine vm_machine_attribute( skip; /* old host_fpa_counters_reset */ +#endif /* ! KERNEL_USER */ + /* * There is no more room in this interface for additional calls. */