summaryrefslogtreecommitdiff
path: root/include/mach/gnumach.defs
diff options
context:
space:
mode:
Diffstat (limited to 'include/mach/gnumach.defs')
-rw-r--r--include/mach/gnumach.defs47
1 files changed, 47 insertions, 0 deletions
diff --git a/include/mach/gnumach.defs b/include/mach/gnumach.defs
index 73313343..dd4da870 100644
--- a/include/mach/gnumach.defs
+++ b/include/mach/gnumach.defs
@@ -27,6 +27,11 @@ subsystem
#include <mach/std_types.defs>
#include <mach/mach_types.defs>
+#include <mach_debug/mach_debug_types.defs>
+
+#ifdef GNUMACH_IMPORTS
+GNUMACH_IMPORTS
+#endif
type vm_cache_statistics_data_t = struct[11] of integer_t;
@@ -37,3 +42,45 @@ type vm_cache_statistics_data_t = struct[11] of integer_t;
routine vm_cache_statistics(
target_task : vm_task_t;
out vm_cache_stats : vm_cache_statistics_data_t);
+
+/*
+ * Terminate a thread and release rights and memory.
+ *
+ * Intended to be used by threading libraries to provide a clean way for
+ * threads to terminate themselves. The resources a thread wouldn't be able
+ * to release without this call when terminating itself are its
+ * last reference to its kernel port, its reply port, and its stack.
+ *
+ * This call is semantically equivalent to :
+ * - mach_port_deallocate(task, thread_name);
+ * - if (reply_port != MACH_PORT_NULL)
+ * mach_port_destroy(task, reply_port);
+ * - if ((address != 0) || (size != 0))
+ * vm_deallocate(task, address, size)
+ * - thread_terminate(thread)
+ *
+ * Implemented as a simple routine so a reply port isn't required.
+ */
+simpleroutine thread_terminate_release(
+ thread : thread_t;
+ task : task_t;
+ thread_name : mach_port_name_t;
+ reply_port : mach_port_name_t;
+ address : vm_address_t;
+ size : vm_size_t);
+
+/*
+ * Set the name of task TASK to NAME. This is a debugging aid.
+ * NAME will be used in error messages printed by the kernel.
+ */
+simpleroutine task_set_name(
+ task : task_t;
+ name : kernel_debug_name_t);
+
+/*
+ * Register a port to which a notification about newly created tasks
+ * are sent.
+ */
+routine register_new_task_notification(
+ host_priv : host_priv_t;
+ notification : mach_port_send_t);