Blame mach/mach.h

Packit 6c4009
/* Standard header for all Mach programs.
Packit 6c4009
   Copyright (C) 1993-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifndef	_MACH_H
Packit 6c4009
Packit 6c4009
#define	_MACH_H	1
Packit 6c4009
Packit 6c4009
#include <features.h>
Packit 6c4009
Packit 6c4009
/* Get the basic types used by Mach.  */
Packit 6c4009
#include <mach/mach_types.h>
Packit 6c4009
Packit 6c4009
/* This declares the basic variables and macros everything needs.  */
Packit 6c4009
#include <mach_init.h>
Packit 6c4009
Packit 6c4009
/* This declares all the real system call functions.  */
Packit 6c4009
#include <mach/mach_traps.h>
Packit 6c4009
Packit 6c4009
/* These are MiG-generated headers for the kernel interfaces commonly used.  */
Packit 6c4009
#include <mach/mach_interface.h> /* From <mach/mach.defs>.  */
Packit 6c4009
#include <mach/mach_port.h>
Packit 6c4009
#include <mach/mach_host.h>
Packit 6c4009
Packit 6c4009
/* For the kernel RPCs which have system call shortcut versions,
Packit 6c4009
   the MiG-generated header in fact declares `CALL_rpc' rather than `CALL'.
Packit 6c4009
   This file declares the simple `CALL' functions.  */
Packit 6c4009
#include <mach-shortcuts.h>
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Receive RPC request messages on RCV_NAME and pass them to DEMUX, which
Packit 6c4009
   decodes them and produces reply messages.  MAX_SIZE is the maximum size
Packit 6c4009
   (in bytes) of the request and reply buffers.  */
Packit 6c4009
extern mach_msg_return_t
Packit 6c4009
__mach_msg_server (boolean_t (*__demux) (mach_msg_header_t *__request,
Packit 6c4009
					 mach_msg_header_t *__reply),
Packit 6c4009
		   mach_msg_size_t __max_size,
Packit 6c4009
		   mach_port_t __rcv_name),
Packit 6c4009
mach_msg_server (boolean_t (*__demux) (mach_msg_header_t *__request,
Packit 6c4009
				       mach_msg_header_t *__reply),
Packit 6c4009
		 mach_msg_size_t __max_size,
Packit 6c4009
		 mach_port_t __rcv_name);
Packit 6c4009
Packit 6c4009
/* Just like `mach_msg_server', but the OPTION and TIMEOUT parameters are
Packit 6c4009
   passed on to `mach_msg'.  */
Packit 6c4009
extern mach_msg_return_t
Packit 6c4009
__mach_msg_server_timeout (boolean_t (*__demux) (mach_msg_header_t *__request,
Packit 6c4009
						 mach_msg_header_t *__reply),
Packit 6c4009
			   mach_msg_size_t __max_size,
Packit 6c4009
			   mach_port_t __rcv_name,
Packit 6c4009
			   mach_msg_option_t __option,
Packit 6c4009
			   mach_msg_timeout_t __timeout),
Packit 6c4009
mach_msg_server_timeout (boolean_t (*__demux) (mach_msg_header_t *__request,
Packit 6c4009
					       mach_msg_header_t *__reply),
Packit 6c4009
			 mach_msg_size_t __max_size,
Packit 6c4009
			 mach_port_t __rcv_name,
Packit 6c4009
			 mach_msg_option_t __option,
Packit 6c4009
			 mach_msg_timeout_t __timeout);
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Deallocate all port rights and out-of-line memory in MSG. */
Packit 6c4009
extern void
Packit 6c4009
__mach_msg_destroy (mach_msg_header_t *msg),
Packit 6c4009
mach_msg_destroy (mach_msg_header_t *msg);
Packit 6c4009
Packit 6c4009
#include <bits/types/FILE.h>
Packit 6c4009
Packit 6c4009
/* Open a stream on a Mach device.  */
Packit 6c4009
extern FILE *mach_open_devstream (mach_port_t device_port, const char *mode);
Packit 6c4009
Packit 6c4009
/* Give THREAD a stack and set it to run at PC when resumed.
Packit 6c4009
   If *STACK_SIZE is nonzero, that size of stack is allocated.
Packit 6c4009
   If *STACK_BASE is nonzero, that stack location is used.
Packit 6c4009
   If STACK_BASE is not null it is filled in with the chosen stack base.
Packit 6c4009
   If STACK_SIZE is not null it is filled in with the chosen stack size.
Packit 6c4009
   Regardless, an extra page of red zone is allocated off the end; this
Packit 6c4009
   is not included in *STACK_SIZE.  */
Packit 6c4009
kern_return_t __mach_setup_thread (task_t task, thread_t thread, void *pc,
Packit 6c4009
				   vm_address_t *stack_base,
Packit 6c4009
				   vm_size_t *stack_size);
Packit 6c4009
kern_return_t mach_setup_thread (task_t task, thread_t thread, void *pc,
Packit 6c4009
				 vm_address_t *stack_base,
Packit 6c4009
				 vm_size_t *stack_size);
Packit 6c4009
Packit 6c4009
/* Give THREAD a TLS area.  */
Packit 6c4009
kern_return_t __mach_setup_tls (thread_t thread);
Packit 6c4009
kern_return_t mach_setup_tls (thread_t thread);
Packit 6c4009
Packit 6c4009
#endif	/* mach.h */