ipc_mig.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /*
  2. * MIG IPC functions
  3. * Copyright (C) 2008 Free Software Foundation, Inc.
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2, or (at your option)
  8. * any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  18. *
  19. * Author: Barry deFreese.
  20. */
  21. /*
  22. * MIG IPC functions.
  23. *
  24. */
  25. #ifndef _IPC_MIG_H_
  26. #define _IPC_MIG_H_
  27. #include <mach/std_types.h>
  28. #include <device/device_types.h>
  29. /*
  30. * Routine: mach_msg_send_from_kernel
  31. * Purpose:
  32. * Send a message from the kernel.
  33. *
  34. * This is used by the client side of KernelUser interfaces
  35. * to implement SimpleRoutines. Currently, this includes
  36. * device_reply and memory_object messages.
  37. * Conditions:
  38. * Nothing locked.
  39. * Returns:
  40. * MACH_MSG_SUCCESS Sent the message.
  41. * MACH_SEND_INVALID_DATA Bad destination port.
  42. */
  43. extern mach_msg_return_t mach_msg_send_from_kernel(
  44. mach_msg_header_t *msg,
  45. mach_msg_size_t send_size);
  46. /*
  47. * Routine: mach_msg_abort_rpc
  48. * Purpose:
  49. * Destroy the thread's ith_rpc_reply port.
  50. * This will interrupt a mach_msg_rpc_from_kernel
  51. * with a MACH_RCV_PORT_DIED return code.
  52. * Conditions:
  53. * Nothing locked.
  54. */
  55. extern void mach_msg_abort_rpc (ipc_thread_t);
  56. extern mach_msg_return_t mach_msg_rpc_from_kernel(
  57. const mach_msg_header_t *msg,
  58. mach_msg_size_t send_size,
  59. mach_msg_size_t reply_size);
  60. extern kern_return_t syscall_vm_map(
  61. mach_port_t target_map,
  62. vm_offset_t *address,
  63. vm_size_t size,
  64. vm_offset_t mask,
  65. boolean_t anywhere,
  66. mach_port_t memory_object,
  67. vm_offset_t offset,
  68. boolean_t copy,
  69. vm_prot_t cur_protection,
  70. vm_prot_t max_protection,
  71. vm_inherit_t inheritance);
  72. extern kern_return_t syscall_vm_allocate(
  73. mach_port_t target_map,
  74. vm_offset_t *address,
  75. vm_size_t size,
  76. boolean_t anywhere);
  77. extern kern_return_t syscall_vm_deallocate(
  78. mach_port_t target_map,
  79. vm_offset_t start,
  80. vm_size_t size);
  81. extern kern_return_t syscall_task_create(
  82. mach_port_t parent_task,
  83. boolean_t inherit_memory,
  84. mach_port_t *child_task);
  85. extern kern_return_t syscall_task_terminate(mach_port_t task);
  86. extern kern_return_t syscall_task_suspend(mach_port_t task);
  87. extern kern_return_t syscall_task_set_special_port(
  88. mach_port_t task,
  89. int which_port,
  90. mach_port_t port_name);
  91. extern kern_return_t syscall_mach_port_allocate(
  92. mach_port_t task,
  93. mach_port_right_t right,
  94. mach_port_t *namep);
  95. extern kern_return_t syscall_mach_port_deallocate(
  96. mach_port_t task,
  97. mach_port_t name);
  98. extern kern_return_t syscall_mach_port_insert_right(
  99. mach_port_t task,
  100. mach_port_t name,
  101. mach_port_t right,
  102. mach_msg_type_name_t rightType);
  103. extern kern_return_t syscall_mach_port_allocate_name(
  104. mach_port_t task,
  105. mach_port_right_t right,
  106. mach_port_t name);
  107. extern kern_return_t syscall_thread_depress_abort(mach_port_t thread);
  108. extern io_return_t syscall_device_write_request(
  109. mach_port_t device_name,
  110. mach_port_t reply_name,
  111. dev_mode_t mode,
  112. recnum_t recnum,
  113. vm_offset_t data,
  114. vm_size_t data_count);
  115. io_return_t syscall_device_writev_request(
  116. mach_port_t device_name,
  117. mach_port_t reply_name,
  118. dev_mode_t mode,
  119. recnum_t recnum,
  120. io_buf_vec_t *iovec,
  121. vm_size_t iocount);
  122. #endif /* _IPC_MIG_H_ */