diff options
| author | Pasha <pasha@member.fsf.org> | 2024-02-20 18:49:50 +0000 | 
|---|---|---|
| committer | Pasha <pasha@member.fsf.org> | 2024-02-20 18:49:50 +0000 | 
| commit | 5e0b8d508ed51004bd836384293be00950ee62c9 (patch) | |
| tree | e3f16b1aa8b7177032ce3ec429fbad2b1d92a876 /kern/ipc_mig.h | |
| download | gnumach-riscv-5e0b8d508ed51004bd836384293be00950ee62c9.tar.gz gnumach-riscv-5e0b8d508ed51004bd836384293be00950ee62c9.tar.bz2 | |
init gnumach copy
Diffstat (limited to 'kern/ipc_mig.h')
| -rw-r--r-- | kern/ipc_mig.h | 143 | 
1 files changed, 143 insertions, 0 deletions
| diff --git a/kern/ipc_mig.h b/kern/ipc_mig.h new file mode 100644 index 0000000..422e8d8 --- /dev/null +++ b/kern/ipc_mig.h @@ -0,0 +1,143 @@ +/* + * MIG IPC functions + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * + *  Author: Barry deFreese. + */ +/* + *     MIG IPC functions. + * + */ + +#ifndef _IPC_MIG_H_ +#define _IPC_MIG_H_ + +#include <mach/std_types.h> +#include <device/device_types.h> +#include <ipc/ipc_thread.h> + +/* + *  Routine:    mach_msg_send_from_kernel + *  Purpose: + *      Send a message from the kernel. + * + *      This is used by the client side of KernelUser interfaces + *      to implement SimpleRoutines.  Currently, this includes + *      device_reply and memory_object messages. + *  Conditions: + *      Nothing locked. + *  Returns: + *      MACH_MSG_SUCCESS    Sent the message. + *      MACH_SEND_INVALID_DATA  Bad destination port. + */ +extern mach_msg_return_t mach_msg_send_from_kernel( +    mach_msg_header_t   *msg, +    mach_msg_size_t     send_size); + +/* + *  Routine:    mach_msg_abort_rpc + *  Purpose: + *      Destroy the thread's ith_rpc_reply port. + *      This will interrupt a mach_msg_rpc_from_kernel + *      with a MACH_RCV_PORT_DIED return code. + *  Conditions: + *      Nothing locked. + */ +extern void mach_msg_abort_rpc (ipc_thread_t); + +extern mach_msg_return_t mach_msg_rpc_from_kernel( +    const mach_msg_header_t *msg, +    mach_msg_size_t send_size, +    mach_msg_size_t reply_size); + +extern kern_return_t syscall_vm_map( +	mach_port_name_t	target_map, +	rpc_vm_offset_t	*address, +	rpc_vm_size_t	size, +	rpc_vm_offset_t	mask, +	boolean_t	anywhere, +	mach_port_name_t	memory_object, +	rpc_vm_offset_t	offset, +	boolean_t	copy, +	vm_prot_t	cur_protection, +	vm_prot_t	max_protection, +	vm_inherit_t	inheritance); + +extern kern_return_t syscall_vm_allocate( +	mach_port_name_t	target_map, +	rpc_vm_offset_t		*address, +	rpc_vm_size_t		size, +	boolean_t		anywhere); + +extern kern_return_t syscall_vm_deallocate( +	mach_port_name_t	target_map, +	rpc_vm_offset_t		start, +	rpc_vm_size_t		size); + +extern kern_return_t syscall_task_create( +	mach_port_name_t	parent_task, +	boolean_t	        inherit_memory, +        mach_port_name_t	*child_task); + +extern kern_return_t syscall_task_terminate(mach_port_name_t task); + +extern kern_return_t syscall_task_suspend(mach_port_name_t task); + +extern kern_return_t syscall_task_set_special_port( +	mach_port_name_t	task, +	int		which_port, +	mach_port_name_t	port_name); + +extern kern_return_t syscall_mach_port_allocate( +	mach_port_name_t 		task, +	mach_port_right_t 		right, +	mach_port_name_t 		*namep); + +extern kern_return_t syscall_mach_port_deallocate( +	mach_port_name_t task, +	mach_port_name_t name); + +extern kern_return_t syscall_mach_port_insert_right( +	mach_port_name_t task, +	mach_port_name_t name, +	mach_port_name_t right, +	mach_msg_type_name_t rightType); + +extern kern_return_t syscall_mach_port_allocate_name( +	mach_port_name_t 		task, +	mach_port_right_t 		right, +	mach_port_name_t 		name); + +extern kern_return_t syscall_thread_depress_abort(mach_port_name_t thread); + +extern io_return_t syscall_device_write_request( +			mach_port_name_t	device_name, +			mach_port_name_t	reply_name, +			dev_mode_t	mode, +			rpc_recnum_t	recnum, +			rpc_vm_offset_t	data, +			rpc_vm_size_t	data_count); + +io_return_t syscall_device_writev_request( +			mach_port_name_t	device_name, +			mach_port_name_t	reply_name, +			dev_mode_t	mode, +			rpc_recnum_t	recnum, +			rpc_io_buf_vec_t	*iovec, +			rpc_vm_size_t	iocount); + +#endif /* _IPC_MIG_H_ */ | 
