summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kern/eventcount.h1
-rw-r--r--kern/ipc_mig.c1
-rw-r--r--kern/ipc_mig.h77
-rw-r--r--kern/syscall_sw.c23
4 files changed, 81 insertions, 21 deletions
diff --git a/kern/eventcount.h b/kern/eventcount.h
index 4a4125c..f3ba047 100644
--- a/kern/eventcount.h
+++ b/kern/eventcount.h
@@ -53,6 +53,7 @@ extern void evc_init(evc_t ev),
/* kernel and user visible */
extern kern_return_t evc_wait(natural_t ev_id);
+extern kern_return_t evc_wait_clear(natural_t ev_id);
extern void evc_notify_abort (thread_t thread);
diff --git a/kern/ipc_mig.c b/kern/ipc_mig.c
index 20339a2..3cd0f88 100644
--- a/kern/ipc_mig.c
+++ b/kern/ipc_mig.c
@@ -37,6 +37,7 @@
#include <kern/task.h>
#include <kern/ipc_kobject.h>
#include <kern/ipc_tt.h>
+#include <kern/ipc_mig.h>
#include <vm/vm_map.h>
#include <vm/vm_user.h>
#include <ipc/port.h>
diff --git a/kern/ipc_mig.h b/kern/ipc_mig.h
index f352bdc..3e368ae 100644
--- a/kern/ipc_mig.h
+++ b/kern/ipc_mig.h
@@ -27,6 +27,7 @@
#define _IPC_MIG_H_
#include <mach/std_types.h>
+#include <device/device_types.h>
/*
* Routine: mach_msg_send_from_kernel
@@ -62,4 +63,80 @@ extern mach_msg_return_t mach_msg_rpc_from_kernel(
mach_msg_size_t send_size,
mach_msg_size_t reply_size);
+extern kern_return_t syscall_vm_map(
+ mach_port_t target_map,
+ vm_offset_t *address,
+ vm_size_t size,
+ vm_offset_t mask,
+ boolean_t anywhere,
+ mach_port_t memory_object,
+ 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_t target_map,
+ vm_offset_t *address,
+ vm_size_t size,
+ boolean_t anywhere);
+
+extern kern_return_t syscall_vm_deallocate(
+ mach_port_t target_map,
+ vm_offset_t start,
+ vm_size_t size);
+
+extern kern_return_t syscall_task_create(
+ mach_port_t parent_task,
+ boolean_t inherit_memory,
+ mach_port_t *child_task);
+
+extern kern_return_t syscall_task_terminate(mach_port_t task);
+
+extern kern_return_t syscall_task_suspend(mach_port_t task);
+
+extern kern_return_t syscall_task_set_special_port(
+ mach_port_t task,
+ int which_port,
+ mach_port_t port_name);
+
+extern kern_return_t syscall_mach_port_allocate(
+ mach_port_t task,
+ mach_port_right_t right,
+ mach_port_t *namep);
+
+extern kern_return_t syscall_mach_port_deallocate(
+ mach_port_t task,
+ mach_port_t name);
+
+extern kern_return_t syscall_mach_port_insert_right(
+ mach_port_t task,
+ mach_port_t name,
+ mach_port_t right,
+ mach_msg_type_name_t rightType);
+
+extern kern_return_t syscall_mach_port_allocate_name(
+ mach_port_t task,
+ mach_port_right_t right,
+ mach_port_t name);
+
+extern kern_return_t syscall_thread_depress_abort(mach_port_t thread);
+
+extern io_return_t syscall_device_write_request(
+ mach_port_t device_name,
+ mach_port_t reply_name,
+ dev_mode_t mode,
+ recnum_t recnum,
+ vm_offset_t data,
+ vm_size_t data_count);
+
+io_return_t syscall_device_writev_request(
+ mach_port_t device_name,
+ mach_port_t reply_name,
+ dev_mode_t mode,
+ recnum_t recnum,
+ io_buf_vec_t *iovec,
+ vm_size_t iocount);
+
#endif /* _IPC_MIG_H_ */
diff --git a/kern/syscall_sw.c b/kern/syscall_sw.c
index 607d843..9397441 100644
--- a/kern/syscall_sw.c
+++ b/kern/syscall_sw.c
@@ -36,6 +36,8 @@
#include <mach/mach_traps.h>
#include <mach/message.h>
#include <kern/syscall_subr.h>
+#include <kern/ipc_mig.h>
+#include <kern/eventcount.h>
#include <ipc/mach_port.h>
@@ -70,27 +72,6 @@ kern_return_t kern_invalid()
return(KERN_INVALID_ARGUMENT);
}
-extern kern_return_t syscall_vm_map();
-extern kern_return_t syscall_vm_allocate();
-extern kern_return_t syscall_vm_deallocate();
-
-extern kern_return_t syscall_task_create();
-extern kern_return_t syscall_task_terminate();
-extern kern_return_t syscall_task_suspend();
-extern kern_return_t syscall_task_set_special_port();
-
-extern kern_return_t syscall_mach_port_allocate();
-extern kern_return_t syscall_mach_port_deallocate();
-extern kern_return_t syscall_mach_port_insert_right();
-extern kern_return_t syscall_mach_port_allocate_name();
-
-extern kern_return_t syscall_thread_depress_abort();
-extern kern_return_t evc_wait();
-extern kern_return_t evc_wait_clear();
-
-extern kern_return_t syscall_device_write_request();
-extern kern_return_t syscall_device_writev_request();
-
mach_trap_t mach_trap_table[] = {
MACH_TRAP(kern_invalid, 0), /* 0 */ /* Unix */
MACH_TRAP(kern_invalid, 0), /* 1 */ /* Unix */