this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Initial __sysctl() implementation LKM: Added thread_self_trap()

+6389 -27
+169
kernel/emulation/linux/misc/sysctl.c
··· 1 + #include "sysctl.h" 2 + #include "../base.h" 3 + #include "../errno.h" 4 + #include "../debug.h" 5 + #include <asm/unistd.h> 6 + #include <mach/host_info.h> 7 + #include <mach/machine.h> 8 + #include <mach/mach_init.h> 9 + #include "../../../../platform-include/sys/errno.h" 10 + #include "sysctl_inc.h" 11 + #include <stddef.h> 12 + #include <limits.h> 13 + 14 + static long sysctl_name_to_oid(const char* name, int* oid_name, 15 + unsigned long* oid_len); 16 + 17 + extern char *strchr(const char *s, int c); 18 + extern int strncmp(const char *s1, const char *s2, unsigned long n); 19 + extern int strcmp(const char *s1, const char *s2); 20 + extern kern_return_t mach_port_deallocate(ipc_space_t task, mach_port_name_t name); 21 + extern kern_return_t host_info(mach_port_name_t host, int itype, void* hinfo, mach_msg_type_number_t* count); 22 + 23 + /* Darling specific */ 24 + enum { 25 + _HW_PHYSICAL_CPU = 1000, 26 + _HW_PHYSICAL_CPU_MAX, 27 + _HW_LOGICAL_CPU, 28 + _HW_LOGICAL_CPU_MAX, 29 + _HW_CPUTYPE, 30 + _HW_CPUSUBTYPE, 31 + _HW_CPUTHREADTYPE 32 + }; 33 + 34 + long sys_sysctl(int* name, unsigned int nlen, void* old, 35 + unsigned long* oldlen, void* _new, unsigned long newlen) 36 + { 37 + int ret; 38 + 39 + if (nlen < 2) 40 + return -EINVAL; 41 + 42 + if (name[0] == 0 && name[1] == 3) 43 + { 44 + return sysctl_name_to_oid((const char*) _new, (int*) old, oldlen); 45 + } 46 + 47 + if (name[0] == CTL_HW) 48 + { 49 + int* ovalue = (int*) old; 50 + struct host_basic_info hinfo; 51 + mach_msg_type_number_t hcount = HOST_BASIC_INFO_COUNT; 52 + mach_port_t hself; 53 + unsigned long orig_old_len = *oldlen; 54 + 55 + hself = mach_host_self(); 56 + host_info(hself, HOST_BASIC_INFO, &hinfo, &hcount); 57 + mach_port_deallocate(mach_task_self(), hself); 58 + 59 + if (nlen != 2) 60 + return -ENOTDIR; 61 + 62 + if (*oldlen < sizeof(int)) 63 + return -EINVAL; 64 + *oldlen = sizeof(int); 65 + 66 + switch (name[1]) 67 + { 68 + case HW_AVAILCPU: 69 + case HW_NCPU: 70 + *ovalue = hinfo.avail_cpus; 71 + return 0; 72 + case _HW_PHYSICAL_CPU: 73 + *ovalue = hinfo.physical_cpu; 74 + return 0; 75 + case _HW_PHYSICAL_CPU_MAX: 76 + *ovalue = hinfo.physical_cpu_max; 77 + return 0; 78 + case _HW_LOGICAL_CPU: 79 + *ovalue = hinfo.logical_cpu; 80 + return 0; 81 + case _HW_LOGICAL_CPU_MAX: 82 + *ovalue = hinfo.logical_cpu_max; 83 + return 0; 84 + case HW_MEMSIZE: 85 + case HW_PHYSMEM: 86 + case HW_USERMEM: 87 + if (orig_old_len == sizeof(int)) 88 + { 89 + if (hinfo.max_mem < INT_MAX) 90 + *ovalue = hinfo.max_mem; 91 + else 92 + *ovalue = INT_MAX; 93 + } 94 + else 95 + { 96 + *oldlen = 2 * sizeof(int); 97 + *((unsigned long long*) ovalue) = hinfo.max_mem; 98 + } 99 + return 0; 100 + case HW_PAGESIZE: 101 + *ovalue = 4096; // True on all Darling platforms 102 + return 0; 103 + case _HW_CPUTYPE: 104 + *ovalue = hinfo.cpu_type; 105 + return 0; 106 + case _HW_CPUSUBTYPE: 107 + *ovalue = hinfo.cpu_subtype; 108 + return 0; 109 + case _HW_CPUTHREADTYPE: 110 + *ovalue = hinfo.cpu_threadtype; 111 + return 0; 112 + } 113 + } 114 + 115 + return -ENOTDIR; 116 + } 117 + 118 + static long sysctl_name_to_oid(const char* name, int* oid_name, 119 + unsigned long* oid_len) 120 + { 121 + const char* dot; 122 + unsigned long cat_len; 123 + 124 + if (*oid_len < 2) 125 + return -EINVAL; 126 + 127 + dot = strchr(name, '.'); 128 + if (dot == NULL) 129 + return -ENOTDIR; 130 + 131 + cat_len = dot - name; 132 + 133 + if (strncmp(name, "hw", cat_len) == 0) 134 + { 135 + oid_name[0] = CTL_HW; 136 + *oid_len = 2 * sizeof(int); 137 + 138 + if (strcmp(dot+1, "activecpu") == 0) 139 + oid_name[1] = HW_AVAILCPU; 140 + else if (strcmp(dot+1, "ncpu") == 0) 141 + oid_name[1] = HW_NCPU; 142 + else if (strcmp(dot+1, "physicalcpu") == 0) 143 + oid_name[1] = _HW_PHYSICAL_CPU; 144 + else if (strcmp(dot+1, "physicalcpu_max") == 0) 145 + oid_name[1] = _HW_PHYSICAL_CPU_MAX; 146 + else if (strcmp(dot+1, "logicalcpu") == 0) 147 + oid_name[1] = _HW_LOGICAL_CPU; 148 + else if (strcmp(dot+1, "logicalcpu_max") == 0) 149 + oid_name[1] = _HW_LOGICAL_CPU_MAX; 150 + else if (strcmp(dot+1, "memsize") == 0) 151 + oid_name[1] = HW_MEMSIZE; 152 + else if (strcmp(dot+1, "pagesize") == 0) 153 + oid_name[1] = HW_PAGESIZE; 154 + else if (strcmp(dot+1, "cputype") == 0) 155 + oid_name[1] = _HW_CPUTYPE; 156 + else if (strcmp(dot+1, "cpusubtype") == 0) 157 + oid_name[1] = _HW_CPUSUBTYPE; 158 + else if (strcmp(dot+1, "cputhreadtype") == 0) 159 + oid_name[1] = _HW_CPUTHREADTYPE; 160 + else 161 + return -ENOTDIR; 162 + 163 + return 0; 164 + } 165 + 166 + __simple_printf("Unknown sysctl: %s\n", name); 167 + return -ENOTDIR; 168 + } 169 +
+7
kernel/emulation/linux/misc/sysctl.h
··· 1 + #ifndef LINUX_SYSCTL_H 2 + #define LINUX_SYSCTL_H 3 + 4 + long sys_sysctl(int* name, unsigned int nlen, void* old, unsigned long* oldlen, void* _new, unsigned long newlen); 5 + 6 + #endif 7 +
+47
kernel/emulation/linux/misc/sysctl_inc.h
··· 1 + #ifndef SYSCTL_INC_H 2 + #define SYSCTL_INC_H 3 + 4 + // Copy & pasted from sysctl.h, because including that file 5 + // is problematic (include collisions). 6 + 7 + #define CTL_UNSPEC 0 8 + #define CTL_KERN 1 9 + #define CTL_VM 2 10 + #define CTL_VFS 3 11 + #define CTL_NET 4 12 + #define CTL_DEBUG 5 13 + #define CTL_HW 6 14 + #define CTL_MACHDEP 7 15 + #define CTL_USER 8 16 + #define CTL_MAXID 9 17 + 18 + 19 + #define HW_MACHINE 1 20 + #define HW_MODEL 2 21 + #define HW_NCPU 3 22 + #define HW_BYTEORDER 4 23 + #define HW_PHYSMEM 5 24 + #define HW_USERMEM 6 25 + #define HW_PAGESIZE 7 26 + #define HW_DISKNAMES 8 27 + #define HW_DISKSTATS 9 28 + #define HW_EPOCH 10 29 + #define HW_FLOATINGPT 11 30 + #define HW_MACHINE_ARCH 12 31 + #define HW_VECTORUNIT 13 32 + #define HW_BUS_FREQ 14 33 + #define HW_CPU_FREQ 15 34 + #define HW_CACHELINE 16 35 + #define HW_L1ICACHESIZE 17 36 + #define HW_L1DCACHESIZE 18 37 + #define HW_L2SETTINGS 19 38 + #define HW_L2CACHESIZE 20 39 + #define HW_L3SETTINGS 21 40 + #define HW_L3CACHESIZE 22 41 + #define HW_TB_FREQ 23 42 + #define HW_MEMSIZE 24 43 + #define HW_AVAILCPU 25 44 + #define HW_MAXID 26 45 + 46 + #endif 47 +
+1 -2
kernel/mach_server/client/mach_traps.c
··· 40 40 41 41 mach_port_name_t thread_self_trap(void) 42 42 { 43 - UNIMPLEMENTED_TRAP(); 44 - return 0; 43 + return ioctl(driver_fd, NR_thread_self_trap, 0); 45 44 } 46 45 47 46 mach_port_name_t host_self_trap(void)
+4 -2
lkm/Makefile
··· 7 7 -Wno-undef 8 8 9 9 CFLAGS_taskServer.o := -Dsemaphore_consume_ref_t=semaphore_t 10 + CFLAGS_thread_actServer.o := -Dthread_act_consume_ref_t=thread_act_t 10 11 11 12 # If KERNELRELEASE is defined, we've been invoked from the 12 13 # kernel build system and can use its language. ··· 18 19 servers/mach_host.o servers/clock.o \ 19 20 servers/task.o primitives/semaphore.o \ 20 21 mig/clockServer.o mig/mach_hostServer.o \ 21 - mig/taskServer.o \ 22 - mig/duct.o proc_entry.o 22 + mig/taskServer.o mig/thread_actServer.o \ 23 + servers/thread_act.o \ 24 + mig/duct.o proc_entry.o bsd_ioctl.o 23 25 24 26 # Otherwise we were called directly from the command 25 27 # line; invoke the kernel build system.
+10 -1
lkm/api.h
··· 39 39 NR_semaphore_wait_trap, 40 40 NR_semaphore_wait_signal_trap, 41 41 NR_semaphore_timedwait_signal_trap, 42 - NR_semaphore_timedwait_trap 42 + NR_semaphore_timedwait_trap, 43 + NR_bsd_ioctl_trap, 44 + NR_thread_self_trap 43 45 }; 44 46 45 47 struct mach_port_mod_refs_args ··· 116 118 unsigned int wait; 117 119 unsigned int sec; 118 120 unsigned int nsec; 121 + }; 122 + 123 + struct bsd_ioctl_args 124 + { 125 + int fd; 126 + unsigned long long request; 127 + unsigned long long arg; 119 128 }; 120 129 121 130 #endif
+35
lkm/bsd_ioctl.c
··· 1 + /* 2 + * Darling Mach Linux Kernel Module 3 + * Copyright (C) 2015 Lubos Dolezel 4 + * 5 + * This program is free software; you can redistribute it and/or 6 + * modify it under the terms of the GNU General Public License 7 + * as published by the Free Software Foundation; either version 2 8 + * of the License, or (at your option) 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, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 + */ 19 + 20 + #include "bsd_ioctl.h" 21 + 22 + void bsd_ioctl_xlate_socket(struct bsd_ioctl_args* args) 23 + { 24 + 25 + } 26 + 27 + void bsd_ioctl_xlate_tty(struct bsd_ioctl_args* args) 28 + { 29 + 30 + } 31 + 32 + void bsd_ioctl_xlate_pts(struct bsd_ioctl_args* args) 33 + { 34 + 35 + }
+28
lkm/bsd_ioctl.h
··· 1 + /* 2 + * Darling Mach Linux Kernel Module 3 + * Copyright (C) 2015 Lubos Dolezel 4 + * 5 + * This program is free software; you can redistribute it and/or 6 + * modify it under the terms of the GNU General Public License 7 + * as published by the Free Software Foundation; either version 2 8 + * of the License, or (at your option) 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, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 + */ 19 + 20 + #ifndef BSD_IOCTL_H 21 + #define BSD_IOCTL_H 22 + #include "api.h" 23 + 24 + void bsd_ioctl_xlate_socket(struct bsd_ioctl_args* args); 25 + void bsd_ioctl_xlate_tty(struct bsd_ioctl_args* args); 26 + void bsd_ioctl_xlate_pts(struct bsd_ioctl_args* args); 27 + 28 + #endif
+145 -9
lkm/darling_task.c
··· 19 19 20 20 #include "darling_task.h" 21 21 #include "debug.h" 22 - #include <linux/spinlock.h> 23 22 #include <linux/rbtree.h> 24 23 #include <linux/slab.h> 25 24 #include <linux/sched.h> 26 25 #include <linux/printk.h> 26 + #include <linux/rwlock.h> 27 + #include "servers/thread_act.h" 27 28 28 - static spinlock_t my_lock; 29 + static rwlock_t my_lock; 29 30 static struct rb_root all_tasks = RB_ROOT; 30 31 static unsigned int task_count = 0; 31 32 ··· 39 40 void 40 41 darling_task_init(void) 41 42 { 42 - spin_lock_init(&my_lock); 43 + rwlock_init(&my_lock); 43 44 } 44 45 45 46 unsigned int ··· 54 55 mach_task_t* ret = NULL; 55 56 struct rb_node* node; 56 57 57 - spin_lock(&my_lock); 58 + read_lock(&my_lock); 58 59 59 60 node = all_tasks.rb_node; 60 61 ··· 73 74 } 74 75 } 75 76 76 - spin_unlock(&my_lock); 77 + read_unlock(&my_lock); 77 78 return ret; 78 79 } 79 80 ··· 83 84 struct task_entry* entry; 84 85 struct rb_node **new, *parent = NULL; 85 86 86 - entry = (struct task_entry*) kmalloc(sizeof(mach_task_t), GFP_KERNEL); 87 + entry = (struct task_entry*) kmalloc(sizeof(struct task_entry), GFP_KERNEL); 87 88 entry->task = task; 88 89 entry->tgid = current->tgid; 89 90 90 - spin_lock(&my_lock); 91 + write_lock(&my_lock); 91 92 new = &all_tasks.rb_node; 92 93 93 94 while (*new) ··· 119 120 task_count--; 120 121 } 121 122 122 - spin_unlock(&my_lock); 123 + write_unlock(&my_lock); 123 124 return; 124 125 } 125 126 } ··· 128 129 rb_insert_color(&entry->node, &all_tasks); 129 130 task_count++; 130 131 131 - spin_unlock(&my_lock); 132 + write_unlock(&my_lock); 133 + } 134 + 135 + struct thread_entry 136 + { 137 + struct rb_node node; 138 + darling_mach_port_t* thread_port; 139 + }; 140 + 141 + void darling_task_register_thread(mach_task_t* task, 142 + darling_mach_port_t* thread_port) 143 + { 144 + struct thread_entry* entry; 145 + struct rb_node **new, *parent = NULL; 146 + pid_t my_pid; 147 + 148 + my_pid = get_thread_pid(thread_port); 149 + 150 + write_lock(&task->threads_lock); 151 + 152 + entry = (struct thread_entry*) kmalloc(sizeof(struct thread_entry), 153 + GFP_KERNEL); 154 + entry->thread_port = thread_port; 155 + 156 + new = &task->threads.rb_node; 157 + 158 + while (*new) 159 + { 160 + struct thread_entry* this = container_of(*new, 161 + struct thread_entry, node); 162 + parent = *new; 163 + 164 + if (my_pid < get_thread_pid(this->thread_port)) 165 + new = &(*new)->rb_left; 166 + else if (my_pid > get_thread_pid(this->thread_port)) 167 + new = &(*new)->rb_right; 168 + else 169 + { 170 + debug_msg("darling_task_register_thread(): " 171 + "PID already registered (%d)!\n", my_pid); 172 + 173 + write_unlock(&task->threads_lock); 174 + kfree(entry); 175 + return; 176 + } 177 + } 178 + 179 + rb_link_node(&entry->node, parent, new); 180 + rb_insert_color(&entry->node, &task->threads); 181 + 182 + write_unlock(&task->threads_lock); 183 + } 184 + 185 + void darling_task_deregister_thread(mach_task_t* task, 186 + darling_mach_port_t* thread_port) 187 + { 188 + struct rb_node *node; 189 + pid_t my_pid; 190 + 191 + my_pid = get_thread_pid(thread_port); 192 + 193 + write_lock(&task->threads_lock); 194 + 195 + node = task->threads.rb_node; 196 + 197 + while (node) 198 + { 199 + struct thread_entry* entry = container_of(node, 200 + struct thread_entry, node); 201 + 202 + if (my_pid < get_thread_pid(entry->thread_port)) 203 + node = node->rb_left; 204 + else if (my_pid > get_thread_pid(entry->thread_port)) 205 + node = node->rb_right; 206 + else 207 + { 208 + rb_erase(node, &task->threads); 209 + kfree(entry); 210 + break; 211 + } 212 + } 213 + 214 + write_unlock(&task->threads_lock); 215 + } 216 + 217 + void darling_task_free_threads(mach_task_t* task) 218 + { 219 + struct rb_node *node, *next; 220 + struct thread_entry* entry; 221 + 222 + write_lock(&task->threads_lock); 223 + 224 + node = rb_first(&task->threads); 225 + while (node != NULL) 226 + { 227 + entry = container_of(node, struct thread_entry, node); 228 + 229 + ipc_port_put(entry->thread_port); 230 + 231 + next = rb_next(node); 232 + 233 + kfree(entry); 234 + node = next; 235 + } 236 + 237 + task->threads.rb_node = NULL; 238 + write_unlock(&task->threads_lock); 239 + } 240 + 241 + darling_mach_port_t* darling_task_lookup_thread(mach_task_t* task, 242 + pid_t pid) 243 + { 244 + struct rb_node *node; 245 + darling_mach_port_t* ret = NULL; 246 + 247 + read_lock(&task->threads_lock); 248 + node = task->threads.rb_node; 249 + 250 + while (node) 251 + { 252 + struct thread_entry* entry = container_of(node, 253 + struct thread_entry, node); 254 + 255 + if (pid < get_thread_pid(entry->thread_port)) 256 + node = node->rb_left; 257 + else if (pid > get_thread_pid(entry->thread_port)) 258 + node = node->rb_right; 259 + else 260 + { 261 + ret = entry->thread_port; 262 + break; 263 + } 264 + } 265 + 266 + read_unlock(&task->threads_lock); 267 + return ret; 132 268 }
+14
lkm/darling_task.h
··· 23 23 #include "ipc_space.h" 24 24 #include "ipc_port.h" 25 25 #include <linux/thread_info.h> 26 + #include <linux/rbtree.h> 27 + #include <linux/spinlock.h> 26 28 27 29 struct mach_task 28 30 { ··· 31 33 32 34 // TODO: add bootstrap port 33 35 darling_mach_port_t* task_self; 36 + 37 + rwlock_t threads_lock; 38 + struct rb_root threads; 34 39 }; 35 40 36 41 typedef struct mach_task mach_task_t; ··· 47 52 48 53 unsigned int 49 54 darling_get_task_count(void); 55 + 56 + void darling_task_register_thread(mach_task_t* task, 57 + darling_mach_port_t* thread_port); 58 + void darling_task_deregister_thread(mach_task_t* task, 59 + darling_mach_port_t* thread_port); 60 + darling_mach_port_t* darling_task_lookup_thread(mach_task_t* task, 61 + pid_t thread); 62 + 63 + void darling_task_free_threads(mach_task_t* task); 50 64 51 65 static inline bool 52 66 task_is_64bit(void)
+9 -1
lkm/ipc_server.c
··· 20 20 #include "mach_includes.h" 21 21 #include "ipc_server.h" 22 22 #include <linux/slab.h> 23 + #include <linux/rwlock.h> 23 24 #include "darling_task.h" 24 25 #include "debug.h" 25 26 ··· 31 32 32 33 task = (mach_task_t*) kport->private_data; 33 34 35 + darling_task_free_threads(task); 36 + 34 37 /* Deallocate the port right space. Deletes all references. */ 35 38 ipc_space_put(&task->namespace); 36 39 37 40 kfree(task); 38 41 } 39 42 40 - void ipc_port_make_task(darling_mach_port_t* port, pid_t pid) 43 + mach_task_t* ipc_port_make_task(darling_mach_port_t* port, pid_t pid) 41 44 { 42 45 mach_task_t* task; 43 46 44 47 task = (mach_task_t*) kmalloc(sizeof(mach_task_t), GFP_KERNEL); 45 48 task->pid = pid; 46 49 task->task_self = port; 50 + task->threads.rb_node = NULL; 51 + 52 + rwlock_init(&task->threads_lock); 47 53 48 54 ipc_space_init(&task->namespace); 49 55 ··· 51 57 port->server_port.subsystem = &task_subsystem; 52 58 port->server_port.private_data = task; 53 59 port->server_port.cb_free = task_free; 60 + 61 + return task; 54 62 } 55 63 56 64 mach_task_t* ipc_port_get_task(darling_mach_port_t* port)
+1 -1
lkm/ipc_server.h
··· 31 31 * will be invoked. 32 32 */ 33 33 34 - void ipc_port_make_task(darling_mach_port_t* port, pid_t pid); 34 + mach_task_t* ipc_port_make_task(darling_mach_port_t* port, pid_t pid); 35 35 mach_task_t* ipc_port_get_task(darling_mach_port_t* port); 36 36 37 37 #endif
+2793
lkm/mig/thread_actServer.c
··· 1 + /* 2 + * IDENTIFICATION: 3 + * stub generated Tue Oct 13 20:25:16 2015 4 + * with a MiG generated by 1.0 5 + * OPTIONS: 6 + */ 7 + 8 + /* Module thread_act */ 9 + 10 + #define __MIG_check__Request__thread_act_subsystem__ 1 11 + 12 + #include "thread_actServer.h" 13 + 14 + #ifndef mig_internal 15 + #define mig_internal static __inline__ 16 + #endif /* mig_internal */ 17 + 18 + #ifndef mig_external 19 + #define mig_external 20 + #endif /* mig_external */ 21 + 22 + #if !defined(__MigTypeCheck) && defined(TypeCheck) 23 + #define __MigTypeCheck TypeCheck /* Legacy setting */ 24 + #endif /* !defined(__MigTypeCheck) */ 25 + 26 + #if !defined(__MigKernelSpecificCode) && defined(_MIG_KERNEL_SPECIFIC_CODE_) 27 + #define __MigKernelSpecificCode _MIG_KERNEL_SPECIFIC_CODE_ /* Legacy setting */ 28 + #endif /* !defined(__MigKernelSpecificCode) */ 29 + 30 + #ifndef LimitCheck 31 + #define LimitCheck 0 32 + #endif /* LimitCheck */ 33 + 34 + #ifndef min 35 + #define min(a,b) ( ((a) < (b))? (a): (b) ) 36 + #endif /* min */ 37 + 38 + #if !defined(_WALIGN_) 39 + #define _WALIGN_(x) (((x) + 7) & ~7) 40 + #endif /* !defined(_WALIGN_) */ 41 + 42 + #if !defined(_WALIGNSZ_) 43 + #define _WALIGNSZ_(x) _WALIGN_(sizeof(x)) 44 + #endif /* !defined(_WALIGNSZ_) */ 45 + 46 + #ifndef UseStaticTemplates 47 + #define UseStaticTemplates 0 48 + #endif /* UseStaticTemplates */ 49 + 50 + #ifndef __DeclareRcvRpc 51 + #define __DeclareRcvRpc(_NUM_, _NAME_) 52 + #endif /* __DeclareRcvRpc */ 53 + 54 + #ifndef __BeforeRcvRpc 55 + #define __BeforeRcvRpc(_NUM_, _NAME_) 56 + #endif /* __BeforeRcvRpc */ 57 + 58 + #ifndef __AfterRcvRpc 59 + #define __AfterRcvRpc(_NUM_, _NAME_) 60 + #endif /* __AfterRcvRpc */ 61 + 62 + #ifndef __DeclareRcvSimple 63 + #define __DeclareRcvSimple(_NUM_, _NAME_) 64 + #endif /* __DeclareRcvSimple */ 65 + 66 + #ifndef __BeforeRcvSimple 67 + #define __BeforeRcvSimple(_NUM_, _NAME_) 68 + #endif /* __BeforeRcvSimple */ 69 + 70 + #ifndef __AfterRcvSimple 71 + #define __AfterRcvSimple(_NUM_, _NAME_) 72 + #endif /* __AfterRcvSimple */ 73 + 74 + #define novalue void 75 + 76 + #define msgh_request_port msgh_local_port 77 + #define MACH_MSGH_BITS_REQUEST(bits) MACH_MSGH_BITS_LOCAL(bits) 78 + #define msgh_reply_port msgh_remote_port 79 + #define MACH_MSGH_BITS_REPLY(bits) MACH_MSGH_BITS_REMOTE(bits) 80 + 81 + #define MIG_RETURN_ERROR(X, code) {\ 82 + ((mig_reply_error_t *)X)->RetCode = code;\ 83 + ((mig_reply_error_t *)X)->NDR = NDR_record;\ 84 + return;\ 85 + } 86 + 87 + /* Forward Declarations */ 88 + 89 + 90 + mig_internal novalue _Xthread_terminate 91 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); 92 + 93 + mig_internal novalue _Xact_get_state 94 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); 95 + 96 + mig_internal novalue _Xact_set_state 97 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); 98 + 99 + mig_internal novalue _Xthread_get_state 100 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); 101 + 102 + mig_internal novalue _Xthread_set_state 103 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); 104 + 105 + mig_internal novalue _Xthread_suspend 106 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); 107 + 108 + mig_internal novalue _Xthread_resume 109 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); 110 + 111 + mig_internal novalue _Xthread_abort 112 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); 113 + 114 + mig_internal novalue _Xthread_abort_safely 115 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); 116 + 117 + mig_internal novalue _Xthread_depress_abort 118 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); 119 + 120 + mig_internal novalue _Xthread_get_special_port 121 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); 122 + 123 + mig_internal novalue _Xthread_set_special_port 124 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); 125 + 126 + mig_internal novalue _Xthread_info 127 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); 128 + 129 + mig_internal novalue _Xthread_set_exception_ports 130 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); 131 + 132 + mig_internal novalue _Xthread_get_exception_ports 133 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); 134 + 135 + mig_internal novalue _Xthread_swap_exception_ports 136 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); 137 + 138 + mig_internal novalue _X_kernelrpc_thread_policy 139 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); 140 + 141 + mig_internal novalue _X_kernelrpc_thread_policy_set 142 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); 143 + 144 + mig_internal novalue _Xthread_policy_get 145 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); 146 + 147 + mig_internal novalue _Xthread_sample 148 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); 149 + 150 + mig_internal novalue _Xetap_trace_thread 151 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); 152 + 153 + mig_internal novalue _Xthread_assign 154 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); 155 + 156 + mig_internal novalue _Xthread_assign_default 157 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); 158 + 159 + mig_internal novalue _Xthread_get_assignment 160 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); 161 + 162 + mig_internal novalue _X_kernelrpc_thread_set_policy 163 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); 164 + 165 + mig_internal novalue _Xthread_get_mach_voucher 166 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); 167 + 168 + mig_internal novalue _Xthread_set_mach_voucher 169 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); 170 + 171 + mig_internal novalue _Xthread_swap_mach_voucher 172 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); 173 + 174 + 175 + #if ( __MigTypeCheck ) 176 + #if __MIG_check__Request__thread_act_subsystem__ 177 + #if !defined(__MIG_check__Request__thread_terminate_t__defined) 178 + #define __MIG_check__Request__thread_terminate_t__defined 179 + 180 + mig_internal kern_return_t __MIG_check__Request__thread_terminate_t(__attribute__((__unused__)) __Request__thread_terminate_t *In0P) 181 + { 182 + 183 + typedef __Request__thread_terminate_t __Request; 184 + #if __MigTypeCheck 185 + if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || 186 + (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) 187 + return MIG_BAD_ARGUMENTS; 188 + #endif /* __MigTypeCheck */ 189 + 190 + return MACH_MSG_SUCCESS; 191 + } 192 + #endif /* !defined(__MIG_check__Request__thread_terminate_t__defined) */ 193 + #endif /* __MIG_check__Request__thread_act_subsystem__ */ 194 + #endif /* ( __MigTypeCheck ) */ 195 + 196 + 197 + /* Routine thread_terminate */ 198 + mig_internal novalue _Xthread_terminate 199 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) 200 + { 201 + 202 + #ifdef __MigPackStructs 203 + #pragma pack(8) 204 + #endif 205 + typedef struct { 206 + mach_msg_header_t Head; 207 + mach_msg_trailer_t trailer; 208 + } Request; 209 + #ifdef __MigPackStructs 210 + #pragma pack() 211 + #endif 212 + typedef __Request__thread_terminate_t __Request; 213 + typedef __Reply__thread_terminate_t Reply; 214 + 215 + /* 216 + * typedef struct { 217 + * mach_msg_header_t Head; 218 + * NDR_record_t NDR; 219 + * kern_return_t RetCode; 220 + * } mig_reply_error_t; 221 + */ 222 + 223 + Request *In0P = (Request *) InHeadP; 224 + Reply *OutP = (Reply *) OutHeadP; 225 + #ifdef __MIG_check__Request__thread_terminate_t__defined 226 + kern_return_t check_result; 227 + #endif /* __MIG_check__Request__thread_terminate_t__defined */ 228 + 229 + __DeclareRcvRpc(3600, "thread_terminate") 230 + __BeforeRcvRpc(3600, "thread_terminate") 231 + 232 + #if defined(__MIG_check__Request__thread_terminate_t__defined) 233 + check_result = __MIG_check__Request__thread_terminate_t((__Request *)In0P); 234 + if (check_result != MACH_MSG_SUCCESS) 235 + { MIG_RETURN_ERROR(OutP, check_result); } 236 + #endif /* defined(__MIG_check__Request__thread_terminate_t__defined) */ 237 + 238 + OutP->RetCode = thread_terminate(In0P->Head.msgh_request_port); 239 + 240 + OutP->NDR = NDR_record; 241 + 242 + 243 + __AfterRcvRpc(3600, "thread_terminate") 244 + } 245 + 246 + #if ( __MigTypeCheck ) 247 + #if __MIG_check__Request__thread_act_subsystem__ 248 + #if !defined(__MIG_check__Request__act_get_state_t__defined) 249 + #define __MIG_check__Request__act_get_state_t__defined 250 + 251 + mig_internal kern_return_t __MIG_check__Request__act_get_state_t(__attribute__((__unused__)) __Request__act_get_state_t *In0P) 252 + { 253 + 254 + typedef __Request__act_get_state_t __Request; 255 + #if __MigTypeCheck 256 + if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || 257 + (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) 258 + return MIG_BAD_ARGUMENTS; 259 + #endif /* __MigTypeCheck */ 260 + 261 + return MACH_MSG_SUCCESS; 262 + } 263 + #endif /* !defined(__MIG_check__Request__act_get_state_t__defined) */ 264 + #endif /* __MIG_check__Request__thread_act_subsystem__ */ 265 + #endif /* ( __MigTypeCheck ) */ 266 + 267 + 268 + /* Routine act_get_state */ 269 + mig_internal novalue _Xact_get_state 270 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) 271 + { 272 + 273 + #ifdef __MigPackStructs 274 + #pragma pack(8) 275 + #endif 276 + typedef struct { 277 + mach_msg_header_t Head; 278 + NDR_record_t NDR; 279 + int flavor; 280 + mach_msg_type_number_t old_stateCnt; 281 + mach_msg_trailer_t trailer; 282 + } Request; 283 + #ifdef __MigPackStructs 284 + #pragma pack() 285 + #endif 286 + typedef __Request__act_get_state_t __Request; 287 + typedef __Reply__act_get_state_t Reply; 288 + 289 + /* 290 + * typedef struct { 291 + * mach_msg_header_t Head; 292 + * NDR_record_t NDR; 293 + * kern_return_t RetCode; 294 + * } mig_reply_error_t; 295 + */ 296 + 297 + Request *In0P = (Request *) InHeadP; 298 + Reply *OutP = (Reply *) OutHeadP; 299 + #ifdef __MIG_check__Request__act_get_state_t__defined 300 + kern_return_t check_result; 301 + #endif /* __MIG_check__Request__act_get_state_t__defined */ 302 + 303 + __DeclareRcvRpc(3601, "act_get_state") 304 + __BeforeRcvRpc(3601, "act_get_state") 305 + 306 + #if defined(__MIG_check__Request__act_get_state_t__defined) 307 + check_result = __MIG_check__Request__act_get_state_t((__Request *)In0P); 308 + if (check_result != MACH_MSG_SUCCESS) 309 + { MIG_RETURN_ERROR(OutP, check_result); } 310 + #endif /* defined(__MIG_check__Request__act_get_state_t__defined) */ 311 + 312 + OutP->old_stateCnt = 224; 313 + if (In0P->old_stateCnt < OutP->old_stateCnt) 314 + OutP->old_stateCnt = In0P->old_stateCnt; 315 + 316 + OutP->RetCode = act_get_state(In0P->Head.msgh_request_port, In0P->flavor, OutP->old_state, &OutP->old_stateCnt); 317 + if (OutP->RetCode != KERN_SUCCESS) { 318 + MIG_RETURN_ERROR(OutP, OutP->RetCode); 319 + } 320 + 321 + OutP->NDR = NDR_record; 322 + 323 + OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 896) + (_WALIGN_((4 * OutP->old_stateCnt + 7) & ~7)); 324 + 325 + __AfterRcvRpc(3601, "act_get_state") 326 + } 327 + 328 + #if ( __MigTypeCheck ) 329 + #if __MIG_check__Request__thread_act_subsystem__ 330 + #if !defined(__MIG_check__Request__act_set_state_t__defined) 331 + #define __MIG_check__Request__act_set_state_t__defined 332 + 333 + mig_internal kern_return_t __MIG_check__Request__act_set_state_t(__attribute__((__unused__)) __Request__act_set_state_t *In0P) 334 + { 335 + 336 + typedef __Request__act_set_state_t __Request; 337 + #if __MigTypeCheck 338 + unsigned int msgh_size; 339 + #endif /* __MigTypeCheck */ 340 + 341 + #if __MigTypeCheck 342 + msgh_size = In0P->Head.msgh_size; 343 + if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || 344 + (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 896)) || (msgh_size > (mach_msg_size_t)sizeof(__Request))) 345 + return MIG_BAD_ARGUMENTS; 346 + #endif /* __MigTypeCheck */ 347 + 348 + #if defined(__NDR_convert__int_rep__Request__act_set_state_t__new_stateCnt__defined) 349 + if (In0P->NDR.int_rep != NDR_record.int_rep) 350 + __NDR_convert__int_rep__Request__act_set_state_t__new_stateCnt(&In0P->new_stateCnt, In0P->NDR.int_rep); 351 + #endif /* __NDR_convert__int_rep__Request__act_set_state_t__new_stateCnt__defined */ 352 + #if __MigTypeCheck 353 + if ( In0P->new_stateCnt > 224 ) 354 + return MIG_BAD_ARGUMENTS; 355 + if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 896)) / 4 < In0P->new_stateCnt) || 356 + (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 896) + _WALIGN_(4 * In0P->new_stateCnt))) 357 + return MIG_BAD_ARGUMENTS; 358 + #endif /* __MigTypeCheck */ 359 + 360 + return MACH_MSG_SUCCESS; 361 + } 362 + #endif /* !defined(__MIG_check__Request__act_set_state_t__defined) */ 363 + #endif /* __MIG_check__Request__thread_act_subsystem__ */ 364 + #endif /* ( __MigTypeCheck ) */ 365 + 366 + 367 + /* Routine act_set_state */ 368 + mig_internal novalue _Xact_set_state 369 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) 370 + { 371 + 372 + #ifdef __MigPackStructs 373 + #pragma pack(8) 374 + #endif 375 + typedef struct { 376 + mach_msg_header_t Head; 377 + NDR_record_t NDR; 378 + int flavor; 379 + mach_msg_type_number_t new_stateCnt; 380 + natural_t new_state[224]; 381 + mach_msg_trailer_t trailer; 382 + } Request; 383 + #ifdef __MigPackStructs 384 + #pragma pack() 385 + #endif 386 + typedef __Request__act_set_state_t __Request; 387 + typedef __Reply__act_set_state_t Reply; 388 + 389 + /* 390 + * typedef struct { 391 + * mach_msg_header_t Head; 392 + * NDR_record_t NDR; 393 + * kern_return_t RetCode; 394 + * } mig_reply_error_t; 395 + */ 396 + 397 + Request *In0P = (Request *) InHeadP; 398 + Reply *OutP = (Reply *) OutHeadP; 399 + #ifdef __MIG_check__Request__act_set_state_t__defined 400 + kern_return_t check_result; 401 + #endif /* __MIG_check__Request__act_set_state_t__defined */ 402 + 403 + __DeclareRcvRpc(3602, "act_set_state") 404 + __BeforeRcvRpc(3602, "act_set_state") 405 + 406 + #if defined(__MIG_check__Request__act_set_state_t__defined) 407 + check_result = __MIG_check__Request__act_set_state_t((__Request *)In0P); 408 + if (check_result != MACH_MSG_SUCCESS) 409 + { MIG_RETURN_ERROR(OutP, check_result); } 410 + #endif /* defined(__MIG_check__Request__act_set_state_t__defined) */ 411 + 412 + OutP->RetCode = act_set_state(In0P->Head.msgh_request_port, In0P->flavor, In0P->new_state, In0P->new_stateCnt); 413 + 414 + OutP->NDR = NDR_record; 415 + 416 + 417 + __AfterRcvRpc(3602, "act_set_state") 418 + } 419 + 420 + #if ( __MigTypeCheck ) 421 + #if __MIG_check__Request__thread_act_subsystem__ 422 + #if !defined(__MIG_check__Request__thread_get_state_t__defined) 423 + #define __MIG_check__Request__thread_get_state_t__defined 424 + 425 + mig_internal kern_return_t __MIG_check__Request__thread_get_state_t(__attribute__((__unused__)) __Request__thread_get_state_t *In0P) 426 + { 427 + 428 + typedef __Request__thread_get_state_t __Request; 429 + #if __MigTypeCheck 430 + if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || 431 + (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) 432 + return MIG_BAD_ARGUMENTS; 433 + #endif /* __MigTypeCheck */ 434 + 435 + return MACH_MSG_SUCCESS; 436 + } 437 + #endif /* !defined(__MIG_check__Request__thread_get_state_t__defined) */ 438 + #endif /* __MIG_check__Request__thread_act_subsystem__ */ 439 + #endif /* ( __MigTypeCheck ) */ 440 + 441 + 442 + /* Routine thread_get_state */ 443 + mig_internal novalue _Xthread_get_state 444 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) 445 + { 446 + 447 + #ifdef __MigPackStructs 448 + #pragma pack(8) 449 + #endif 450 + typedef struct { 451 + mach_msg_header_t Head; 452 + NDR_record_t NDR; 453 + thread_state_flavor_t flavor; 454 + mach_msg_type_number_t old_stateCnt; 455 + mach_msg_trailer_t trailer; 456 + } Request; 457 + #ifdef __MigPackStructs 458 + #pragma pack() 459 + #endif 460 + typedef __Request__thread_get_state_t __Request; 461 + typedef __Reply__thread_get_state_t Reply; 462 + 463 + /* 464 + * typedef struct { 465 + * mach_msg_header_t Head; 466 + * NDR_record_t NDR; 467 + * kern_return_t RetCode; 468 + * } mig_reply_error_t; 469 + */ 470 + 471 + Request *In0P = (Request *) InHeadP; 472 + Reply *OutP = (Reply *) OutHeadP; 473 + #ifdef __MIG_check__Request__thread_get_state_t__defined 474 + kern_return_t check_result; 475 + #endif /* __MIG_check__Request__thread_get_state_t__defined */ 476 + 477 + __DeclareRcvRpc(3603, "thread_get_state") 478 + __BeforeRcvRpc(3603, "thread_get_state") 479 + 480 + #if defined(__MIG_check__Request__thread_get_state_t__defined) 481 + check_result = __MIG_check__Request__thread_get_state_t((__Request *)In0P); 482 + if (check_result != MACH_MSG_SUCCESS) 483 + { MIG_RETURN_ERROR(OutP, check_result); } 484 + #endif /* defined(__MIG_check__Request__thread_get_state_t__defined) */ 485 + 486 + OutP->old_stateCnt = 224; 487 + if (In0P->old_stateCnt < OutP->old_stateCnt) 488 + OutP->old_stateCnt = In0P->old_stateCnt; 489 + 490 + OutP->RetCode = thread_get_state(In0P->Head.msgh_request_port, In0P->flavor, OutP->old_state, &OutP->old_stateCnt); 491 + if (OutP->RetCode != KERN_SUCCESS) { 492 + MIG_RETURN_ERROR(OutP, OutP->RetCode); 493 + } 494 + 495 + OutP->NDR = NDR_record; 496 + 497 + OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 896) + (_WALIGN_((4 * OutP->old_stateCnt + 7) & ~7)); 498 + 499 + __AfterRcvRpc(3603, "thread_get_state") 500 + } 501 + 502 + #if ( __MigTypeCheck ) 503 + #if __MIG_check__Request__thread_act_subsystem__ 504 + #if !defined(__MIG_check__Request__thread_set_state_t__defined) 505 + #define __MIG_check__Request__thread_set_state_t__defined 506 + 507 + mig_internal kern_return_t __MIG_check__Request__thread_set_state_t(__attribute__((__unused__)) __Request__thread_set_state_t *In0P) 508 + { 509 + 510 + typedef __Request__thread_set_state_t __Request; 511 + #if __MigTypeCheck 512 + unsigned int msgh_size; 513 + #endif /* __MigTypeCheck */ 514 + 515 + #if __MigTypeCheck 516 + msgh_size = In0P->Head.msgh_size; 517 + if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || 518 + (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 896)) || (msgh_size > (mach_msg_size_t)sizeof(__Request))) 519 + return MIG_BAD_ARGUMENTS; 520 + #endif /* __MigTypeCheck */ 521 + 522 + #if defined(__NDR_convert__int_rep__Request__thread_set_state_t__new_stateCnt__defined) 523 + if (In0P->NDR.int_rep != NDR_record.int_rep) 524 + __NDR_convert__int_rep__Request__thread_set_state_t__new_stateCnt(&In0P->new_stateCnt, In0P->NDR.int_rep); 525 + #endif /* __NDR_convert__int_rep__Request__thread_set_state_t__new_stateCnt__defined */ 526 + #if __MigTypeCheck 527 + if ( In0P->new_stateCnt > 224 ) 528 + return MIG_BAD_ARGUMENTS; 529 + if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 896)) / 4 < In0P->new_stateCnt) || 530 + (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 896) + _WALIGN_(4 * In0P->new_stateCnt))) 531 + return MIG_BAD_ARGUMENTS; 532 + #endif /* __MigTypeCheck */ 533 + 534 + return MACH_MSG_SUCCESS; 535 + } 536 + #endif /* !defined(__MIG_check__Request__thread_set_state_t__defined) */ 537 + #endif /* __MIG_check__Request__thread_act_subsystem__ */ 538 + #endif /* ( __MigTypeCheck ) */ 539 + 540 + 541 + /* Routine thread_set_state */ 542 + mig_internal novalue _Xthread_set_state 543 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) 544 + { 545 + 546 + #ifdef __MigPackStructs 547 + #pragma pack(8) 548 + #endif 549 + typedef struct { 550 + mach_msg_header_t Head; 551 + NDR_record_t NDR; 552 + thread_state_flavor_t flavor; 553 + mach_msg_type_number_t new_stateCnt; 554 + natural_t new_state[224]; 555 + mach_msg_trailer_t trailer; 556 + } Request; 557 + #ifdef __MigPackStructs 558 + #pragma pack() 559 + #endif 560 + typedef __Request__thread_set_state_t __Request; 561 + typedef __Reply__thread_set_state_t Reply; 562 + 563 + /* 564 + * typedef struct { 565 + * mach_msg_header_t Head; 566 + * NDR_record_t NDR; 567 + * kern_return_t RetCode; 568 + * } mig_reply_error_t; 569 + */ 570 + 571 + Request *In0P = (Request *) InHeadP; 572 + Reply *OutP = (Reply *) OutHeadP; 573 + #ifdef __MIG_check__Request__thread_set_state_t__defined 574 + kern_return_t check_result; 575 + #endif /* __MIG_check__Request__thread_set_state_t__defined */ 576 + 577 + __DeclareRcvRpc(3604, "thread_set_state") 578 + __BeforeRcvRpc(3604, "thread_set_state") 579 + 580 + #if defined(__MIG_check__Request__thread_set_state_t__defined) 581 + check_result = __MIG_check__Request__thread_set_state_t((__Request *)In0P); 582 + if (check_result != MACH_MSG_SUCCESS) 583 + { MIG_RETURN_ERROR(OutP, check_result); } 584 + #endif /* defined(__MIG_check__Request__thread_set_state_t__defined) */ 585 + 586 + OutP->RetCode = thread_set_state(In0P->Head.msgh_request_port, In0P->flavor, In0P->new_state, In0P->new_stateCnt); 587 + 588 + OutP->NDR = NDR_record; 589 + 590 + 591 + __AfterRcvRpc(3604, "thread_set_state") 592 + } 593 + 594 + #if ( __MigTypeCheck ) 595 + #if __MIG_check__Request__thread_act_subsystem__ 596 + #if !defined(__MIG_check__Request__thread_suspend_t__defined) 597 + #define __MIG_check__Request__thread_suspend_t__defined 598 + 599 + mig_internal kern_return_t __MIG_check__Request__thread_suspend_t(__attribute__((__unused__)) __Request__thread_suspend_t *In0P) 600 + { 601 + 602 + typedef __Request__thread_suspend_t __Request; 603 + #if __MigTypeCheck 604 + if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || 605 + (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) 606 + return MIG_BAD_ARGUMENTS; 607 + #endif /* __MigTypeCheck */ 608 + 609 + return MACH_MSG_SUCCESS; 610 + } 611 + #endif /* !defined(__MIG_check__Request__thread_suspend_t__defined) */ 612 + #endif /* __MIG_check__Request__thread_act_subsystem__ */ 613 + #endif /* ( __MigTypeCheck ) */ 614 + 615 + 616 + /* Routine thread_suspend */ 617 + mig_internal novalue _Xthread_suspend 618 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) 619 + { 620 + 621 + #ifdef __MigPackStructs 622 + #pragma pack(8) 623 + #endif 624 + typedef struct { 625 + mach_msg_header_t Head; 626 + mach_msg_trailer_t trailer; 627 + } Request; 628 + #ifdef __MigPackStructs 629 + #pragma pack() 630 + #endif 631 + typedef __Request__thread_suspend_t __Request; 632 + typedef __Reply__thread_suspend_t Reply; 633 + 634 + /* 635 + * typedef struct { 636 + * mach_msg_header_t Head; 637 + * NDR_record_t NDR; 638 + * kern_return_t RetCode; 639 + * } mig_reply_error_t; 640 + */ 641 + 642 + Request *In0P = (Request *) InHeadP; 643 + Reply *OutP = (Reply *) OutHeadP; 644 + #ifdef __MIG_check__Request__thread_suspend_t__defined 645 + kern_return_t check_result; 646 + #endif /* __MIG_check__Request__thread_suspend_t__defined */ 647 + 648 + __DeclareRcvRpc(3605, "thread_suspend") 649 + __BeforeRcvRpc(3605, "thread_suspend") 650 + 651 + #if defined(__MIG_check__Request__thread_suspend_t__defined) 652 + check_result = __MIG_check__Request__thread_suspend_t((__Request *)In0P); 653 + if (check_result != MACH_MSG_SUCCESS) 654 + { MIG_RETURN_ERROR(OutP, check_result); } 655 + #endif /* defined(__MIG_check__Request__thread_suspend_t__defined) */ 656 + 657 + OutP->RetCode = thread_suspend(In0P->Head.msgh_request_port); 658 + 659 + OutP->NDR = NDR_record; 660 + 661 + 662 + __AfterRcvRpc(3605, "thread_suspend") 663 + } 664 + 665 + #if ( __MigTypeCheck ) 666 + #if __MIG_check__Request__thread_act_subsystem__ 667 + #if !defined(__MIG_check__Request__thread_resume_t__defined) 668 + #define __MIG_check__Request__thread_resume_t__defined 669 + 670 + mig_internal kern_return_t __MIG_check__Request__thread_resume_t(__attribute__((__unused__)) __Request__thread_resume_t *In0P) 671 + { 672 + 673 + typedef __Request__thread_resume_t __Request; 674 + #if __MigTypeCheck 675 + if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || 676 + (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) 677 + return MIG_BAD_ARGUMENTS; 678 + #endif /* __MigTypeCheck */ 679 + 680 + return MACH_MSG_SUCCESS; 681 + } 682 + #endif /* !defined(__MIG_check__Request__thread_resume_t__defined) */ 683 + #endif /* __MIG_check__Request__thread_act_subsystem__ */ 684 + #endif /* ( __MigTypeCheck ) */ 685 + 686 + 687 + /* Routine thread_resume */ 688 + mig_internal novalue _Xthread_resume 689 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) 690 + { 691 + 692 + #ifdef __MigPackStructs 693 + #pragma pack(8) 694 + #endif 695 + typedef struct { 696 + mach_msg_header_t Head; 697 + mach_msg_trailer_t trailer; 698 + } Request; 699 + #ifdef __MigPackStructs 700 + #pragma pack() 701 + #endif 702 + typedef __Request__thread_resume_t __Request; 703 + typedef __Reply__thread_resume_t Reply; 704 + 705 + /* 706 + * typedef struct { 707 + * mach_msg_header_t Head; 708 + * NDR_record_t NDR; 709 + * kern_return_t RetCode; 710 + * } mig_reply_error_t; 711 + */ 712 + 713 + Request *In0P = (Request *) InHeadP; 714 + Reply *OutP = (Reply *) OutHeadP; 715 + #ifdef __MIG_check__Request__thread_resume_t__defined 716 + kern_return_t check_result; 717 + #endif /* __MIG_check__Request__thread_resume_t__defined */ 718 + 719 + __DeclareRcvRpc(3606, "thread_resume") 720 + __BeforeRcvRpc(3606, "thread_resume") 721 + 722 + #if defined(__MIG_check__Request__thread_resume_t__defined) 723 + check_result = __MIG_check__Request__thread_resume_t((__Request *)In0P); 724 + if (check_result != MACH_MSG_SUCCESS) 725 + { MIG_RETURN_ERROR(OutP, check_result); } 726 + #endif /* defined(__MIG_check__Request__thread_resume_t__defined) */ 727 + 728 + OutP->RetCode = thread_resume(In0P->Head.msgh_request_port); 729 + 730 + OutP->NDR = NDR_record; 731 + 732 + 733 + __AfterRcvRpc(3606, "thread_resume") 734 + } 735 + 736 + #if ( __MigTypeCheck ) 737 + #if __MIG_check__Request__thread_act_subsystem__ 738 + #if !defined(__MIG_check__Request__thread_abort_t__defined) 739 + #define __MIG_check__Request__thread_abort_t__defined 740 + 741 + mig_internal kern_return_t __MIG_check__Request__thread_abort_t(__attribute__((__unused__)) __Request__thread_abort_t *In0P) 742 + { 743 + 744 + typedef __Request__thread_abort_t __Request; 745 + #if __MigTypeCheck 746 + if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || 747 + (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) 748 + return MIG_BAD_ARGUMENTS; 749 + #endif /* __MigTypeCheck */ 750 + 751 + return MACH_MSG_SUCCESS; 752 + } 753 + #endif /* !defined(__MIG_check__Request__thread_abort_t__defined) */ 754 + #endif /* __MIG_check__Request__thread_act_subsystem__ */ 755 + #endif /* ( __MigTypeCheck ) */ 756 + 757 + 758 + /* Routine thread_abort */ 759 + mig_internal novalue _Xthread_abort 760 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) 761 + { 762 + 763 + #ifdef __MigPackStructs 764 + #pragma pack(8) 765 + #endif 766 + typedef struct { 767 + mach_msg_header_t Head; 768 + mach_msg_trailer_t trailer; 769 + } Request; 770 + #ifdef __MigPackStructs 771 + #pragma pack() 772 + #endif 773 + typedef __Request__thread_abort_t __Request; 774 + typedef __Reply__thread_abort_t Reply; 775 + 776 + /* 777 + * typedef struct { 778 + * mach_msg_header_t Head; 779 + * NDR_record_t NDR; 780 + * kern_return_t RetCode; 781 + * } mig_reply_error_t; 782 + */ 783 + 784 + Request *In0P = (Request *) InHeadP; 785 + Reply *OutP = (Reply *) OutHeadP; 786 + #ifdef __MIG_check__Request__thread_abort_t__defined 787 + kern_return_t check_result; 788 + #endif /* __MIG_check__Request__thread_abort_t__defined */ 789 + 790 + __DeclareRcvRpc(3607, "thread_abort") 791 + __BeforeRcvRpc(3607, "thread_abort") 792 + 793 + #if defined(__MIG_check__Request__thread_abort_t__defined) 794 + check_result = __MIG_check__Request__thread_abort_t((__Request *)In0P); 795 + if (check_result != MACH_MSG_SUCCESS) 796 + { MIG_RETURN_ERROR(OutP, check_result); } 797 + #endif /* defined(__MIG_check__Request__thread_abort_t__defined) */ 798 + 799 + OutP->RetCode = thread_abort(In0P->Head.msgh_request_port); 800 + 801 + OutP->NDR = NDR_record; 802 + 803 + 804 + __AfterRcvRpc(3607, "thread_abort") 805 + } 806 + 807 + #if ( __MigTypeCheck ) 808 + #if __MIG_check__Request__thread_act_subsystem__ 809 + #if !defined(__MIG_check__Request__thread_abort_safely_t__defined) 810 + #define __MIG_check__Request__thread_abort_safely_t__defined 811 + 812 + mig_internal kern_return_t __MIG_check__Request__thread_abort_safely_t(__attribute__((__unused__)) __Request__thread_abort_safely_t *In0P) 813 + { 814 + 815 + typedef __Request__thread_abort_safely_t __Request; 816 + #if __MigTypeCheck 817 + if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || 818 + (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) 819 + return MIG_BAD_ARGUMENTS; 820 + #endif /* __MigTypeCheck */ 821 + 822 + return MACH_MSG_SUCCESS; 823 + } 824 + #endif /* !defined(__MIG_check__Request__thread_abort_safely_t__defined) */ 825 + #endif /* __MIG_check__Request__thread_act_subsystem__ */ 826 + #endif /* ( __MigTypeCheck ) */ 827 + 828 + 829 + /* Routine thread_abort_safely */ 830 + mig_internal novalue _Xthread_abort_safely 831 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) 832 + { 833 + 834 + #ifdef __MigPackStructs 835 + #pragma pack(8) 836 + #endif 837 + typedef struct { 838 + mach_msg_header_t Head; 839 + mach_msg_trailer_t trailer; 840 + } Request; 841 + #ifdef __MigPackStructs 842 + #pragma pack() 843 + #endif 844 + typedef __Request__thread_abort_safely_t __Request; 845 + typedef __Reply__thread_abort_safely_t Reply; 846 + 847 + /* 848 + * typedef struct { 849 + * mach_msg_header_t Head; 850 + * NDR_record_t NDR; 851 + * kern_return_t RetCode; 852 + * } mig_reply_error_t; 853 + */ 854 + 855 + Request *In0P = (Request *) InHeadP; 856 + Reply *OutP = (Reply *) OutHeadP; 857 + #ifdef __MIG_check__Request__thread_abort_safely_t__defined 858 + kern_return_t check_result; 859 + #endif /* __MIG_check__Request__thread_abort_safely_t__defined */ 860 + 861 + __DeclareRcvRpc(3608, "thread_abort_safely") 862 + __BeforeRcvRpc(3608, "thread_abort_safely") 863 + 864 + #if defined(__MIG_check__Request__thread_abort_safely_t__defined) 865 + check_result = __MIG_check__Request__thread_abort_safely_t((__Request *)In0P); 866 + if (check_result != MACH_MSG_SUCCESS) 867 + { MIG_RETURN_ERROR(OutP, check_result); } 868 + #endif /* defined(__MIG_check__Request__thread_abort_safely_t__defined) */ 869 + 870 + OutP->RetCode = thread_abort_safely(In0P->Head.msgh_request_port); 871 + 872 + OutP->NDR = NDR_record; 873 + 874 + 875 + __AfterRcvRpc(3608, "thread_abort_safely") 876 + } 877 + 878 + #if ( __MigTypeCheck ) 879 + #if __MIG_check__Request__thread_act_subsystem__ 880 + #if !defined(__MIG_check__Request__thread_depress_abort_t__defined) 881 + #define __MIG_check__Request__thread_depress_abort_t__defined 882 + 883 + mig_internal kern_return_t __MIG_check__Request__thread_depress_abort_t(__attribute__((__unused__)) __Request__thread_depress_abort_t *In0P) 884 + { 885 + 886 + typedef __Request__thread_depress_abort_t __Request; 887 + #if __MigTypeCheck 888 + if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || 889 + (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) 890 + return MIG_BAD_ARGUMENTS; 891 + #endif /* __MigTypeCheck */ 892 + 893 + return MACH_MSG_SUCCESS; 894 + } 895 + #endif /* !defined(__MIG_check__Request__thread_depress_abort_t__defined) */ 896 + #endif /* __MIG_check__Request__thread_act_subsystem__ */ 897 + #endif /* ( __MigTypeCheck ) */ 898 + 899 + 900 + /* Routine thread_depress_abort */ 901 + mig_internal novalue _Xthread_depress_abort 902 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) 903 + { 904 + 905 + #ifdef __MigPackStructs 906 + #pragma pack(8) 907 + #endif 908 + typedef struct { 909 + mach_msg_header_t Head; 910 + mach_msg_trailer_t trailer; 911 + } Request; 912 + #ifdef __MigPackStructs 913 + #pragma pack() 914 + #endif 915 + typedef __Request__thread_depress_abort_t __Request; 916 + typedef __Reply__thread_depress_abort_t Reply; 917 + 918 + /* 919 + * typedef struct { 920 + * mach_msg_header_t Head; 921 + * NDR_record_t NDR; 922 + * kern_return_t RetCode; 923 + * } mig_reply_error_t; 924 + */ 925 + 926 + Request *In0P = (Request *) InHeadP; 927 + Reply *OutP = (Reply *) OutHeadP; 928 + #ifdef __MIG_check__Request__thread_depress_abort_t__defined 929 + kern_return_t check_result; 930 + #endif /* __MIG_check__Request__thread_depress_abort_t__defined */ 931 + 932 + __DeclareRcvRpc(3609, "thread_depress_abort") 933 + __BeforeRcvRpc(3609, "thread_depress_abort") 934 + 935 + #if defined(__MIG_check__Request__thread_depress_abort_t__defined) 936 + check_result = __MIG_check__Request__thread_depress_abort_t((__Request *)In0P); 937 + if (check_result != MACH_MSG_SUCCESS) 938 + { MIG_RETURN_ERROR(OutP, check_result); } 939 + #endif /* defined(__MIG_check__Request__thread_depress_abort_t__defined) */ 940 + 941 + OutP->RetCode = thread_depress_abort(In0P->Head.msgh_request_port); 942 + 943 + OutP->NDR = NDR_record; 944 + 945 + 946 + __AfterRcvRpc(3609, "thread_depress_abort") 947 + } 948 + 949 + #if ( __MigTypeCheck ) 950 + #if __MIG_check__Request__thread_act_subsystem__ 951 + #if !defined(__MIG_check__Request__thread_get_special_port_t__defined) 952 + #define __MIG_check__Request__thread_get_special_port_t__defined 953 + 954 + mig_internal kern_return_t __MIG_check__Request__thread_get_special_port_t(__attribute__((__unused__)) __Request__thread_get_special_port_t *In0P) 955 + { 956 + 957 + typedef __Request__thread_get_special_port_t __Request; 958 + #if __MigTypeCheck 959 + if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || 960 + (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) 961 + return MIG_BAD_ARGUMENTS; 962 + #endif /* __MigTypeCheck */ 963 + 964 + return MACH_MSG_SUCCESS; 965 + } 966 + #endif /* !defined(__MIG_check__Request__thread_get_special_port_t__defined) */ 967 + #endif /* __MIG_check__Request__thread_act_subsystem__ */ 968 + #endif /* ( __MigTypeCheck ) */ 969 + 970 + 971 + /* Routine thread_get_special_port */ 972 + mig_internal novalue _Xthread_get_special_port 973 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) 974 + { 975 + 976 + #ifdef __MigPackStructs 977 + #pragma pack(8) 978 + #endif 979 + typedef struct { 980 + mach_msg_header_t Head; 981 + NDR_record_t NDR; 982 + int which_port; 983 + mach_msg_trailer_t trailer; 984 + } Request; 985 + #ifdef __MigPackStructs 986 + #pragma pack() 987 + #endif 988 + typedef __Request__thread_get_special_port_t __Request; 989 + typedef __Reply__thread_get_special_port_t Reply; 990 + 991 + /* 992 + * typedef struct { 993 + * mach_msg_header_t Head; 994 + * NDR_record_t NDR; 995 + * kern_return_t RetCode; 996 + * } mig_reply_error_t; 997 + */ 998 + 999 + Request *In0P = (Request *) InHeadP; 1000 + Reply *OutP = (Reply *) OutHeadP; 1001 + #ifdef __MIG_check__Request__thread_get_special_port_t__defined 1002 + kern_return_t check_result; 1003 + #endif /* __MIG_check__Request__thread_get_special_port_t__defined */ 1004 + 1005 + #if UseStaticTemplates 1006 + const static mach_msg_port_descriptor_t special_portTemplate = { 1007 + /* name = */ MACH_PORT_NULL, 1008 + /* pad1 = */ 0, 1009 + /* pad2 = */ 0, 1010 + /* disp = */ 19, 1011 + /* type = */ MACH_MSG_PORT_DESCRIPTOR, 1012 + }; 1013 + #endif /* UseStaticTemplates */ 1014 + 1015 + kern_return_t RetCode; 1016 + __DeclareRcvRpc(3610, "thread_get_special_port") 1017 + __BeforeRcvRpc(3610, "thread_get_special_port") 1018 + 1019 + #if defined(__MIG_check__Request__thread_get_special_port_t__defined) 1020 + check_result = __MIG_check__Request__thread_get_special_port_t((__Request *)In0P); 1021 + if (check_result != MACH_MSG_SUCCESS) 1022 + { MIG_RETURN_ERROR(OutP, check_result); } 1023 + #endif /* defined(__MIG_check__Request__thread_get_special_port_t__defined) */ 1024 + 1025 + #if UseStaticTemplates 1026 + OutP->special_port = special_portTemplate; 1027 + #else /* UseStaticTemplates */ 1028 + OutP->special_port.disposition = 19; 1029 + OutP->special_port.type = MACH_MSG_PORT_DESCRIPTOR; 1030 + #endif /* UseStaticTemplates */ 1031 + 1032 + 1033 + RetCode = thread_get_special_port(In0P->Head.msgh_request_port, In0P->which_port, &OutP->special_port.name); 1034 + if (RetCode != KERN_SUCCESS) { 1035 + MIG_RETURN_ERROR(OutP, RetCode); 1036 + } 1037 + 1038 + OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; 1039 + OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); 1040 + OutP->msgh_body.msgh_descriptor_count = 1; 1041 + __AfterRcvRpc(3610, "thread_get_special_port") 1042 + } 1043 + 1044 + #if ( __MigTypeCheck ) 1045 + #if __MIG_check__Request__thread_act_subsystem__ 1046 + #if !defined(__MIG_check__Request__thread_set_special_port_t__defined) 1047 + #define __MIG_check__Request__thread_set_special_port_t__defined 1048 + 1049 + mig_internal kern_return_t __MIG_check__Request__thread_set_special_port_t(__attribute__((__unused__)) __Request__thread_set_special_port_t *In0P) 1050 + { 1051 + 1052 + typedef __Request__thread_set_special_port_t __Request; 1053 + #if __MigTypeCheck 1054 + if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || 1055 + (In0P->msgh_body.msgh_descriptor_count != 1) || 1056 + (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) 1057 + return MIG_BAD_ARGUMENTS; 1058 + #endif /* __MigTypeCheck */ 1059 + 1060 + #if __MigTypeCheck 1061 + if (In0P->special_port.type != MACH_MSG_PORT_DESCRIPTOR || 1062 + In0P->special_port.disposition != 17) 1063 + return MIG_TYPE_ERROR; 1064 + #endif /* __MigTypeCheck */ 1065 + 1066 + return MACH_MSG_SUCCESS; 1067 + } 1068 + #endif /* !defined(__MIG_check__Request__thread_set_special_port_t__defined) */ 1069 + #endif /* __MIG_check__Request__thread_act_subsystem__ */ 1070 + #endif /* ( __MigTypeCheck ) */ 1071 + 1072 + 1073 + /* Routine thread_set_special_port */ 1074 + mig_internal novalue _Xthread_set_special_port 1075 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) 1076 + { 1077 + 1078 + #ifdef __MigPackStructs 1079 + #pragma pack(8) 1080 + #endif 1081 + typedef struct { 1082 + mach_msg_header_t Head; 1083 + /* start of the kernel processed data */ 1084 + mach_msg_body_t msgh_body; 1085 + mach_msg_port_descriptor_t special_port; 1086 + /* end of the kernel processed data */ 1087 + NDR_record_t NDR; 1088 + int which_port; 1089 + mach_msg_trailer_t trailer; 1090 + } Request; 1091 + #ifdef __MigPackStructs 1092 + #pragma pack() 1093 + #endif 1094 + typedef __Request__thread_set_special_port_t __Request; 1095 + typedef __Reply__thread_set_special_port_t Reply; 1096 + 1097 + /* 1098 + * typedef struct { 1099 + * mach_msg_header_t Head; 1100 + * NDR_record_t NDR; 1101 + * kern_return_t RetCode; 1102 + * } mig_reply_error_t; 1103 + */ 1104 + 1105 + Request *In0P = (Request *) InHeadP; 1106 + Reply *OutP = (Reply *) OutHeadP; 1107 + #ifdef __MIG_check__Request__thread_set_special_port_t__defined 1108 + kern_return_t check_result; 1109 + #endif /* __MIG_check__Request__thread_set_special_port_t__defined */ 1110 + 1111 + __DeclareRcvRpc(3611, "thread_set_special_port") 1112 + __BeforeRcvRpc(3611, "thread_set_special_port") 1113 + 1114 + #if defined(__MIG_check__Request__thread_set_special_port_t__defined) 1115 + check_result = __MIG_check__Request__thread_set_special_port_t((__Request *)In0P); 1116 + if (check_result != MACH_MSG_SUCCESS) 1117 + { MIG_RETURN_ERROR(OutP, check_result); } 1118 + #endif /* defined(__MIG_check__Request__thread_set_special_port_t__defined) */ 1119 + 1120 + OutP->RetCode = thread_set_special_port(In0P->Head.msgh_request_port, In0P->which_port, In0P->special_port.name); 1121 + 1122 + OutP->NDR = NDR_record; 1123 + 1124 + 1125 + __AfterRcvRpc(3611, "thread_set_special_port") 1126 + } 1127 + 1128 + #if ( __MigTypeCheck ) 1129 + #if __MIG_check__Request__thread_act_subsystem__ 1130 + #if !defined(__MIG_check__Request__thread_info_t__defined) 1131 + #define __MIG_check__Request__thread_info_t__defined 1132 + 1133 + mig_internal kern_return_t __MIG_check__Request__thread_info_t(__attribute__((__unused__)) __Request__thread_info_t *In0P) 1134 + { 1135 + 1136 + typedef __Request__thread_info_t __Request; 1137 + #if __MigTypeCheck 1138 + if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || 1139 + (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) 1140 + return MIG_BAD_ARGUMENTS; 1141 + #endif /* __MigTypeCheck */ 1142 + 1143 + return MACH_MSG_SUCCESS; 1144 + } 1145 + #endif /* !defined(__MIG_check__Request__thread_info_t__defined) */ 1146 + #endif /* __MIG_check__Request__thread_act_subsystem__ */ 1147 + #endif /* ( __MigTypeCheck ) */ 1148 + 1149 + 1150 + /* Routine thread_info */ 1151 + mig_internal novalue _Xthread_info 1152 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) 1153 + { 1154 + 1155 + #ifdef __MigPackStructs 1156 + #pragma pack(8) 1157 + #endif 1158 + typedef struct { 1159 + mach_msg_header_t Head; 1160 + NDR_record_t NDR; 1161 + thread_flavor_t flavor; 1162 + mach_msg_type_number_t thread_info_outCnt; 1163 + mach_msg_trailer_t trailer; 1164 + } Request; 1165 + #ifdef __MigPackStructs 1166 + #pragma pack() 1167 + #endif 1168 + typedef __Request__thread_info_t __Request; 1169 + typedef __Reply__thread_info_t Reply; 1170 + 1171 + /* 1172 + * typedef struct { 1173 + * mach_msg_header_t Head; 1174 + * NDR_record_t NDR; 1175 + * kern_return_t RetCode; 1176 + * } mig_reply_error_t; 1177 + */ 1178 + 1179 + Request *In0P = (Request *) InHeadP; 1180 + Reply *OutP = (Reply *) OutHeadP; 1181 + #ifdef __MIG_check__Request__thread_info_t__defined 1182 + kern_return_t check_result; 1183 + #endif /* __MIG_check__Request__thread_info_t__defined */ 1184 + 1185 + __DeclareRcvRpc(3612, "thread_info") 1186 + __BeforeRcvRpc(3612, "thread_info") 1187 + 1188 + #if defined(__MIG_check__Request__thread_info_t__defined) 1189 + check_result = __MIG_check__Request__thread_info_t((__Request *)In0P); 1190 + if (check_result != MACH_MSG_SUCCESS) 1191 + { MIG_RETURN_ERROR(OutP, check_result); } 1192 + #endif /* defined(__MIG_check__Request__thread_info_t__defined) */ 1193 + 1194 + OutP->thread_info_outCnt = 12; 1195 + if (In0P->thread_info_outCnt < OutP->thread_info_outCnt) 1196 + OutP->thread_info_outCnt = In0P->thread_info_outCnt; 1197 + 1198 + OutP->RetCode = thread_info(In0P->Head.msgh_request_port, In0P->flavor, OutP->thread_info_out, &OutP->thread_info_outCnt); 1199 + if (OutP->RetCode != KERN_SUCCESS) { 1200 + MIG_RETURN_ERROR(OutP, OutP->RetCode); 1201 + } 1202 + 1203 + OutP->NDR = NDR_record; 1204 + 1205 + OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 48) + (_WALIGN_((4 * OutP->thread_info_outCnt + 7) & ~7)); 1206 + 1207 + __AfterRcvRpc(3612, "thread_info") 1208 + } 1209 + 1210 + #if ( __MigTypeCheck ) 1211 + #if __MIG_check__Request__thread_act_subsystem__ 1212 + #if !defined(__MIG_check__Request__thread_set_exception_ports_t__defined) 1213 + #define __MIG_check__Request__thread_set_exception_ports_t__defined 1214 + 1215 + mig_internal kern_return_t __MIG_check__Request__thread_set_exception_ports_t(__attribute__((__unused__)) __Request__thread_set_exception_ports_t *In0P) 1216 + { 1217 + 1218 + typedef __Request__thread_set_exception_ports_t __Request; 1219 + #if __MigTypeCheck 1220 + if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || 1221 + (In0P->msgh_body.msgh_descriptor_count != 1) || 1222 + (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) 1223 + return MIG_BAD_ARGUMENTS; 1224 + #endif /* __MigTypeCheck */ 1225 + 1226 + #if __MigTypeCheck 1227 + if (In0P->new_port.type != MACH_MSG_PORT_DESCRIPTOR || 1228 + In0P->new_port.disposition != 17) 1229 + return MIG_TYPE_ERROR; 1230 + #endif /* __MigTypeCheck */ 1231 + 1232 + return MACH_MSG_SUCCESS; 1233 + } 1234 + #endif /* !defined(__MIG_check__Request__thread_set_exception_ports_t__defined) */ 1235 + #endif /* __MIG_check__Request__thread_act_subsystem__ */ 1236 + #endif /* ( __MigTypeCheck ) */ 1237 + 1238 + 1239 + /* Routine thread_set_exception_ports */ 1240 + mig_internal novalue _Xthread_set_exception_ports 1241 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) 1242 + { 1243 + 1244 + #ifdef __MigPackStructs 1245 + #pragma pack(8) 1246 + #endif 1247 + typedef struct { 1248 + mach_msg_header_t Head; 1249 + /* start of the kernel processed data */ 1250 + mach_msg_body_t msgh_body; 1251 + mach_msg_port_descriptor_t new_port; 1252 + /* end of the kernel processed data */ 1253 + NDR_record_t NDR; 1254 + exception_mask_t exception_mask; 1255 + exception_behavior_t behavior; 1256 + thread_state_flavor_t new_flavor; 1257 + mach_msg_trailer_t trailer; 1258 + } Request; 1259 + #ifdef __MigPackStructs 1260 + #pragma pack() 1261 + #endif 1262 + typedef __Request__thread_set_exception_ports_t __Request; 1263 + typedef __Reply__thread_set_exception_ports_t Reply; 1264 + 1265 + /* 1266 + * typedef struct { 1267 + * mach_msg_header_t Head; 1268 + * NDR_record_t NDR; 1269 + * kern_return_t RetCode; 1270 + * } mig_reply_error_t; 1271 + */ 1272 + 1273 + Request *In0P = (Request *) InHeadP; 1274 + Reply *OutP = (Reply *) OutHeadP; 1275 + #ifdef __MIG_check__Request__thread_set_exception_ports_t__defined 1276 + kern_return_t check_result; 1277 + #endif /* __MIG_check__Request__thread_set_exception_ports_t__defined */ 1278 + 1279 + __DeclareRcvRpc(3613, "thread_set_exception_ports") 1280 + __BeforeRcvRpc(3613, "thread_set_exception_ports") 1281 + 1282 + #if defined(__MIG_check__Request__thread_set_exception_ports_t__defined) 1283 + check_result = __MIG_check__Request__thread_set_exception_ports_t((__Request *)In0P); 1284 + if (check_result != MACH_MSG_SUCCESS) 1285 + { MIG_RETURN_ERROR(OutP, check_result); } 1286 + #endif /* defined(__MIG_check__Request__thread_set_exception_ports_t__defined) */ 1287 + 1288 + OutP->RetCode = thread_set_exception_ports(In0P->Head.msgh_request_port, In0P->exception_mask, In0P->new_port.name, In0P->behavior, In0P->new_flavor); 1289 + 1290 + OutP->NDR = NDR_record; 1291 + 1292 + 1293 + __AfterRcvRpc(3613, "thread_set_exception_ports") 1294 + } 1295 + 1296 + #if ( __MigTypeCheck ) 1297 + #if __MIG_check__Request__thread_act_subsystem__ 1298 + #if !defined(__MIG_check__Request__thread_get_exception_ports_t__defined) 1299 + #define __MIG_check__Request__thread_get_exception_ports_t__defined 1300 + 1301 + mig_internal kern_return_t __MIG_check__Request__thread_get_exception_ports_t(__attribute__((__unused__)) __Request__thread_get_exception_ports_t *In0P) 1302 + { 1303 + 1304 + typedef __Request__thread_get_exception_ports_t __Request; 1305 + #if __MigTypeCheck 1306 + if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || 1307 + (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) 1308 + return MIG_BAD_ARGUMENTS; 1309 + #endif /* __MigTypeCheck */ 1310 + 1311 + return MACH_MSG_SUCCESS; 1312 + } 1313 + #endif /* !defined(__MIG_check__Request__thread_get_exception_ports_t__defined) */ 1314 + #endif /* __MIG_check__Request__thread_act_subsystem__ */ 1315 + #endif /* ( __MigTypeCheck ) */ 1316 + 1317 + 1318 + /* Routine thread_get_exception_ports */ 1319 + mig_internal novalue _Xthread_get_exception_ports 1320 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) 1321 + { 1322 + 1323 + #ifdef __MigPackStructs 1324 + #pragma pack(8) 1325 + #endif 1326 + typedef struct { 1327 + mach_msg_header_t Head; 1328 + NDR_record_t NDR; 1329 + exception_mask_t exception_mask; 1330 + mach_msg_trailer_t trailer; 1331 + } Request; 1332 + #ifdef __MigPackStructs 1333 + #pragma pack() 1334 + #endif 1335 + typedef __Request__thread_get_exception_ports_t __Request; 1336 + typedef __Reply__thread_get_exception_ports_t Reply; 1337 + 1338 + /* 1339 + * typedef struct { 1340 + * mach_msg_header_t Head; 1341 + * NDR_record_t NDR; 1342 + * kern_return_t RetCode; 1343 + * } mig_reply_error_t; 1344 + */ 1345 + 1346 + Request *In0P = (Request *) InHeadP; 1347 + Reply *OutP = (Reply *) OutHeadP; 1348 + unsigned int msgh_size; 1349 + unsigned int msgh_size_delta; 1350 + 1351 + #ifdef __MIG_check__Request__thread_get_exception_ports_t__defined 1352 + kern_return_t check_result; 1353 + #endif /* __MIG_check__Request__thread_get_exception_ports_t__defined */ 1354 + 1355 + #if UseStaticTemplates 1356 + const static mach_msg_port_descriptor_t old_handlersTemplate = { 1357 + /* name = */ MACH_PORT_NULL, 1358 + /* pad1 = */ 0, 1359 + /* pad2 = */ 0, 1360 + /* disp = */ 19, 1361 + /* type = */ MACH_MSG_PORT_DESCRIPTOR, 1362 + }; 1363 + #endif /* UseStaticTemplates */ 1364 + 1365 + kern_return_t RetCode; 1366 + mach_msg_type_number_t masksCnt; 1367 + exception_handler_t old_handlers[32]; 1368 + exception_behavior_t old_behaviors[32]; 1369 + thread_state_flavor_t old_flavors[32]; 1370 + 1371 + __DeclareRcvRpc(3614, "thread_get_exception_ports") 1372 + __BeforeRcvRpc(3614, "thread_get_exception_ports") 1373 + 1374 + #if defined(__MIG_check__Request__thread_get_exception_ports_t__defined) 1375 + check_result = __MIG_check__Request__thread_get_exception_ports_t((__Request *)In0P); 1376 + if (check_result != MACH_MSG_SUCCESS) 1377 + { MIG_RETURN_ERROR(OutP, check_result); } 1378 + #endif /* defined(__MIG_check__Request__thread_get_exception_ports_t__defined) */ 1379 + 1380 + { 1381 + register mach_msg_port_descriptor_t *ptr; 1382 + register int i; 1383 + 1384 + ptr = &OutP->old_handlers[0]; 1385 + for (i = 0; i < 32; ptr++, i++) { 1386 + #if UseStaticTemplates 1387 + *ptr = old_handlersTemplate; 1388 + #else /* UseStaticTemplates */ 1389 + ptr->name = MACH_PORT_NULL; 1390 + ptr->disposition = 19; 1391 + ptr->type = MACH_MSG_PORT_DESCRIPTOR; 1392 + #endif /* UseStaticTemplates */ 1393 + } 1394 + } 1395 + 1396 + 1397 + masksCnt = 32; 1398 + 1399 + RetCode = thread_get_exception_ports(In0P->Head.msgh_request_port, In0P->exception_mask, OutP->masks, &masksCnt, old_handlers, old_behaviors, old_flavors); 1400 + if (RetCode != KERN_SUCCESS) { 1401 + MIG_RETURN_ERROR(OutP, RetCode); 1402 + } 1403 + { 1404 + register mach_msg_port_descriptor_t *ptr; 1405 + register int i, j; 1406 + 1407 + ptr = &OutP->old_handlers[0]; 1408 + j = min(32, masksCnt); 1409 + for (i = 0; i < j; ptr++, i++) { 1410 + ptr->name = old_handlers[i]; 1411 + } 1412 + } 1413 + 1414 + 1415 + OutP->NDR = NDR_record; 1416 + 1417 + OutP->masksCnt = masksCnt; 1418 + msgh_size_delta = _WALIGN_((4 * masksCnt + 7) & ~7); 1419 + msgh_size = (mach_msg_size_t)(sizeof(Reply) - 384) + msgh_size_delta; 1420 + OutP = (Reply *) ((pointer_t) OutP + msgh_size_delta - 128); 1421 + (void)memcpy((char *) OutP->old_behaviors, (const char *) old_behaviors, 4 * masksCnt); 1422 + msgh_size_delta = _WALIGN_((4 * masksCnt + 7) & ~7); 1423 + msgh_size += msgh_size_delta; 1424 + OutP = (Reply *) ((pointer_t) OutP + msgh_size_delta - 128); 1425 + (void)memcpy((char *) OutP->old_flavors, (const char *) old_flavors, 4 * masksCnt); 1426 + msgh_size += _WALIGN_((4 * masksCnt + 7) & ~7); 1427 + 1428 + OutP = (Reply *) OutHeadP; 1429 + OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; 1430 + OutP->Head.msgh_size = msgh_size; 1431 + OutP->msgh_body.msgh_descriptor_count = 32; 1432 + __AfterRcvRpc(3614, "thread_get_exception_ports") 1433 + } 1434 + 1435 + #if ( __MigTypeCheck ) 1436 + #if __MIG_check__Request__thread_act_subsystem__ 1437 + #if !defined(__MIG_check__Request__thread_swap_exception_ports_t__defined) 1438 + #define __MIG_check__Request__thread_swap_exception_ports_t__defined 1439 + 1440 + mig_internal kern_return_t __MIG_check__Request__thread_swap_exception_ports_t(__attribute__((__unused__)) __Request__thread_swap_exception_ports_t *In0P) 1441 + { 1442 + 1443 + typedef __Request__thread_swap_exception_ports_t __Request; 1444 + #if __MigTypeCheck 1445 + if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || 1446 + (In0P->msgh_body.msgh_descriptor_count != 1) || 1447 + (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) 1448 + return MIG_BAD_ARGUMENTS; 1449 + #endif /* __MigTypeCheck */ 1450 + 1451 + #if __MigTypeCheck 1452 + if (In0P->new_port.type != MACH_MSG_PORT_DESCRIPTOR || 1453 + In0P->new_port.disposition != 17) 1454 + return MIG_TYPE_ERROR; 1455 + #endif /* __MigTypeCheck */ 1456 + 1457 + return MACH_MSG_SUCCESS; 1458 + } 1459 + #endif /* !defined(__MIG_check__Request__thread_swap_exception_ports_t__defined) */ 1460 + #endif /* __MIG_check__Request__thread_act_subsystem__ */ 1461 + #endif /* ( __MigTypeCheck ) */ 1462 + 1463 + 1464 + /* Routine thread_swap_exception_ports */ 1465 + mig_internal novalue _Xthread_swap_exception_ports 1466 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) 1467 + { 1468 + 1469 + #ifdef __MigPackStructs 1470 + #pragma pack(8) 1471 + #endif 1472 + typedef struct { 1473 + mach_msg_header_t Head; 1474 + /* start of the kernel processed data */ 1475 + mach_msg_body_t msgh_body; 1476 + mach_msg_port_descriptor_t new_port; 1477 + /* end of the kernel processed data */ 1478 + NDR_record_t NDR; 1479 + exception_mask_t exception_mask; 1480 + exception_behavior_t behavior; 1481 + thread_state_flavor_t new_flavor; 1482 + mach_msg_trailer_t trailer; 1483 + } Request; 1484 + #ifdef __MigPackStructs 1485 + #pragma pack() 1486 + #endif 1487 + typedef __Request__thread_swap_exception_ports_t __Request; 1488 + typedef __Reply__thread_swap_exception_ports_t Reply; 1489 + 1490 + /* 1491 + * typedef struct { 1492 + * mach_msg_header_t Head; 1493 + * NDR_record_t NDR; 1494 + * kern_return_t RetCode; 1495 + * } mig_reply_error_t; 1496 + */ 1497 + 1498 + Request *In0P = (Request *) InHeadP; 1499 + Reply *OutP = (Reply *) OutHeadP; 1500 + unsigned int msgh_size; 1501 + unsigned int msgh_size_delta; 1502 + 1503 + #ifdef __MIG_check__Request__thread_swap_exception_ports_t__defined 1504 + kern_return_t check_result; 1505 + #endif /* __MIG_check__Request__thread_swap_exception_ports_t__defined */ 1506 + 1507 + #if UseStaticTemplates 1508 + const static mach_msg_port_descriptor_t old_handlersTemplate = { 1509 + /* name = */ MACH_PORT_NULL, 1510 + /* pad1 = */ 0, 1511 + /* pad2 = */ 0, 1512 + /* disp = */ 19, 1513 + /* type = */ MACH_MSG_PORT_DESCRIPTOR, 1514 + }; 1515 + #endif /* UseStaticTemplates */ 1516 + 1517 + kern_return_t RetCode; 1518 + mach_msg_type_number_t masksCnt; 1519 + exception_handler_t old_handlers[32]; 1520 + exception_behavior_t old_behaviors[32]; 1521 + thread_state_flavor_t old_flavors[32]; 1522 + 1523 + __DeclareRcvRpc(3615, "thread_swap_exception_ports") 1524 + __BeforeRcvRpc(3615, "thread_swap_exception_ports") 1525 + 1526 + #if defined(__MIG_check__Request__thread_swap_exception_ports_t__defined) 1527 + check_result = __MIG_check__Request__thread_swap_exception_ports_t((__Request *)In0P); 1528 + if (check_result != MACH_MSG_SUCCESS) 1529 + { MIG_RETURN_ERROR(OutP, check_result); } 1530 + #endif /* defined(__MIG_check__Request__thread_swap_exception_ports_t__defined) */ 1531 + 1532 + { 1533 + register mach_msg_port_descriptor_t *ptr; 1534 + register int i; 1535 + 1536 + ptr = &OutP->old_handlers[0]; 1537 + for (i = 0; i < 32; ptr++, i++) { 1538 + #if UseStaticTemplates 1539 + *ptr = old_handlersTemplate; 1540 + #else /* UseStaticTemplates */ 1541 + ptr->name = MACH_PORT_NULL; 1542 + ptr->disposition = 19; 1543 + ptr->type = MACH_MSG_PORT_DESCRIPTOR; 1544 + #endif /* UseStaticTemplates */ 1545 + } 1546 + } 1547 + 1548 + 1549 + masksCnt = 32; 1550 + 1551 + RetCode = thread_swap_exception_ports(In0P->Head.msgh_request_port, In0P->exception_mask, In0P->new_port.name, In0P->behavior, In0P->new_flavor, OutP->masks, &masksCnt, old_handlers, old_behaviors, old_flavors); 1552 + if (RetCode != KERN_SUCCESS) { 1553 + MIG_RETURN_ERROR(OutP, RetCode); 1554 + } 1555 + { 1556 + register mach_msg_port_descriptor_t *ptr; 1557 + register int i, j; 1558 + 1559 + ptr = &OutP->old_handlers[0]; 1560 + j = min(32, masksCnt); 1561 + for (i = 0; i < j; ptr++, i++) { 1562 + ptr->name = old_handlers[i]; 1563 + } 1564 + } 1565 + 1566 + 1567 + OutP->NDR = NDR_record; 1568 + 1569 + OutP->masksCnt = masksCnt; 1570 + msgh_size_delta = _WALIGN_((4 * masksCnt + 7) & ~7); 1571 + msgh_size = (mach_msg_size_t)(sizeof(Reply) - 384) + msgh_size_delta; 1572 + OutP = (Reply *) ((pointer_t) OutP + msgh_size_delta - 128); 1573 + (void)memcpy((char *) OutP->old_behaviors, (const char *) old_behaviors, 4 * masksCnt); 1574 + msgh_size_delta = _WALIGN_((4 * masksCnt + 7) & ~7); 1575 + msgh_size += msgh_size_delta; 1576 + OutP = (Reply *) ((pointer_t) OutP + msgh_size_delta - 128); 1577 + (void)memcpy((char *) OutP->old_flavors, (const char *) old_flavors, 4 * masksCnt); 1578 + msgh_size += _WALIGN_((4 * masksCnt + 7) & ~7); 1579 + 1580 + OutP = (Reply *) OutHeadP; 1581 + OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; 1582 + OutP->Head.msgh_size = msgh_size; 1583 + OutP->msgh_body.msgh_descriptor_count = 32; 1584 + __AfterRcvRpc(3615, "thread_swap_exception_ports") 1585 + } 1586 + 1587 + #if ( __MigTypeCheck ) 1588 + #if __MIG_check__Request__thread_act_subsystem__ 1589 + #if !defined(__MIG_check__Request___kernelrpc_thread_policy_t__defined) 1590 + #define __MIG_check__Request___kernelrpc_thread_policy_t__defined 1591 + 1592 + mig_internal kern_return_t __MIG_check__Request___kernelrpc_thread_policy_t(__attribute__((__unused__)) __Request___kernelrpc_thread_policy_t *In0P, __attribute__((__unused__)) __Request___kernelrpc_thread_policy_t **In1PP) 1593 + { 1594 + 1595 + typedef __Request___kernelrpc_thread_policy_t __Request; 1596 + __Request *In1P; 1597 + #if __MigTypeCheck 1598 + unsigned int msgh_size; 1599 + #endif /* __MigTypeCheck */ 1600 + unsigned int msgh_size_delta; 1601 + 1602 + #if __MigTypeCheck 1603 + msgh_size = In0P->Head.msgh_size; 1604 + if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || 1605 + (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 20)) || (msgh_size > (mach_msg_size_t)sizeof(__Request))) 1606 + return MIG_BAD_ARGUMENTS; 1607 + #endif /* __MigTypeCheck */ 1608 + 1609 + #if defined(__NDR_convert__int_rep__Request___kernelrpc_thread_policy_t__baseCnt__defined) 1610 + if (In0P->NDR.int_rep != NDR_record.int_rep) 1611 + __NDR_convert__int_rep__Request___kernelrpc_thread_policy_t__baseCnt(&In0P->baseCnt, In0P->NDR.int_rep); 1612 + #endif /* __NDR_convert__int_rep__Request___kernelrpc_thread_policy_t__baseCnt__defined */ 1613 + msgh_size_delta = _WALIGN_(4 * In0P->baseCnt); 1614 + #if __MigTypeCheck 1615 + if ( In0P->baseCnt > 5 ) 1616 + return MIG_BAD_ARGUMENTS; 1617 + if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 20)) / 4 < In0P->baseCnt) || 1618 + (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 20) + _WALIGN_(4 * In0P->baseCnt))) 1619 + return MIG_BAD_ARGUMENTS; 1620 + #endif /* __MigTypeCheck */ 1621 + 1622 + *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 20); 1623 + 1624 + return MACH_MSG_SUCCESS; 1625 + } 1626 + #endif /* !defined(__MIG_check__Request___kernelrpc_thread_policy_t__defined) */ 1627 + #endif /* __MIG_check__Request__thread_act_subsystem__ */ 1628 + #endif /* ( __MigTypeCheck ) */ 1629 + 1630 + 1631 + /* Routine _kernelrpc_thread_policy */ 1632 + mig_internal novalue _X_kernelrpc_thread_policy 1633 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) 1634 + { 1635 + 1636 + #ifdef __MigPackStructs 1637 + #pragma pack(8) 1638 + #endif 1639 + typedef struct { 1640 + mach_msg_header_t Head; 1641 + NDR_record_t NDR; 1642 + policy_t policy; 1643 + mach_msg_type_number_t baseCnt; 1644 + integer_t base[5]; 1645 + boolean_t set_limit; 1646 + mach_msg_trailer_t trailer; 1647 + } Request; 1648 + #ifdef __MigPackStructs 1649 + #pragma pack() 1650 + #endif 1651 + typedef __Request___kernelrpc_thread_policy_t __Request; 1652 + typedef __Reply___kernelrpc_thread_policy_t Reply; 1653 + 1654 + /* 1655 + * typedef struct { 1656 + * mach_msg_header_t Head; 1657 + * NDR_record_t NDR; 1658 + * kern_return_t RetCode; 1659 + * } mig_reply_error_t; 1660 + */ 1661 + 1662 + Request *In0P = (Request *) InHeadP; 1663 + Request *In1P; 1664 + Reply *OutP = (Reply *) OutHeadP; 1665 + #ifdef __MIG_check__Request___kernelrpc_thread_policy_t__defined 1666 + kern_return_t check_result; 1667 + #endif /* __MIG_check__Request___kernelrpc_thread_policy_t__defined */ 1668 + 1669 + __DeclareRcvRpc(3616, "_kernelrpc_thread_policy") 1670 + __BeforeRcvRpc(3616, "_kernelrpc_thread_policy") 1671 + 1672 + #if defined(__MIG_check__Request___kernelrpc_thread_policy_t__defined) 1673 + check_result = __MIG_check__Request___kernelrpc_thread_policy_t((__Request *)In0P, (__Request **)&In1P); 1674 + if (check_result != MACH_MSG_SUCCESS) 1675 + { MIG_RETURN_ERROR(OutP, check_result); } 1676 + #endif /* defined(__MIG_check__Request___kernelrpc_thread_policy_t__defined) */ 1677 + 1678 + OutP->RetCode = _kernelrpc_thread_policy(In0P->Head.msgh_request_port, In0P->policy, In0P->base, In0P->baseCnt, In1P->set_limit); 1679 + 1680 + OutP->NDR = NDR_record; 1681 + 1682 + 1683 + __AfterRcvRpc(3616, "_kernelrpc_thread_policy") 1684 + } 1685 + 1686 + #if ( __MigTypeCheck ) 1687 + #if __MIG_check__Request__thread_act_subsystem__ 1688 + #if !defined(__MIG_check__Request___kernelrpc_thread_policy_set_t__defined) 1689 + #define __MIG_check__Request___kernelrpc_thread_policy_set_t__defined 1690 + 1691 + mig_internal kern_return_t __MIG_check__Request___kernelrpc_thread_policy_set_t(__attribute__((__unused__)) __Request___kernelrpc_thread_policy_set_t *In0P) 1692 + { 1693 + 1694 + typedef __Request___kernelrpc_thread_policy_set_t __Request; 1695 + #if __MigTypeCheck 1696 + unsigned int msgh_size; 1697 + #endif /* __MigTypeCheck */ 1698 + 1699 + #if __MigTypeCheck 1700 + msgh_size = In0P->Head.msgh_size; 1701 + if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || 1702 + (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 64)) || (msgh_size > (mach_msg_size_t)sizeof(__Request))) 1703 + return MIG_BAD_ARGUMENTS; 1704 + #endif /* __MigTypeCheck */ 1705 + 1706 + #if defined(__NDR_convert__int_rep__Request___kernelrpc_thread_policy_set_t__policy_infoCnt__defined) 1707 + if (In0P->NDR.int_rep != NDR_record.int_rep) 1708 + __NDR_convert__int_rep__Request___kernelrpc_thread_policy_set_t__policy_infoCnt(&In0P->policy_infoCnt, In0P->NDR.int_rep); 1709 + #endif /* __NDR_convert__int_rep__Request___kernelrpc_thread_policy_set_t__policy_infoCnt__defined */ 1710 + #if __MigTypeCheck 1711 + if ( In0P->policy_infoCnt > 16 ) 1712 + return MIG_BAD_ARGUMENTS; 1713 + if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 64)) / 4 < In0P->policy_infoCnt) || 1714 + (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 64) + _WALIGN_(4 * In0P->policy_infoCnt))) 1715 + return MIG_BAD_ARGUMENTS; 1716 + #endif /* __MigTypeCheck */ 1717 + 1718 + return MACH_MSG_SUCCESS; 1719 + } 1720 + #endif /* !defined(__MIG_check__Request___kernelrpc_thread_policy_set_t__defined) */ 1721 + #endif /* __MIG_check__Request__thread_act_subsystem__ */ 1722 + #endif /* ( __MigTypeCheck ) */ 1723 + 1724 + 1725 + /* Routine _kernelrpc_thread_policy_set */ 1726 + mig_internal novalue _X_kernelrpc_thread_policy_set 1727 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) 1728 + { 1729 + 1730 + #ifdef __MigPackStructs 1731 + #pragma pack(8) 1732 + #endif 1733 + typedef struct { 1734 + mach_msg_header_t Head; 1735 + NDR_record_t NDR; 1736 + thread_policy_flavor_t flavor; 1737 + mach_msg_type_number_t policy_infoCnt; 1738 + integer_t policy_info[16]; 1739 + mach_msg_trailer_t trailer; 1740 + } Request; 1741 + #ifdef __MigPackStructs 1742 + #pragma pack() 1743 + #endif 1744 + typedef __Request___kernelrpc_thread_policy_set_t __Request; 1745 + typedef __Reply___kernelrpc_thread_policy_set_t Reply; 1746 + 1747 + /* 1748 + * typedef struct { 1749 + * mach_msg_header_t Head; 1750 + * NDR_record_t NDR; 1751 + * kern_return_t RetCode; 1752 + * } mig_reply_error_t; 1753 + */ 1754 + 1755 + Request *In0P = (Request *) InHeadP; 1756 + Reply *OutP = (Reply *) OutHeadP; 1757 + #ifdef __MIG_check__Request___kernelrpc_thread_policy_set_t__defined 1758 + kern_return_t check_result; 1759 + #endif /* __MIG_check__Request___kernelrpc_thread_policy_set_t__defined */ 1760 + 1761 + __DeclareRcvRpc(3617, "_kernelrpc_thread_policy_set") 1762 + __BeforeRcvRpc(3617, "_kernelrpc_thread_policy_set") 1763 + 1764 + #if defined(__MIG_check__Request___kernelrpc_thread_policy_set_t__defined) 1765 + check_result = __MIG_check__Request___kernelrpc_thread_policy_set_t((__Request *)In0P); 1766 + if (check_result != MACH_MSG_SUCCESS) 1767 + { MIG_RETURN_ERROR(OutP, check_result); } 1768 + #endif /* defined(__MIG_check__Request___kernelrpc_thread_policy_set_t__defined) */ 1769 + 1770 + OutP->RetCode = _kernelrpc_thread_policy_set(In0P->Head.msgh_request_port, In0P->flavor, In0P->policy_info, In0P->policy_infoCnt); 1771 + 1772 + OutP->NDR = NDR_record; 1773 + 1774 + 1775 + __AfterRcvRpc(3617, "_kernelrpc_thread_policy_set") 1776 + } 1777 + 1778 + #if ( __MigTypeCheck ) 1779 + #if __MIG_check__Request__thread_act_subsystem__ 1780 + #if !defined(__MIG_check__Request__thread_policy_get_t__defined) 1781 + #define __MIG_check__Request__thread_policy_get_t__defined 1782 + 1783 + mig_internal kern_return_t __MIG_check__Request__thread_policy_get_t(__attribute__((__unused__)) __Request__thread_policy_get_t *In0P) 1784 + { 1785 + 1786 + typedef __Request__thread_policy_get_t __Request; 1787 + #if __MigTypeCheck 1788 + if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || 1789 + (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) 1790 + return MIG_BAD_ARGUMENTS; 1791 + #endif /* __MigTypeCheck */ 1792 + 1793 + return MACH_MSG_SUCCESS; 1794 + } 1795 + #endif /* !defined(__MIG_check__Request__thread_policy_get_t__defined) */ 1796 + #endif /* __MIG_check__Request__thread_act_subsystem__ */ 1797 + #endif /* ( __MigTypeCheck ) */ 1798 + 1799 + 1800 + /* Routine thread_policy_get */ 1801 + mig_internal novalue _Xthread_policy_get 1802 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) 1803 + { 1804 + 1805 + #ifdef __MigPackStructs 1806 + #pragma pack(8) 1807 + #endif 1808 + typedef struct { 1809 + mach_msg_header_t Head; 1810 + NDR_record_t NDR; 1811 + thread_policy_flavor_t flavor; 1812 + mach_msg_type_number_t policy_infoCnt; 1813 + boolean_t get_default; 1814 + mach_msg_trailer_t trailer; 1815 + } Request; 1816 + #ifdef __MigPackStructs 1817 + #pragma pack() 1818 + #endif 1819 + typedef __Request__thread_policy_get_t __Request; 1820 + typedef __Reply__thread_policy_get_t Reply; 1821 + 1822 + /* 1823 + * typedef struct { 1824 + * mach_msg_header_t Head; 1825 + * NDR_record_t NDR; 1826 + * kern_return_t RetCode; 1827 + * } mig_reply_error_t; 1828 + */ 1829 + 1830 + Request *In0P = (Request *) InHeadP; 1831 + Reply *OutP = (Reply *) OutHeadP; 1832 + unsigned int msgh_size_delta; 1833 + 1834 + #ifdef __MIG_check__Request__thread_policy_get_t__defined 1835 + kern_return_t check_result; 1836 + #endif /* __MIG_check__Request__thread_policy_get_t__defined */ 1837 + 1838 + __DeclareRcvRpc(3618, "thread_policy_get") 1839 + __BeforeRcvRpc(3618, "thread_policy_get") 1840 + 1841 + #if defined(__MIG_check__Request__thread_policy_get_t__defined) 1842 + check_result = __MIG_check__Request__thread_policy_get_t((__Request *)In0P); 1843 + if (check_result != MACH_MSG_SUCCESS) 1844 + { MIG_RETURN_ERROR(OutP, check_result); } 1845 + #endif /* defined(__MIG_check__Request__thread_policy_get_t__defined) */ 1846 + 1847 + OutP->policy_infoCnt = 16; 1848 + if (In0P->policy_infoCnt < OutP->policy_infoCnt) 1849 + OutP->policy_infoCnt = In0P->policy_infoCnt; 1850 + 1851 + OutP->RetCode = thread_policy_get(In0P->Head.msgh_request_port, In0P->flavor, OutP->policy_info, &OutP->policy_infoCnt, &In0P->get_default); 1852 + if (OutP->RetCode != KERN_SUCCESS) { 1853 + MIG_RETURN_ERROR(OutP, OutP->RetCode); 1854 + } 1855 + 1856 + OutP->NDR = NDR_record; 1857 + 1858 + msgh_size_delta = _WALIGN_((4 * OutP->policy_infoCnt + 7) & ~7); 1859 + OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 64) + msgh_size_delta; 1860 + OutP = (Reply *) ((pointer_t) OutP + msgh_size_delta - 64); 1861 + 1862 + OutP->get_default = In0P->get_default; 1863 + 1864 + OutP = (Reply *) OutHeadP; 1865 + __AfterRcvRpc(3618, "thread_policy_get") 1866 + } 1867 + 1868 + #if ( __MigTypeCheck ) 1869 + #if __MIG_check__Request__thread_act_subsystem__ 1870 + #if !defined(__MIG_check__Request__thread_sample_t__defined) 1871 + #define __MIG_check__Request__thread_sample_t__defined 1872 + 1873 + mig_internal kern_return_t __MIG_check__Request__thread_sample_t(__attribute__((__unused__)) __Request__thread_sample_t *In0P) 1874 + { 1875 + 1876 + typedef __Request__thread_sample_t __Request; 1877 + #if __MigTypeCheck 1878 + if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || 1879 + (In0P->msgh_body.msgh_descriptor_count != 1) || 1880 + (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) 1881 + return MIG_BAD_ARGUMENTS; 1882 + #endif /* __MigTypeCheck */ 1883 + 1884 + #if __MigTypeCheck 1885 + if (In0P->reply.type != MACH_MSG_PORT_DESCRIPTOR || 1886 + In0P->reply.disposition != 17) 1887 + return MIG_TYPE_ERROR; 1888 + #endif /* __MigTypeCheck */ 1889 + 1890 + return MACH_MSG_SUCCESS; 1891 + } 1892 + #endif /* !defined(__MIG_check__Request__thread_sample_t__defined) */ 1893 + #endif /* __MIG_check__Request__thread_act_subsystem__ */ 1894 + #endif /* ( __MigTypeCheck ) */ 1895 + 1896 + 1897 + /* Routine thread_sample */ 1898 + mig_internal novalue _Xthread_sample 1899 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) 1900 + { 1901 + 1902 + #ifdef __MigPackStructs 1903 + #pragma pack(8) 1904 + #endif 1905 + typedef struct { 1906 + mach_msg_header_t Head; 1907 + /* start of the kernel processed data */ 1908 + mach_msg_body_t msgh_body; 1909 + mach_msg_port_descriptor_t reply; 1910 + /* end of the kernel processed data */ 1911 + mach_msg_trailer_t trailer; 1912 + } Request; 1913 + #ifdef __MigPackStructs 1914 + #pragma pack() 1915 + #endif 1916 + typedef __Request__thread_sample_t __Request; 1917 + typedef __Reply__thread_sample_t Reply; 1918 + 1919 + /* 1920 + * typedef struct { 1921 + * mach_msg_header_t Head; 1922 + * NDR_record_t NDR; 1923 + * kern_return_t RetCode; 1924 + * } mig_reply_error_t; 1925 + */ 1926 + 1927 + Request *In0P = (Request *) InHeadP; 1928 + Reply *OutP = (Reply *) OutHeadP; 1929 + #ifdef __MIG_check__Request__thread_sample_t__defined 1930 + kern_return_t check_result; 1931 + #endif /* __MIG_check__Request__thread_sample_t__defined */ 1932 + 1933 + __DeclareRcvRpc(3619, "thread_sample") 1934 + __BeforeRcvRpc(3619, "thread_sample") 1935 + 1936 + #if defined(__MIG_check__Request__thread_sample_t__defined) 1937 + check_result = __MIG_check__Request__thread_sample_t((__Request *)In0P); 1938 + if (check_result != MACH_MSG_SUCCESS) 1939 + { MIG_RETURN_ERROR(OutP, check_result); } 1940 + #endif /* defined(__MIG_check__Request__thread_sample_t__defined) */ 1941 + 1942 + OutP->RetCode = thread_sample(In0P->Head.msgh_request_port, In0P->reply.name); 1943 + 1944 + OutP->NDR = NDR_record; 1945 + 1946 + 1947 + __AfterRcvRpc(3619, "thread_sample") 1948 + } 1949 + 1950 + #if ( __MigTypeCheck ) 1951 + #if __MIG_check__Request__thread_act_subsystem__ 1952 + #if !defined(__MIG_check__Request__etap_trace_thread_t__defined) 1953 + #define __MIG_check__Request__etap_trace_thread_t__defined 1954 + 1955 + mig_internal kern_return_t __MIG_check__Request__etap_trace_thread_t(__attribute__((__unused__)) __Request__etap_trace_thread_t *In0P) 1956 + { 1957 + 1958 + typedef __Request__etap_trace_thread_t __Request; 1959 + #if __MigTypeCheck 1960 + if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || 1961 + (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) 1962 + return MIG_BAD_ARGUMENTS; 1963 + #endif /* __MigTypeCheck */ 1964 + 1965 + return MACH_MSG_SUCCESS; 1966 + } 1967 + #endif /* !defined(__MIG_check__Request__etap_trace_thread_t__defined) */ 1968 + #endif /* __MIG_check__Request__thread_act_subsystem__ */ 1969 + #endif /* ( __MigTypeCheck ) */ 1970 + 1971 + 1972 + /* Routine etap_trace_thread */ 1973 + mig_internal novalue _Xetap_trace_thread 1974 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) 1975 + { 1976 + 1977 + #ifdef __MigPackStructs 1978 + #pragma pack(8) 1979 + #endif 1980 + typedef struct { 1981 + mach_msg_header_t Head; 1982 + NDR_record_t NDR; 1983 + boolean_t trace_status; 1984 + mach_msg_trailer_t trailer; 1985 + } Request; 1986 + #ifdef __MigPackStructs 1987 + #pragma pack() 1988 + #endif 1989 + typedef __Request__etap_trace_thread_t __Request; 1990 + typedef __Reply__etap_trace_thread_t Reply; 1991 + 1992 + /* 1993 + * typedef struct { 1994 + * mach_msg_header_t Head; 1995 + * NDR_record_t NDR; 1996 + * kern_return_t RetCode; 1997 + * } mig_reply_error_t; 1998 + */ 1999 + 2000 + Request *In0P = (Request *) InHeadP; 2001 + Reply *OutP = (Reply *) OutHeadP; 2002 + #ifdef __MIG_check__Request__etap_trace_thread_t__defined 2003 + kern_return_t check_result; 2004 + #endif /* __MIG_check__Request__etap_trace_thread_t__defined */ 2005 + 2006 + __DeclareRcvRpc(3620, "etap_trace_thread") 2007 + __BeforeRcvRpc(3620, "etap_trace_thread") 2008 + 2009 + #if defined(__MIG_check__Request__etap_trace_thread_t__defined) 2010 + check_result = __MIG_check__Request__etap_trace_thread_t((__Request *)In0P); 2011 + if (check_result != MACH_MSG_SUCCESS) 2012 + { MIG_RETURN_ERROR(OutP, check_result); } 2013 + #endif /* defined(__MIG_check__Request__etap_trace_thread_t__defined) */ 2014 + 2015 + OutP->RetCode = etap_trace_thread(In0P->Head.msgh_request_port, In0P->trace_status); 2016 + 2017 + OutP->NDR = NDR_record; 2018 + 2019 + 2020 + __AfterRcvRpc(3620, "etap_trace_thread") 2021 + } 2022 + 2023 + #if ( __MigTypeCheck ) 2024 + #if __MIG_check__Request__thread_act_subsystem__ 2025 + #if !defined(__MIG_check__Request__thread_assign_t__defined) 2026 + #define __MIG_check__Request__thread_assign_t__defined 2027 + 2028 + mig_internal kern_return_t __MIG_check__Request__thread_assign_t(__attribute__((__unused__)) __Request__thread_assign_t *In0P) 2029 + { 2030 + 2031 + typedef __Request__thread_assign_t __Request; 2032 + #if __MigTypeCheck 2033 + if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || 2034 + (In0P->msgh_body.msgh_descriptor_count != 1) || 2035 + (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) 2036 + return MIG_BAD_ARGUMENTS; 2037 + #endif /* __MigTypeCheck */ 2038 + 2039 + #if __MigTypeCheck 2040 + if (In0P->new_set.type != MACH_MSG_PORT_DESCRIPTOR || 2041 + In0P->new_set.disposition != 17) 2042 + return MIG_TYPE_ERROR; 2043 + #endif /* __MigTypeCheck */ 2044 + 2045 + return MACH_MSG_SUCCESS; 2046 + } 2047 + #endif /* !defined(__MIG_check__Request__thread_assign_t__defined) */ 2048 + #endif /* __MIG_check__Request__thread_act_subsystem__ */ 2049 + #endif /* ( __MigTypeCheck ) */ 2050 + 2051 + 2052 + /* Routine thread_assign */ 2053 + mig_internal novalue _Xthread_assign 2054 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) 2055 + { 2056 + 2057 + #ifdef __MigPackStructs 2058 + #pragma pack(8) 2059 + #endif 2060 + typedef struct { 2061 + mach_msg_header_t Head; 2062 + /* start of the kernel processed data */ 2063 + mach_msg_body_t msgh_body; 2064 + mach_msg_port_descriptor_t new_set; 2065 + /* end of the kernel processed data */ 2066 + mach_msg_trailer_t trailer; 2067 + } Request; 2068 + #ifdef __MigPackStructs 2069 + #pragma pack() 2070 + #endif 2071 + typedef __Request__thread_assign_t __Request; 2072 + typedef __Reply__thread_assign_t Reply; 2073 + 2074 + /* 2075 + * typedef struct { 2076 + * mach_msg_header_t Head; 2077 + * NDR_record_t NDR; 2078 + * kern_return_t RetCode; 2079 + * } mig_reply_error_t; 2080 + */ 2081 + 2082 + Request *In0P = (Request *) InHeadP; 2083 + Reply *OutP = (Reply *) OutHeadP; 2084 + #ifdef __MIG_check__Request__thread_assign_t__defined 2085 + kern_return_t check_result; 2086 + #endif /* __MIG_check__Request__thread_assign_t__defined */ 2087 + 2088 + __DeclareRcvRpc(3621, "thread_assign") 2089 + __BeforeRcvRpc(3621, "thread_assign") 2090 + 2091 + #if defined(__MIG_check__Request__thread_assign_t__defined) 2092 + check_result = __MIG_check__Request__thread_assign_t((__Request *)In0P); 2093 + if (check_result != MACH_MSG_SUCCESS) 2094 + { MIG_RETURN_ERROR(OutP, check_result); } 2095 + #endif /* defined(__MIG_check__Request__thread_assign_t__defined) */ 2096 + 2097 + OutP->RetCode = thread_assign(In0P->Head.msgh_request_port, In0P->new_set.name); 2098 + 2099 + OutP->NDR = NDR_record; 2100 + 2101 + 2102 + __AfterRcvRpc(3621, "thread_assign") 2103 + } 2104 + 2105 + #if ( __MigTypeCheck ) 2106 + #if __MIG_check__Request__thread_act_subsystem__ 2107 + #if !defined(__MIG_check__Request__thread_assign_default_t__defined) 2108 + #define __MIG_check__Request__thread_assign_default_t__defined 2109 + 2110 + mig_internal kern_return_t __MIG_check__Request__thread_assign_default_t(__attribute__((__unused__)) __Request__thread_assign_default_t *In0P) 2111 + { 2112 + 2113 + typedef __Request__thread_assign_default_t __Request; 2114 + #if __MigTypeCheck 2115 + if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || 2116 + (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) 2117 + return MIG_BAD_ARGUMENTS; 2118 + #endif /* __MigTypeCheck */ 2119 + 2120 + return MACH_MSG_SUCCESS; 2121 + } 2122 + #endif /* !defined(__MIG_check__Request__thread_assign_default_t__defined) */ 2123 + #endif /* __MIG_check__Request__thread_act_subsystem__ */ 2124 + #endif /* ( __MigTypeCheck ) */ 2125 + 2126 + 2127 + /* Routine thread_assign_default */ 2128 + mig_internal novalue _Xthread_assign_default 2129 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) 2130 + { 2131 + 2132 + #ifdef __MigPackStructs 2133 + #pragma pack(8) 2134 + #endif 2135 + typedef struct { 2136 + mach_msg_header_t Head; 2137 + mach_msg_trailer_t trailer; 2138 + } Request; 2139 + #ifdef __MigPackStructs 2140 + #pragma pack() 2141 + #endif 2142 + typedef __Request__thread_assign_default_t __Request; 2143 + typedef __Reply__thread_assign_default_t Reply; 2144 + 2145 + /* 2146 + * typedef struct { 2147 + * mach_msg_header_t Head; 2148 + * NDR_record_t NDR; 2149 + * kern_return_t RetCode; 2150 + * } mig_reply_error_t; 2151 + */ 2152 + 2153 + Request *In0P = (Request *) InHeadP; 2154 + Reply *OutP = (Reply *) OutHeadP; 2155 + #ifdef __MIG_check__Request__thread_assign_default_t__defined 2156 + kern_return_t check_result; 2157 + #endif /* __MIG_check__Request__thread_assign_default_t__defined */ 2158 + 2159 + __DeclareRcvRpc(3622, "thread_assign_default") 2160 + __BeforeRcvRpc(3622, "thread_assign_default") 2161 + 2162 + #if defined(__MIG_check__Request__thread_assign_default_t__defined) 2163 + check_result = __MIG_check__Request__thread_assign_default_t((__Request *)In0P); 2164 + if (check_result != MACH_MSG_SUCCESS) 2165 + { MIG_RETURN_ERROR(OutP, check_result); } 2166 + #endif /* defined(__MIG_check__Request__thread_assign_default_t__defined) */ 2167 + 2168 + OutP->RetCode = thread_assign_default(In0P->Head.msgh_request_port); 2169 + 2170 + OutP->NDR = NDR_record; 2171 + 2172 + 2173 + __AfterRcvRpc(3622, "thread_assign_default") 2174 + } 2175 + 2176 + #if ( __MigTypeCheck ) 2177 + #if __MIG_check__Request__thread_act_subsystem__ 2178 + #if !defined(__MIG_check__Request__thread_get_assignment_t__defined) 2179 + #define __MIG_check__Request__thread_get_assignment_t__defined 2180 + 2181 + mig_internal kern_return_t __MIG_check__Request__thread_get_assignment_t(__attribute__((__unused__)) __Request__thread_get_assignment_t *In0P) 2182 + { 2183 + 2184 + typedef __Request__thread_get_assignment_t __Request; 2185 + #if __MigTypeCheck 2186 + if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || 2187 + (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) 2188 + return MIG_BAD_ARGUMENTS; 2189 + #endif /* __MigTypeCheck */ 2190 + 2191 + return MACH_MSG_SUCCESS; 2192 + } 2193 + #endif /* !defined(__MIG_check__Request__thread_get_assignment_t__defined) */ 2194 + #endif /* __MIG_check__Request__thread_act_subsystem__ */ 2195 + #endif /* ( __MigTypeCheck ) */ 2196 + 2197 + 2198 + /* Routine thread_get_assignment */ 2199 + mig_internal novalue _Xthread_get_assignment 2200 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) 2201 + { 2202 + 2203 + #ifdef __MigPackStructs 2204 + #pragma pack(8) 2205 + #endif 2206 + typedef struct { 2207 + mach_msg_header_t Head; 2208 + mach_msg_trailer_t trailer; 2209 + } Request; 2210 + #ifdef __MigPackStructs 2211 + #pragma pack() 2212 + #endif 2213 + typedef __Request__thread_get_assignment_t __Request; 2214 + typedef __Reply__thread_get_assignment_t Reply; 2215 + 2216 + /* 2217 + * typedef struct { 2218 + * mach_msg_header_t Head; 2219 + * NDR_record_t NDR; 2220 + * kern_return_t RetCode; 2221 + * } mig_reply_error_t; 2222 + */ 2223 + 2224 + Request *In0P = (Request *) InHeadP; 2225 + Reply *OutP = (Reply *) OutHeadP; 2226 + #ifdef __MIG_check__Request__thread_get_assignment_t__defined 2227 + kern_return_t check_result; 2228 + #endif /* __MIG_check__Request__thread_get_assignment_t__defined */ 2229 + 2230 + #if UseStaticTemplates 2231 + const static mach_msg_port_descriptor_t assigned_setTemplate = { 2232 + /* name = */ MACH_PORT_NULL, 2233 + /* pad1 = */ 0, 2234 + /* pad2 = */ 0, 2235 + /* disp = */ 19, 2236 + /* type = */ MACH_MSG_PORT_DESCRIPTOR, 2237 + }; 2238 + #endif /* UseStaticTemplates */ 2239 + 2240 + kern_return_t RetCode; 2241 + __DeclareRcvRpc(3623, "thread_get_assignment") 2242 + __BeforeRcvRpc(3623, "thread_get_assignment") 2243 + 2244 + #if defined(__MIG_check__Request__thread_get_assignment_t__defined) 2245 + check_result = __MIG_check__Request__thread_get_assignment_t((__Request *)In0P); 2246 + if (check_result != MACH_MSG_SUCCESS) 2247 + { MIG_RETURN_ERROR(OutP, check_result); } 2248 + #endif /* defined(__MIG_check__Request__thread_get_assignment_t__defined) */ 2249 + 2250 + #if UseStaticTemplates 2251 + OutP->assigned_set = assigned_setTemplate; 2252 + #else /* UseStaticTemplates */ 2253 + OutP->assigned_set.disposition = 19; 2254 + OutP->assigned_set.type = MACH_MSG_PORT_DESCRIPTOR; 2255 + #endif /* UseStaticTemplates */ 2256 + 2257 + 2258 + RetCode = thread_get_assignment(In0P->Head.msgh_request_port, &OutP->assigned_set.name); 2259 + if (RetCode != KERN_SUCCESS) { 2260 + MIG_RETURN_ERROR(OutP, RetCode); 2261 + } 2262 + 2263 + OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; 2264 + OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); 2265 + OutP->msgh_body.msgh_descriptor_count = 1; 2266 + __AfterRcvRpc(3623, "thread_get_assignment") 2267 + } 2268 + 2269 + #if ( __MigTypeCheck ) 2270 + #if __MIG_check__Request__thread_act_subsystem__ 2271 + #if !defined(__MIG_check__Request___kernelrpc_thread_set_policy_t__defined) 2272 + #define __MIG_check__Request___kernelrpc_thread_set_policy_t__defined 2273 + 2274 + mig_internal kern_return_t __MIG_check__Request___kernelrpc_thread_set_policy_t(__attribute__((__unused__)) __Request___kernelrpc_thread_set_policy_t *In0P, __attribute__((__unused__)) __Request___kernelrpc_thread_set_policy_t **In1PP) 2275 + { 2276 + 2277 + typedef __Request___kernelrpc_thread_set_policy_t __Request; 2278 + __Request *In1P; 2279 + #if __MigTypeCheck 2280 + unsigned int msgh_size; 2281 + #endif /* __MigTypeCheck */ 2282 + unsigned int msgh_size_delta; 2283 + 2284 + #if __MigTypeCheck 2285 + msgh_size = In0P->Head.msgh_size; 2286 + if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || 2287 + (In0P->msgh_body.msgh_descriptor_count != 1) || 2288 + (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 24)) || (msgh_size > (mach_msg_size_t)sizeof(__Request))) 2289 + return MIG_BAD_ARGUMENTS; 2290 + #endif /* __MigTypeCheck */ 2291 + 2292 + #if __MigTypeCheck 2293 + if (In0P->pset.type != MACH_MSG_PORT_DESCRIPTOR || 2294 + In0P->pset.disposition != 17) 2295 + return MIG_TYPE_ERROR; 2296 + #endif /* __MigTypeCheck */ 2297 + 2298 + #if defined(__NDR_convert__int_rep__Request___kernelrpc_thread_set_policy_t__baseCnt__defined) 2299 + if (In0P->NDR.int_rep != NDR_record.int_rep) 2300 + __NDR_convert__int_rep__Request___kernelrpc_thread_set_policy_t__baseCnt(&In0P->baseCnt, In0P->NDR.int_rep); 2301 + #endif /* __NDR_convert__int_rep__Request___kernelrpc_thread_set_policy_t__baseCnt__defined */ 2302 + msgh_size_delta = _WALIGN_(4 * In0P->baseCnt); 2303 + #if __MigTypeCheck 2304 + if ( In0P->baseCnt > 5 ) 2305 + return MIG_BAD_ARGUMENTS; 2306 + if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 24)) / 4 < In0P->baseCnt) || 2307 + (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 24) + _WALIGN_(4 * In0P->baseCnt))) 2308 + return MIG_BAD_ARGUMENTS; 2309 + msgh_size -= msgh_size_delta; 2310 + #endif /* __MigTypeCheck */ 2311 + 2312 + *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 20); 2313 + 2314 + #if defined(__NDR_convert__int_rep__Request___kernelrpc_thread_set_policy_t__limitCnt__defined) 2315 + if (In0P->NDR.int_rep != NDR_record.int_rep) 2316 + __NDR_convert__int_rep__Request___kernelrpc_thread_set_policy_t__limitCnt(&In1P->limitCnt, In1P->NDR.int_rep); 2317 + #endif /* __NDR_convert__int_rep__Request___kernelrpc_thread_set_policy_t__limitCnt__defined */ 2318 + #if __MigTypeCheck 2319 + if ( In1P->limitCnt > 1 ) 2320 + return MIG_BAD_ARGUMENTS; 2321 + if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 24)) / 4 < In1P->limitCnt) || 2322 + (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 24) + _WALIGN_(4 * In1P->limitCnt))) 2323 + return MIG_BAD_ARGUMENTS; 2324 + #endif /* __MigTypeCheck */ 2325 + 2326 + return MACH_MSG_SUCCESS; 2327 + } 2328 + #endif /* !defined(__MIG_check__Request___kernelrpc_thread_set_policy_t__defined) */ 2329 + #endif /* __MIG_check__Request__thread_act_subsystem__ */ 2330 + #endif /* ( __MigTypeCheck ) */ 2331 + 2332 + 2333 + /* Routine _kernelrpc_thread_set_policy */ 2334 + mig_internal novalue _X_kernelrpc_thread_set_policy 2335 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) 2336 + { 2337 + 2338 + #ifdef __MigPackStructs 2339 + #pragma pack(8) 2340 + #endif 2341 + typedef struct { 2342 + mach_msg_header_t Head; 2343 + /* start of the kernel processed data */ 2344 + mach_msg_body_t msgh_body; 2345 + mach_msg_port_descriptor_t pset; 2346 + /* end of the kernel processed data */ 2347 + NDR_record_t NDR; 2348 + policy_t policy; 2349 + mach_msg_type_number_t baseCnt; 2350 + integer_t base[5]; 2351 + mach_msg_type_number_t limitCnt; 2352 + integer_t limit[1]; 2353 + mach_msg_trailer_t trailer; 2354 + } Request; 2355 + #ifdef __MigPackStructs 2356 + #pragma pack() 2357 + #endif 2358 + typedef __Request___kernelrpc_thread_set_policy_t __Request; 2359 + typedef __Reply___kernelrpc_thread_set_policy_t Reply; 2360 + 2361 + /* 2362 + * typedef struct { 2363 + * mach_msg_header_t Head; 2364 + * NDR_record_t NDR; 2365 + * kern_return_t RetCode; 2366 + * } mig_reply_error_t; 2367 + */ 2368 + 2369 + Request *In0P = (Request *) InHeadP; 2370 + Request *In1P; 2371 + Reply *OutP = (Reply *) OutHeadP; 2372 + #ifdef __MIG_check__Request___kernelrpc_thread_set_policy_t__defined 2373 + kern_return_t check_result; 2374 + #endif /* __MIG_check__Request___kernelrpc_thread_set_policy_t__defined */ 2375 + 2376 + __DeclareRcvRpc(3624, "_kernelrpc_thread_set_policy") 2377 + __BeforeRcvRpc(3624, "_kernelrpc_thread_set_policy") 2378 + 2379 + #if defined(__MIG_check__Request___kernelrpc_thread_set_policy_t__defined) 2380 + check_result = __MIG_check__Request___kernelrpc_thread_set_policy_t((__Request *)In0P, (__Request **)&In1P); 2381 + if (check_result != MACH_MSG_SUCCESS) 2382 + { MIG_RETURN_ERROR(OutP, check_result); } 2383 + #endif /* defined(__MIG_check__Request___kernelrpc_thread_set_policy_t__defined) */ 2384 + 2385 + OutP->RetCode = _kernelrpc_thread_set_policy(In0P->Head.msgh_request_port, In0P->pset.name, In0P->policy, In0P->base, In0P->baseCnt, In1P->limit, In1P->limitCnt); 2386 + 2387 + OutP->NDR = NDR_record; 2388 + 2389 + 2390 + __AfterRcvRpc(3624, "_kernelrpc_thread_set_policy") 2391 + } 2392 + 2393 + #if ( __MigTypeCheck ) 2394 + #if __MIG_check__Request__thread_act_subsystem__ 2395 + #if !defined(__MIG_check__Request__thread_get_mach_voucher_t__defined) 2396 + #define __MIG_check__Request__thread_get_mach_voucher_t__defined 2397 + 2398 + mig_internal kern_return_t __MIG_check__Request__thread_get_mach_voucher_t(__attribute__((__unused__)) __Request__thread_get_mach_voucher_t *In0P) 2399 + { 2400 + 2401 + typedef __Request__thread_get_mach_voucher_t __Request; 2402 + #if __MigTypeCheck 2403 + if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || 2404 + (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) 2405 + return MIG_BAD_ARGUMENTS; 2406 + #endif /* __MigTypeCheck */ 2407 + 2408 + return MACH_MSG_SUCCESS; 2409 + } 2410 + #endif /* !defined(__MIG_check__Request__thread_get_mach_voucher_t__defined) */ 2411 + #endif /* __MIG_check__Request__thread_act_subsystem__ */ 2412 + #endif /* ( __MigTypeCheck ) */ 2413 + 2414 + 2415 + /* Routine thread_get_mach_voucher */ 2416 + mig_internal novalue _Xthread_get_mach_voucher 2417 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) 2418 + { 2419 + 2420 + #ifdef __MigPackStructs 2421 + #pragma pack(8) 2422 + #endif 2423 + typedef struct { 2424 + mach_msg_header_t Head; 2425 + NDR_record_t NDR; 2426 + mach_voucher_selector_t which; 2427 + mach_msg_trailer_t trailer; 2428 + } Request; 2429 + #ifdef __MigPackStructs 2430 + #pragma pack() 2431 + #endif 2432 + typedef __Request__thread_get_mach_voucher_t __Request; 2433 + typedef __Reply__thread_get_mach_voucher_t Reply; 2434 + 2435 + /* 2436 + * typedef struct { 2437 + * mach_msg_header_t Head; 2438 + * NDR_record_t NDR; 2439 + * kern_return_t RetCode; 2440 + * } mig_reply_error_t; 2441 + */ 2442 + 2443 + Request *In0P = (Request *) InHeadP; 2444 + Reply *OutP = (Reply *) OutHeadP; 2445 + #ifdef __MIG_check__Request__thread_get_mach_voucher_t__defined 2446 + kern_return_t check_result; 2447 + #endif /* __MIG_check__Request__thread_get_mach_voucher_t__defined */ 2448 + 2449 + #if UseStaticTemplates 2450 + const static mach_msg_port_descriptor_t voucherTemplate = { 2451 + /* name = */ MACH_PORT_NULL, 2452 + /* pad1 = */ 0, 2453 + /* pad2 = */ 0, 2454 + /* disp = */ 19, 2455 + /* type = */ MACH_MSG_PORT_DESCRIPTOR, 2456 + }; 2457 + #endif /* UseStaticTemplates */ 2458 + 2459 + kern_return_t RetCode; 2460 + __DeclareRcvRpc(3625, "thread_get_mach_voucher") 2461 + __BeforeRcvRpc(3625, "thread_get_mach_voucher") 2462 + 2463 + #if defined(__MIG_check__Request__thread_get_mach_voucher_t__defined) 2464 + check_result = __MIG_check__Request__thread_get_mach_voucher_t((__Request *)In0P); 2465 + if (check_result != MACH_MSG_SUCCESS) 2466 + { MIG_RETURN_ERROR(OutP, check_result); } 2467 + #endif /* defined(__MIG_check__Request__thread_get_mach_voucher_t__defined) */ 2468 + 2469 + #if UseStaticTemplates 2470 + OutP->voucher = voucherTemplate; 2471 + #else /* UseStaticTemplates */ 2472 + OutP->voucher.disposition = 19; 2473 + OutP->voucher.type = MACH_MSG_PORT_DESCRIPTOR; 2474 + #endif /* UseStaticTemplates */ 2475 + 2476 + 2477 + RetCode = thread_get_mach_voucher(In0P->Head.msgh_request_port, In0P->which, &OutP->voucher.name); 2478 + if (RetCode != KERN_SUCCESS) { 2479 + MIG_RETURN_ERROR(OutP, RetCode); 2480 + } 2481 + 2482 + OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; 2483 + OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); 2484 + OutP->msgh_body.msgh_descriptor_count = 1; 2485 + __AfterRcvRpc(3625, "thread_get_mach_voucher") 2486 + } 2487 + 2488 + #if ( __MigTypeCheck ) 2489 + #if __MIG_check__Request__thread_act_subsystem__ 2490 + #if !defined(__MIG_check__Request__thread_set_mach_voucher_t__defined) 2491 + #define __MIG_check__Request__thread_set_mach_voucher_t__defined 2492 + 2493 + mig_internal kern_return_t __MIG_check__Request__thread_set_mach_voucher_t(__attribute__((__unused__)) __Request__thread_set_mach_voucher_t *In0P) 2494 + { 2495 + 2496 + typedef __Request__thread_set_mach_voucher_t __Request; 2497 + #if __MigTypeCheck 2498 + if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || 2499 + (In0P->msgh_body.msgh_descriptor_count != 1) || 2500 + (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) 2501 + return MIG_BAD_ARGUMENTS; 2502 + #endif /* __MigTypeCheck */ 2503 + 2504 + #if __MigTypeCheck 2505 + if (In0P->voucher.type != MACH_MSG_PORT_DESCRIPTOR || 2506 + In0P->voucher.disposition != 17) 2507 + return MIG_TYPE_ERROR; 2508 + #endif /* __MigTypeCheck */ 2509 + 2510 + return MACH_MSG_SUCCESS; 2511 + } 2512 + #endif /* !defined(__MIG_check__Request__thread_set_mach_voucher_t__defined) */ 2513 + #endif /* __MIG_check__Request__thread_act_subsystem__ */ 2514 + #endif /* ( __MigTypeCheck ) */ 2515 + 2516 + 2517 + /* Routine thread_set_mach_voucher */ 2518 + mig_internal novalue _Xthread_set_mach_voucher 2519 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) 2520 + { 2521 + 2522 + #ifdef __MigPackStructs 2523 + #pragma pack(8) 2524 + #endif 2525 + typedef struct { 2526 + mach_msg_header_t Head; 2527 + /* start of the kernel processed data */ 2528 + mach_msg_body_t msgh_body; 2529 + mach_msg_port_descriptor_t voucher; 2530 + /* end of the kernel processed data */ 2531 + mach_msg_trailer_t trailer; 2532 + } Request; 2533 + #ifdef __MigPackStructs 2534 + #pragma pack() 2535 + #endif 2536 + typedef __Request__thread_set_mach_voucher_t __Request; 2537 + typedef __Reply__thread_set_mach_voucher_t Reply; 2538 + 2539 + /* 2540 + * typedef struct { 2541 + * mach_msg_header_t Head; 2542 + * NDR_record_t NDR; 2543 + * kern_return_t RetCode; 2544 + * } mig_reply_error_t; 2545 + */ 2546 + 2547 + Request *In0P = (Request *) InHeadP; 2548 + Reply *OutP = (Reply *) OutHeadP; 2549 + #ifdef __MIG_check__Request__thread_set_mach_voucher_t__defined 2550 + kern_return_t check_result; 2551 + #endif /* __MIG_check__Request__thread_set_mach_voucher_t__defined */ 2552 + 2553 + __DeclareRcvRpc(3626, "thread_set_mach_voucher") 2554 + __BeforeRcvRpc(3626, "thread_set_mach_voucher") 2555 + 2556 + #if defined(__MIG_check__Request__thread_set_mach_voucher_t__defined) 2557 + check_result = __MIG_check__Request__thread_set_mach_voucher_t((__Request *)In0P); 2558 + if (check_result != MACH_MSG_SUCCESS) 2559 + { MIG_RETURN_ERROR(OutP, check_result); } 2560 + #endif /* defined(__MIG_check__Request__thread_set_mach_voucher_t__defined) */ 2561 + 2562 + OutP->RetCode = thread_set_mach_voucher(In0P->Head.msgh_request_port, In0P->voucher.name); 2563 + 2564 + OutP->NDR = NDR_record; 2565 + 2566 + 2567 + __AfterRcvRpc(3626, "thread_set_mach_voucher") 2568 + } 2569 + 2570 + #if ( __MigTypeCheck ) 2571 + #if __MIG_check__Request__thread_act_subsystem__ 2572 + #if !defined(__MIG_check__Request__thread_swap_mach_voucher_t__defined) 2573 + #define __MIG_check__Request__thread_swap_mach_voucher_t__defined 2574 + 2575 + mig_internal kern_return_t __MIG_check__Request__thread_swap_mach_voucher_t(__attribute__((__unused__)) __Request__thread_swap_mach_voucher_t *In0P) 2576 + { 2577 + 2578 + typedef __Request__thread_swap_mach_voucher_t __Request; 2579 + #if __MigTypeCheck 2580 + if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || 2581 + (In0P->msgh_body.msgh_descriptor_count != 2) || 2582 + (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) 2583 + return MIG_BAD_ARGUMENTS; 2584 + #endif /* __MigTypeCheck */ 2585 + 2586 + #if __MigTypeCheck 2587 + if (In0P->new_voucher.type != MACH_MSG_PORT_DESCRIPTOR || 2588 + In0P->new_voucher.disposition != 17) 2589 + return MIG_TYPE_ERROR; 2590 + #endif /* __MigTypeCheck */ 2591 + 2592 + #if __MigTypeCheck 2593 + if (In0P->old_voucher.type != MACH_MSG_PORT_DESCRIPTOR || 2594 + In0P->old_voucher.disposition != 17) 2595 + return MIG_TYPE_ERROR; 2596 + #endif /* __MigTypeCheck */ 2597 + 2598 + return MACH_MSG_SUCCESS; 2599 + } 2600 + #endif /* !defined(__MIG_check__Request__thread_swap_mach_voucher_t__defined) */ 2601 + #endif /* __MIG_check__Request__thread_act_subsystem__ */ 2602 + #endif /* ( __MigTypeCheck ) */ 2603 + 2604 + 2605 + /* Routine thread_swap_mach_voucher */ 2606 + mig_internal novalue _Xthread_swap_mach_voucher 2607 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) 2608 + { 2609 + 2610 + #ifdef __MigPackStructs 2611 + #pragma pack(8) 2612 + #endif 2613 + typedef struct { 2614 + mach_msg_header_t Head; 2615 + /* start of the kernel processed data */ 2616 + mach_msg_body_t msgh_body; 2617 + mach_msg_port_descriptor_t new_voucher; 2618 + mach_msg_port_descriptor_t old_voucher; 2619 + /* end of the kernel processed data */ 2620 + mach_msg_trailer_t trailer; 2621 + } Request; 2622 + #ifdef __MigPackStructs 2623 + #pragma pack() 2624 + #endif 2625 + typedef __Request__thread_swap_mach_voucher_t __Request; 2626 + typedef __Reply__thread_swap_mach_voucher_t Reply; 2627 + 2628 + /* 2629 + * typedef struct { 2630 + * mach_msg_header_t Head; 2631 + * NDR_record_t NDR; 2632 + * kern_return_t RetCode; 2633 + * } mig_reply_error_t; 2634 + */ 2635 + 2636 + Request *In0P = (Request *) InHeadP; 2637 + Reply *OutP = (Reply *) OutHeadP; 2638 + #ifdef __MIG_check__Request__thread_swap_mach_voucher_t__defined 2639 + kern_return_t check_result; 2640 + #endif /* __MIG_check__Request__thread_swap_mach_voucher_t__defined */ 2641 + 2642 + #if UseStaticTemplates 2643 + const static mach_msg_port_descriptor_t old_voucherTemplate = { 2644 + /* name = */ MACH_PORT_NULL, 2645 + /* pad1 = */ 0, 2646 + /* pad2 = */ 0, 2647 + /* disp = */ 19, 2648 + /* type = */ MACH_MSG_PORT_DESCRIPTOR, 2649 + }; 2650 + #endif /* UseStaticTemplates */ 2651 + 2652 + kern_return_t RetCode; 2653 + __DeclareRcvRpc(3627, "thread_swap_mach_voucher") 2654 + __BeforeRcvRpc(3627, "thread_swap_mach_voucher") 2655 + 2656 + #if defined(__MIG_check__Request__thread_swap_mach_voucher_t__defined) 2657 + check_result = __MIG_check__Request__thread_swap_mach_voucher_t((__Request *)In0P); 2658 + if (check_result != MACH_MSG_SUCCESS) 2659 + { MIG_RETURN_ERROR(OutP, check_result); } 2660 + #endif /* defined(__MIG_check__Request__thread_swap_mach_voucher_t__defined) */ 2661 + 2662 + #if UseStaticTemplates 2663 + OutP->old_voucher = old_voucherTemplate; 2664 + #else /* UseStaticTemplates */ 2665 + OutP->old_voucher.disposition = 19; 2666 + OutP->old_voucher.type = MACH_MSG_PORT_DESCRIPTOR; 2667 + #endif /* UseStaticTemplates */ 2668 + 2669 + 2670 + RetCode = thread_swap_mach_voucher(In0P->Head.msgh_request_port, In0P->new_voucher.name, &In0P->old_voucher.name); 2671 + if (RetCode != KERN_SUCCESS) { 2672 + MIG_RETURN_ERROR(OutP, RetCode); 2673 + } 2674 + 2675 + OutP->old_voucher.name = In0P->old_voucher.name; 2676 + 2677 + OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; 2678 + OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); 2679 + OutP->msgh_body.msgh_descriptor_count = 1; 2680 + __AfterRcvRpc(3627, "thread_swap_mach_voucher") 2681 + } 2682 + 2683 + 2684 + 2685 + /* Description of this subsystem, for use in direct RPC */ 2686 + const struct thread_act_subsystem thread_act_subsystem = { 2687 + thread_act_server_routine, 2688 + 3600, 2689 + 3628, 2690 + (mach_msg_size_t)sizeof(union __ReplyUnion__thread_act_subsystem), 2691 + (vm_address_t)0, 2692 + { 2693 + { (mig_impl_routine_t) 0, 2694 + (mig_stub_routine_t) _Xthread_terminate, 1, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__thread_terminate_t)}, 2695 + { (mig_impl_routine_t) 0, 2696 + (mig_stub_routine_t) _Xact_get_state, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__act_get_state_t)}, 2697 + { (mig_impl_routine_t) 0, 2698 + (mig_stub_routine_t) _Xact_set_state, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__act_set_state_t)}, 2699 + { (mig_impl_routine_t) 0, 2700 + (mig_stub_routine_t) _Xthread_get_state, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__thread_get_state_t)}, 2701 + { (mig_impl_routine_t) 0, 2702 + (mig_stub_routine_t) _Xthread_set_state, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__thread_set_state_t)}, 2703 + { (mig_impl_routine_t) 0, 2704 + (mig_stub_routine_t) _Xthread_suspend, 1, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__thread_suspend_t)}, 2705 + { (mig_impl_routine_t) 0, 2706 + (mig_stub_routine_t) _Xthread_resume, 1, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__thread_resume_t)}, 2707 + { (mig_impl_routine_t) 0, 2708 + (mig_stub_routine_t) _Xthread_abort, 1, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__thread_abort_t)}, 2709 + { (mig_impl_routine_t) 0, 2710 + (mig_stub_routine_t) _Xthread_abort_safely, 1, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__thread_abort_safely_t)}, 2711 + { (mig_impl_routine_t) 0, 2712 + (mig_stub_routine_t) _Xthread_depress_abort, 1, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__thread_depress_abort_t)}, 2713 + { (mig_impl_routine_t) 0, 2714 + (mig_stub_routine_t) _Xthread_get_special_port, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__thread_get_special_port_t)}, 2715 + { (mig_impl_routine_t) 0, 2716 + (mig_stub_routine_t) _Xthread_set_special_port, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__thread_set_special_port_t)}, 2717 + { (mig_impl_routine_t) 0, 2718 + (mig_stub_routine_t) _Xthread_info, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__thread_info_t)}, 2719 + { (mig_impl_routine_t) 0, 2720 + (mig_stub_routine_t) _Xthread_set_exception_ports, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__thread_set_exception_ports_t)}, 2721 + { (mig_impl_routine_t) 0, 2722 + (mig_stub_routine_t) _Xthread_get_exception_ports, 8, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__thread_get_exception_ports_t)}, 2723 + { (mig_impl_routine_t) 0, 2724 + (mig_stub_routine_t) _Xthread_swap_exception_ports, 11, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__thread_swap_exception_ports_t)}, 2725 + { (mig_impl_routine_t) 0, 2726 + (mig_stub_routine_t) _X_kernelrpc_thread_policy, 6, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply___kernelrpc_thread_policy_t)}, 2727 + { (mig_impl_routine_t) 0, 2728 + (mig_stub_routine_t) _X_kernelrpc_thread_policy_set, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply___kernelrpc_thread_policy_set_t)}, 2729 + { (mig_impl_routine_t) 0, 2730 + (mig_stub_routine_t) _Xthread_policy_get, 6, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__thread_policy_get_t)}, 2731 + { (mig_impl_routine_t) 0, 2732 + (mig_stub_routine_t) _Xthread_sample, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__thread_sample_t)}, 2733 + { (mig_impl_routine_t) 0, 2734 + (mig_stub_routine_t) _Xetap_trace_thread, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__etap_trace_thread_t)}, 2735 + { (mig_impl_routine_t) 0, 2736 + (mig_stub_routine_t) _Xthread_assign, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__thread_assign_t)}, 2737 + { (mig_impl_routine_t) 0, 2738 + (mig_stub_routine_t) _Xthread_assign_default, 1, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__thread_assign_default_t)}, 2739 + { (mig_impl_routine_t) 0, 2740 + (mig_stub_routine_t) _Xthread_get_assignment, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__thread_get_assignment_t)}, 2741 + { (mig_impl_routine_t) 0, 2742 + (mig_stub_routine_t) _X_kernelrpc_thread_set_policy, 9, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply___kernelrpc_thread_set_policy_t)}, 2743 + { (mig_impl_routine_t) 0, 2744 + (mig_stub_routine_t) _Xthread_get_mach_voucher, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__thread_get_mach_voucher_t)}, 2745 + { (mig_impl_routine_t) 0, 2746 + (mig_stub_routine_t) _Xthread_set_mach_voucher, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__thread_set_mach_voucher_t)}, 2747 + { (mig_impl_routine_t) 0, 2748 + (mig_stub_routine_t) _Xthread_swap_mach_voucher, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__thread_swap_mach_voucher_t)}, 2749 + } 2750 + }; 2751 + 2752 + mig_external boolean_t thread_act_server 2753 + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) 2754 + { 2755 + /* 2756 + * typedef struct { 2757 + * mach_msg_header_t Head; 2758 + * NDR_record_t NDR; 2759 + * kern_return_t RetCode; 2760 + * } mig_reply_error_t; 2761 + */ 2762 + 2763 + register mig_routine_t routine; 2764 + 2765 + OutHeadP->msgh_bits = MACH_MSGH_BITS(MACH_MSGH_BITS_REPLY(InHeadP->msgh_bits), 0); 2766 + OutHeadP->msgh_remote_port = InHeadP->msgh_reply_port; 2767 + /* Minimal size: routine() will update it if different */ 2768 + OutHeadP->msgh_size = (mach_msg_size_t)sizeof(mig_reply_error_t); 2769 + OutHeadP->msgh_local_port = MACH_PORT_NULL; 2770 + OutHeadP->msgh_id = InHeadP->msgh_id + 100; 2771 + 2772 + if ((InHeadP->msgh_id > 3627) || (InHeadP->msgh_id < 3600) || 2773 + ((routine = thread_act_subsystem.routine[InHeadP->msgh_id - 3600].stub_routine) == 0)) { 2774 + ((mig_reply_error_t *)OutHeadP)->NDR = NDR_record; 2775 + ((mig_reply_error_t *)OutHeadP)->RetCode = MIG_BAD_ID; 2776 + return FALSE; 2777 + } 2778 + (*routine) (InHeadP, OutHeadP); 2779 + return TRUE; 2780 + } 2781 + 2782 + mig_external mig_routine_t thread_act_server_routine 2783 + (mach_msg_header_t *InHeadP) 2784 + { 2785 + register int msgh_id; 2786 + 2787 + msgh_id = InHeadP->msgh_id - 3600; 2788 + 2789 + if ((msgh_id > 27) || (msgh_id < 0)) 2790 + return 0; 2791 + 2792 + return thread_act_subsystem.routine[msgh_id].stub_routine; 2793 + }
+1323
lkm/mig/thread_actServer.h
··· 1 + #ifndef _thread_act_server_ 2 + #define _thread_act_server_ 3 + 4 + /* Module thread_act */ 5 + 6 + #include <string.h> 7 + #include <mach/ndr.h> 8 + #include <mach/boolean.h> 9 + #include <mach/kern_return.h> 10 + #include <mach/notify.h> 11 + #include <mach/mach_types.h> 12 + #include <mach/message.h> 13 + #include <mach/mig_errors.h> 14 + #include <mach/port.h> 15 + 16 + /* BEGIN VOUCHER CODE */ 17 + 18 + #ifndef KERNEL 19 + #if defined(__has_include) 20 + #if __has_include(<mach/mig_voucher_support.h>) 21 + #ifndef USING_VOUCHERS 22 + #define USING_VOUCHERS 23 + #endif 24 + #ifndef __VOUCHER_FORWARD_TYPE_DECLS__ 25 + #define __VOUCHER_FORWARD_TYPE_DECLS__ 26 + #ifdef __cplusplus 27 + extern "C" { 28 + #endif 29 + extern boolean_t voucher_mach_msg_set(mach_msg_header_t *msg) __attribute__((weak_import)); 30 + #ifdef __cplusplus 31 + } 32 + #endif 33 + #endif // __VOUCHER_FORWARD_TYPE_DECLS__ 34 + #endif // __has_include(<mach/mach_voucher_types.h>) 35 + #endif // __has_include 36 + #endif // !KERNEL 37 + 38 + /* END VOUCHER CODE */ 39 + 40 + 41 + #ifdef AUTOTEST 42 + #ifndef FUNCTION_PTR_T 43 + #define FUNCTION_PTR_T 44 + typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); 45 + typedef struct { 46 + char *name; 47 + function_ptr_t function; 48 + } function_table_entry; 49 + typedef function_table_entry *function_table_t; 50 + #endif /* FUNCTION_PTR_T */ 51 + #endif /* AUTOTEST */ 52 + 53 + #ifndef thread_act_MSG_COUNT 54 + #define thread_act_MSG_COUNT 28 55 + #endif /* thread_act_MSG_COUNT */ 56 + 57 + #include <mach/std_types.h> 58 + #include <mach/mig.h> 59 + #include <mach/mig.h> 60 + #include <mach/mach_types.h> 61 + 62 + #ifdef __BeforeMigServerHeader 63 + __BeforeMigServerHeader 64 + #endif /* __BeforeMigServerHeader */ 65 + 66 + 67 + /* Routine thread_terminate */ 68 + #ifdef mig_external 69 + mig_external 70 + #else 71 + extern 72 + #endif /* mig_external */ 73 + kern_return_t thread_terminate 74 + ( 75 + thread_act_consume_ref_t target_act 76 + ); 77 + 78 + /* Routine act_get_state */ 79 + #ifdef mig_external 80 + mig_external 81 + #else 82 + extern 83 + #endif /* mig_external */ 84 + kern_return_t act_get_state 85 + ( 86 + thread_act_t target_act, 87 + int flavor, 88 + thread_state_t old_state, 89 + mach_msg_type_number_t *old_stateCnt 90 + ); 91 + 92 + /* Routine act_set_state */ 93 + #ifdef mig_external 94 + mig_external 95 + #else 96 + extern 97 + #endif /* mig_external */ 98 + kern_return_t act_set_state 99 + ( 100 + thread_act_t target_act, 101 + int flavor, 102 + thread_state_t new_state, 103 + mach_msg_type_number_t new_stateCnt 104 + ); 105 + 106 + /* Routine thread_get_state */ 107 + #ifdef mig_external 108 + mig_external 109 + #else 110 + extern 111 + #endif /* mig_external */ 112 + kern_return_t thread_get_state 113 + ( 114 + thread_act_t target_act, 115 + thread_state_flavor_t flavor, 116 + thread_state_t old_state, 117 + mach_msg_type_number_t *old_stateCnt 118 + ); 119 + 120 + /* Routine thread_set_state */ 121 + #ifdef mig_external 122 + mig_external 123 + #else 124 + extern 125 + #endif /* mig_external */ 126 + kern_return_t thread_set_state 127 + ( 128 + thread_act_t target_act, 129 + thread_state_flavor_t flavor, 130 + thread_state_t new_state, 131 + mach_msg_type_number_t new_stateCnt 132 + ); 133 + 134 + /* Routine thread_suspend */ 135 + #ifdef mig_external 136 + mig_external 137 + #else 138 + extern 139 + #endif /* mig_external */ 140 + kern_return_t thread_suspend 141 + ( 142 + thread_act_t target_act 143 + ); 144 + 145 + /* Routine thread_resume */ 146 + #ifdef mig_external 147 + mig_external 148 + #else 149 + extern 150 + #endif /* mig_external */ 151 + kern_return_t thread_resume 152 + ( 153 + thread_act_t target_act 154 + ); 155 + 156 + /* Routine thread_abort */ 157 + #ifdef mig_external 158 + mig_external 159 + #else 160 + extern 161 + #endif /* mig_external */ 162 + kern_return_t thread_abort 163 + ( 164 + thread_act_t target_act 165 + ); 166 + 167 + /* Routine thread_abort_safely */ 168 + #ifdef mig_external 169 + mig_external 170 + #else 171 + extern 172 + #endif /* mig_external */ 173 + kern_return_t thread_abort_safely 174 + ( 175 + thread_act_t target_act 176 + ); 177 + 178 + /* Routine thread_depress_abort */ 179 + #ifdef mig_external 180 + mig_external 181 + #else 182 + extern 183 + #endif /* mig_external */ 184 + kern_return_t thread_depress_abort 185 + ( 186 + thread_act_t thread 187 + ); 188 + 189 + /* Routine thread_get_special_port */ 190 + #ifdef mig_external 191 + mig_external 192 + #else 193 + extern 194 + #endif /* mig_external */ 195 + kern_return_t thread_get_special_port 196 + ( 197 + thread_act_t thr_act, 198 + int which_port, 199 + mach_port_t *special_port 200 + ); 201 + 202 + /* Routine thread_set_special_port */ 203 + #ifdef mig_external 204 + mig_external 205 + #else 206 + extern 207 + #endif /* mig_external */ 208 + kern_return_t thread_set_special_port 209 + ( 210 + thread_act_t thr_act, 211 + int which_port, 212 + mach_port_t special_port 213 + ); 214 + 215 + /* Routine thread_info */ 216 + #ifdef mig_external 217 + mig_external 218 + #else 219 + extern 220 + #endif /* mig_external */ 221 + kern_return_t thread_info 222 + ( 223 + thread_act_t target_act, 224 + thread_flavor_t flavor, 225 + thread_info_t thread_info_out, 226 + mach_msg_type_number_t *thread_info_outCnt 227 + ); 228 + 229 + /* Routine thread_set_exception_ports */ 230 + #ifdef mig_external 231 + mig_external 232 + #else 233 + extern 234 + #endif /* mig_external */ 235 + kern_return_t thread_set_exception_ports 236 + ( 237 + thread_act_t thread, 238 + exception_mask_t exception_mask, 239 + mach_port_t new_port, 240 + exception_behavior_t behavior, 241 + thread_state_flavor_t new_flavor 242 + ); 243 + 244 + /* Routine thread_get_exception_ports */ 245 + #ifdef mig_external 246 + mig_external 247 + #else 248 + extern 249 + #endif /* mig_external */ 250 + kern_return_t thread_get_exception_ports 251 + ( 252 + thread_act_t thread, 253 + exception_mask_t exception_mask, 254 + exception_mask_array_t masks, 255 + mach_msg_type_number_t *masksCnt, 256 + exception_handler_array_t old_handlers, 257 + exception_behavior_array_t old_behaviors, 258 + exception_flavor_array_t old_flavors 259 + ); 260 + 261 + /* Routine thread_swap_exception_ports */ 262 + #ifdef mig_external 263 + mig_external 264 + #else 265 + extern 266 + #endif /* mig_external */ 267 + kern_return_t thread_swap_exception_ports 268 + ( 269 + thread_act_t thread, 270 + exception_mask_t exception_mask, 271 + mach_port_t new_port, 272 + exception_behavior_t behavior, 273 + thread_state_flavor_t new_flavor, 274 + exception_mask_array_t masks, 275 + mach_msg_type_number_t *masksCnt, 276 + exception_handler_array_t old_handlers, 277 + exception_behavior_array_t old_behaviors, 278 + exception_flavor_array_t old_flavors 279 + ); 280 + 281 + /* Routine _kernelrpc_thread_policy */ 282 + #ifdef mig_external 283 + mig_external 284 + #else 285 + extern 286 + #endif /* mig_external */ 287 + kern_return_t _kernelrpc_thread_policy 288 + ( 289 + thread_act_t thr_act, 290 + policy_t policy, 291 + policy_base_t base, 292 + mach_msg_type_number_t baseCnt, 293 + boolean_t set_limit 294 + ); 295 + 296 + /* Routine _kernelrpc_thread_policy_set */ 297 + #ifdef mig_external 298 + mig_external 299 + #else 300 + extern 301 + #endif /* mig_external */ 302 + kern_return_t _kernelrpc_thread_policy_set 303 + ( 304 + thread_act_t thread, 305 + thread_policy_flavor_t flavor, 306 + thread_policy_t policy_info, 307 + mach_msg_type_number_t policy_infoCnt 308 + ); 309 + 310 + /* Routine thread_policy_get */ 311 + #ifdef mig_external 312 + mig_external 313 + #else 314 + extern 315 + #endif /* mig_external */ 316 + kern_return_t thread_policy_get 317 + ( 318 + thread_act_t thread, 319 + thread_policy_flavor_t flavor, 320 + thread_policy_t policy_info, 321 + mach_msg_type_number_t *policy_infoCnt, 322 + boolean_t *get_default 323 + ); 324 + 325 + /* Routine thread_sample */ 326 + #ifdef mig_external 327 + mig_external 328 + #else 329 + extern 330 + #endif /* mig_external */ 331 + kern_return_t thread_sample 332 + ( 333 + thread_act_t thread, 334 + mach_port_t reply 335 + ); 336 + 337 + /* Routine etap_trace_thread */ 338 + #ifdef mig_external 339 + mig_external 340 + #else 341 + extern 342 + #endif /* mig_external */ 343 + kern_return_t etap_trace_thread 344 + ( 345 + thread_act_t target_act, 346 + boolean_t trace_status 347 + ); 348 + 349 + /* Routine thread_assign */ 350 + #ifdef mig_external 351 + mig_external 352 + #else 353 + extern 354 + #endif /* mig_external */ 355 + kern_return_t thread_assign 356 + ( 357 + thread_act_t thread, 358 + processor_set_t new_set 359 + ); 360 + 361 + /* Routine thread_assign_default */ 362 + #ifdef mig_external 363 + mig_external 364 + #else 365 + extern 366 + #endif /* mig_external */ 367 + kern_return_t thread_assign_default 368 + ( 369 + thread_act_t thread 370 + ); 371 + 372 + /* Routine thread_get_assignment */ 373 + #ifdef mig_external 374 + mig_external 375 + #else 376 + extern 377 + #endif /* mig_external */ 378 + kern_return_t thread_get_assignment 379 + ( 380 + thread_act_t thread, 381 + processor_set_name_t *assigned_set 382 + ); 383 + 384 + /* Routine _kernelrpc_thread_set_policy */ 385 + #ifdef mig_external 386 + mig_external 387 + #else 388 + extern 389 + #endif /* mig_external */ 390 + kern_return_t _kernelrpc_thread_set_policy 391 + ( 392 + thread_act_t thr_act, 393 + processor_set_t pset, 394 + policy_t policy, 395 + policy_base_t base, 396 + mach_msg_type_number_t baseCnt, 397 + policy_limit_t limit, 398 + mach_msg_type_number_t limitCnt 399 + ); 400 + 401 + /* Routine thread_get_mach_voucher */ 402 + #ifdef mig_external 403 + mig_external 404 + #else 405 + extern 406 + #endif /* mig_external */ 407 + kern_return_t thread_get_mach_voucher 408 + ( 409 + thread_act_t thr_act, 410 + mach_voucher_selector_t which, 411 + ipc_voucher_t *voucher 412 + ); 413 + 414 + /* Routine thread_set_mach_voucher */ 415 + #ifdef mig_external 416 + mig_external 417 + #else 418 + extern 419 + #endif /* mig_external */ 420 + kern_return_t thread_set_mach_voucher 421 + ( 422 + thread_act_t thr_act, 423 + ipc_voucher_t voucher 424 + ); 425 + 426 + /* Routine thread_swap_mach_voucher */ 427 + #ifdef mig_external 428 + mig_external 429 + #else 430 + extern 431 + #endif /* mig_external */ 432 + kern_return_t thread_swap_mach_voucher 433 + ( 434 + thread_act_t thr_act, 435 + ipc_voucher_t new_voucher, 436 + ipc_voucher_t *old_voucher 437 + ); 438 + 439 + #ifdef mig_external 440 + mig_external 441 + #else 442 + extern 443 + #endif /* mig_external */ 444 + boolean_t thread_act_server( 445 + mach_msg_header_t *InHeadP, 446 + mach_msg_header_t *OutHeadP); 447 + 448 + #ifdef mig_external 449 + mig_external 450 + #else 451 + extern 452 + #endif /* mig_external */ 453 + mig_routine_t thread_act_server_routine( 454 + mach_msg_header_t *InHeadP); 455 + 456 + 457 + /* Description of this subsystem, for use in direct RPC */ 458 + extern const struct thread_act_subsystem { 459 + mig_server_routine_t server; /* Server routine */ 460 + mach_msg_id_t start; /* Min routine number */ 461 + mach_msg_id_t end; /* Max routine number + 1 */ 462 + unsigned int maxsize; /* Max msg size */ 463 + vm_address_t reserved; /* Reserved */ 464 + struct routine_descriptor /*Array of routine descriptors */ 465 + routine[28]; 466 + } thread_act_subsystem; 467 + 468 + /* typedefs for all requests */ 469 + 470 + #ifndef __Request__thread_act_subsystem__defined 471 + #define __Request__thread_act_subsystem__defined 472 + 473 + #ifdef __MigPackStructs 474 + #pragma pack(8) 475 + #endif 476 + typedef struct { 477 + mach_msg_header_t Head; 478 + } __Request__thread_terminate_t; 479 + #ifdef __MigPackStructs 480 + #pragma pack() 481 + #endif 482 + 483 + #ifdef __MigPackStructs 484 + #pragma pack(8) 485 + #endif 486 + typedef struct { 487 + mach_msg_header_t Head; 488 + NDR_record_t NDR; 489 + int flavor; 490 + mach_msg_type_number_t old_stateCnt; 491 + } __Request__act_get_state_t; 492 + #ifdef __MigPackStructs 493 + #pragma pack() 494 + #endif 495 + 496 + #ifdef __MigPackStructs 497 + #pragma pack(8) 498 + #endif 499 + typedef struct { 500 + mach_msg_header_t Head; 501 + NDR_record_t NDR; 502 + int flavor; 503 + mach_msg_type_number_t new_stateCnt; 504 + natural_t new_state[224]; 505 + } __Request__act_set_state_t; 506 + #ifdef __MigPackStructs 507 + #pragma pack() 508 + #endif 509 + 510 + #ifdef __MigPackStructs 511 + #pragma pack(8) 512 + #endif 513 + typedef struct { 514 + mach_msg_header_t Head; 515 + NDR_record_t NDR; 516 + thread_state_flavor_t flavor; 517 + mach_msg_type_number_t old_stateCnt; 518 + } __Request__thread_get_state_t; 519 + #ifdef __MigPackStructs 520 + #pragma pack() 521 + #endif 522 + 523 + #ifdef __MigPackStructs 524 + #pragma pack(8) 525 + #endif 526 + typedef struct { 527 + mach_msg_header_t Head; 528 + NDR_record_t NDR; 529 + thread_state_flavor_t flavor; 530 + mach_msg_type_number_t new_stateCnt; 531 + natural_t new_state[224]; 532 + } __Request__thread_set_state_t; 533 + #ifdef __MigPackStructs 534 + #pragma pack() 535 + #endif 536 + 537 + #ifdef __MigPackStructs 538 + #pragma pack(8) 539 + #endif 540 + typedef struct { 541 + mach_msg_header_t Head; 542 + } __Request__thread_suspend_t; 543 + #ifdef __MigPackStructs 544 + #pragma pack() 545 + #endif 546 + 547 + #ifdef __MigPackStructs 548 + #pragma pack(8) 549 + #endif 550 + typedef struct { 551 + mach_msg_header_t Head; 552 + } __Request__thread_resume_t; 553 + #ifdef __MigPackStructs 554 + #pragma pack() 555 + #endif 556 + 557 + #ifdef __MigPackStructs 558 + #pragma pack(8) 559 + #endif 560 + typedef struct { 561 + mach_msg_header_t Head; 562 + } __Request__thread_abort_t; 563 + #ifdef __MigPackStructs 564 + #pragma pack() 565 + #endif 566 + 567 + #ifdef __MigPackStructs 568 + #pragma pack(8) 569 + #endif 570 + typedef struct { 571 + mach_msg_header_t Head; 572 + } __Request__thread_abort_safely_t; 573 + #ifdef __MigPackStructs 574 + #pragma pack() 575 + #endif 576 + 577 + #ifdef __MigPackStructs 578 + #pragma pack(8) 579 + #endif 580 + typedef struct { 581 + mach_msg_header_t Head; 582 + } __Request__thread_depress_abort_t; 583 + #ifdef __MigPackStructs 584 + #pragma pack() 585 + #endif 586 + 587 + #ifdef __MigPackStructs 588 + #pragma pack(8) 589 + #endif 590 + typedef struct { 591 + mach_msg_header_t Head; 592 + NDR_record_t NDR; 593 + int which_port; 594 + } __Request__thread_get_special_port_t; 595 + #ifdef __MigPackStructs 596 + #pragma pack() 597 + #endif 598 + 599 + #ifdef __MigPackStructs 600 + #pragma pack(8) 601 + #endif 602 + typedef struct { 603 + mach_msg_header_t Head; 604 + /* start of the kernel processed data */ 605 + mach_msg_body_t msgh_body; 606 + mach_msg_port_descriptor_t special_port; 607 + /* end of the kernel processed data */ 608 + NDR_record_t NDR; 609 + int which_port; 610 + } __Request__thread_set_special_port_t; 611 + #ifdef __MigPackStructs 612 + #pragma pack() 613 + #endif 614 + 615 + #ifdef __MigPackStructs 616 + #pragma pack(8) 617 + #endif 618 + typedef struct { 619 + mach_msg_header_t Head; 620 + NDR_record_t NDR; 621 + thread_flavor_t flavor; 622 + mach_msg_type_number_t thread_info_outCnt; 623 + } __Request__thread_info_t; 624 + #ifdef __MigPackStructs 625 + #pragma pack() 626 + #endif 627 + 628 + #ifdef __MigPackStructs 629 + #pragma pack(8) 630 + #endif 631 + typedef struct { 632 + mach_msg_header_t Head; 633 + /* start of the kernel processed data */ 634 + mach_msg_body_t msgh_body; 635 + mach_msg_port_descriptor_t new_port; 636 + /* end of the kernel processed data */ 637 + NDR_record_t NDR; 638 + exception_mask_t exception_mask; 639 + exception_behavior_t behavior; 640 + thread_state_flavor_t new_flavor; 641 + } __Request__thread_set_exception_ports_t; 642 + #ifdef __MigPackStructs 643 + #pragma pack() 644 + #endif 645 + 646 + #ifdef __MigPackStructs 647 + #pragma pack(8) 648 + #endif 649 + typedef struct { 650 + mach_msg_header_t Head; 651 + NDR_record_t NDR; 652 + exception_mask_t exception_mask; 653 + } __Request__thread_get_exception_ports_t; 654 + #ifdef __MigPackStructs 655 + #pragma pack() 656 + #endif 657 + 658 + #ifdef __MigPackStructs 659 + #pragma pack(8) 660 + #endif 661 + typedef struct { 662 + mach_msg_header_t Head; 663 + /* start of the kernel processed data */ 664 + mach_msg_body_t msgh_body; 665 + mach_msg_port_descriptor_t new_port; 666 + /* end of the kernel processed data */ 667 + NDR_record_t NDR; 668 + exception_mask_t exception_mask; 669 + exception_behavior_t behavior; 670 + thread_state_flavor_t new_flavor; 671 + } __Request__thread_swap_exception_ports_t; 672 + #ifdef __MigPackStructs 673 + #pragma pack() 674 + #endif 675 + 676 + #ifdef __MigPackStructs 677 + #pragma pack(8) 678 + #endif 679 + typedef struct { 680 + mach_msg_header_t Head; 681 + NDR_record_t NDR; 682 + policy_t policy; 683 + mach_msg_type_number_t baseCnt; 684 + integer_t base[5]; 685 + boolean_t set_limit; 686 + } __Request___kernelrpc_thread_policy_t; 687 + #ifdef __MigPackStructs 688 + #pragma pack() 689 + #endif 690 + 691 + #ifdef __MigPackStructs 692 + #pragma pack(8) 693 + #endif 694 + typedef struct { 695 + mach_msg_header_t Head; 696 + NDR_record_t NDR; 697 + thread_policy_flavor_t flavor; 698 + mach_msg_type_number_t policy_infoCnt; 699 + integer_t policy_info[16]; 700 + } __Request___kernelrpc_thread_policy_set_t; 701 + #ifdef __MigPackStructs 702 + #pragma pack() 703 + #endif 704 + 705 + #ifdef __MigPackStructs 706 + #pragma pack(8) 707 + #endif 708 + typedef struct { 709 + mach_msg_header_t Head; 710 + NDR_record_t NDR; 711 + thread_policy_flavor_t flavor; 712 + mach_msg_type_number_t policy_infoCnt; 713 + boolean_t get_default; 714 + } __Request__thread_policy_get_t; 715 + #ifdef __MigPackStructs 716 + #pragma pack() 717 + #endif 718 + 719 + #ifdef __MigPackStructs 720 + #pragma pack(8) 721 + #endif 722 + typedef struct { 723 + mach_msg_header_t Head; 724 + /* start of the kernel processed data */ 725 + mach_msg_body_t msgh_body; 726 + mach_msg_port_descriptor_t reply; 727 + /* end of the kernel processed data */ 728 + } __Request__thread_sample_t; 729 + #ifdef __MigPackStructs 730 + #pragma pack() 731 + #endif 732 + 733 + #ifdef __MigPackStructs 734 + #pragma pack(8) 735 + #endif 736 + typedef struct { 737 + mach_msg_header_t Head; 738 + NDR_record_t NDR; 739 + boolean_t trace_status; 740 + } __Request__etap_trace_thread_t; 741 + #ifdef __MigPackStructs 742 + #pragma pack() 743 + #endif 744 + 745 + #ifdef __MigPackStructs 746 + #pragma pack(8) 747 + #endif 748 + typedef struct { 749 + mach_msg_header_t Head; 750 + /* start of the kernel processed data */ 751 + mach_msg_body_t msgh_body; 752 + mach_msg_port_descriptor_t new_set; 753 + /* end of the kernel processed data */ 754 + } __Request__thread_assign_t; 755 + #ifdef __MigPackStructs 756 + #pragma pack() 757 + #endif 758 + 759 + #ifdef __MigPackStructs 760 + #pragma pack(8) 761 + #endif 762 + typedef struct { 763 + mach_msg_header_t Head; 764 + } __Request__thread_assign_default_t; 765 + #ifdef __MigPackStructs 766 + #pragma pack() 767 + #endif 768 + 769 + #ifdef __MigPackStructs 770 + #pragma pack(8) 771 + #endif 772 + typedef struct { 773 + mach_msg_header_t Head; 774 + } __Request__thread_get_assignment_t; 775 + #ifdef __MigPackStructs 776 + #pragma pack() 777 + #endif 778 + 779 + #ifdef __MigPackStructs 780 + #pragma pack(8) 781 + #endif 782 + typedef struct { 783 + mach_msg_header_t Head; 784 + /* start of the kernel processed data */ 785 + mach_msg_body_t msgh_body; 786 + mach_msg_port_descriptor_t pset; 787 + /* end of the kernel processed data */ 788 + NDR_record_t NDR; 789 + policy_t policy; 790 + mach_msg_type_number_t baseCnt; 791 + integer_t base[5]; 792 + mach_msg_type_number_t limitCnt; 793 + integer_t limit[1]; 794 + } __Request___kernelrpc_thread_set_policy_t; 795 + #ifdef __MigPackStructs 796 + #pragma pack() 797 + #endif 798 + 799 + #ifdef __MigPackStructs 800 + #pragma pack(8) 801 + #endif 802 + typedef struct { 803 + mach_msg_header_t Head; 804 + NDR_record_t NDR; 805 + mach_voucher_selector_t which; 806 + } __Request__thread_get_mach_voucher_t; 807 + #ifdef __MigPackStructs 808 + #pragma pack() 809 + #endif 810 + 811 + #ifdef __MigPackStructs 812 + #pragma pack(8) 813 + #endif 814 + typedef struct { 815 + mach_msg_header_t Head; 816 + /* start of the kernel processed data */ 817 + mach_msg_body_t msgh_body; 818 + mach_msg_port_descriptor_t voucher; 819 + /* end of the kernel processed data */ 820 + } __Request__thread_set_mach_voucher_t; 821 + #ifdef __MigPackStructs 822 + #pragma pack() 823 + #endif 824 + 825 + #ifdef __MigPackStructs 826 + #pragma pack(8) 827 + #endif 828 + typedef struct { 829 + mach_msg_header_t Head; 830 + /* start of the kernel processed data */ 831 + mach_msg_body_t msgh_body; 832 + mach_msg_port_descriptor_t new_voucher; 833 + mach_msg_port_descriptor_t old_voucher; 834 + /* end of the kernel processed data */ 835 + } __Request__thread_swap_mach_voucher_t; 836 + #ifdef __MigPackStructs 837 + #pragma pack() 838 + #endif 839 + #endif /* !__Request__thread_act_subsystem__defined */ 840 + 841 + 842 + /* union of all requests */ 843 + 844 + #ifndef __RequestUnion__thread_act_subsystem__defined 845 + #define __RequestUnion__thread_act_subsystem__defined 846 + union __RequestUnion__thread_act_subsystem { 847 + __Request__thread_terminate_t Request_thread_terminate; 848 + __Request__act_get_state_t Request_act_get_state; 849 + __Request__act_set_state_t Request_act_set_state; 850 + __Request__thread_get_state_t Request_thread_get_state; 851 + __Request__thread_set_state_t Request_thread_set_state; 852 + __Request__thread_suspend_t Request_thread_suspend; 853 + __Request__thread_resume_t Request_thread_resume; 854 + __Request__thread_abort_t Request_thread_abort; 855 + __Request__thread_abort_safely_t Request_thread_abort_safely; 856 + __Request__thread_depress_abort_t Request_thread_depress_abort; 857 + __Request__thread_get_special_port_t Request_thread_get_special_port; 858 + __Request__thread_set_special_port_t Request_thread_set_special_port; 859 + __Request__thread_info_t Request_thread_info; 860 + __Request__thread_set_exception_ports_t Request_thread_set_exception_ports; 861 + __Request__thread_get_exception_ports_t Request_thread_get_exception_ports; 862 + __Request__thread_swap_exception_ports_t Request_thread_swap_exception_ports; 863 + __Request___kernelrpc_thread_policy_t Request__kernelrpc_thread_policy; 864 + __Request___kernelrpc_thread_policy_set_t Request__kernelrpc_thread_policy_set; 865 + __Request__thread_policy_get_t Request_thread_policy_get; 866 + __Request__thread_sample_t Request_thread_sample; 867 + __Request__etap_trace_thread_t Request_etap_trace_thread; 868 + __Request__thread_assign_t Request_thread_assign; 869 + __Request__thread_assign_default_t Request_thread_assign_default; 870 + __Request__thread_get_assignment_t Request_thread_get_assignment; 871 + __Request___kernelrpc_thread_set_policy_t Request__kernelrpc_thread_set_policy; 872 + __Request__thread_get_mach_voucher_t Request_thread_get_mach_voucher; 873 + __Request__thread_set_mach_voucher_t Request_thread_set_mach_voucher; 874 + __Request__thread_swap_mach_voucher_t Request_thread_swap_mach_voucher; 875 + }; 876 + #endif /* __RequestUnion__thread_act_subsystem__defined */ 877 + /* typedefs for all replies */ 878 + 879 + #ifndef __Reply__thread_act_subsystem__defined 880 + #define __Reply__thread_act_subsystem__defined 881 + 882 + #ifdef __MigPackStructs 883 + #pragma pack(8) 884 + #endif 885 + typedef struct { 886 + mach_msg_header_t Head; 887 + NDR_record_t NDR; 888 + kern_return_t RetCode; 889 + } __Reply__thread_terminate_t; 890 + #ifdef __MigPackStructs 891 + #pragma pack() 892 + #endif 893 + 894 + #ifdef __MigPackStructs 895 + #pragma pack(8) 896 + #endif 897 + typedef struct { 898 + mach_msg_header_t Head; 899 + NDR_record_t NDR; 900 + kern_return_t RetCode; 901 + mach_msg_type_number_t old_stateCnt; 902 + natural_t old_state[224]; 903 + } __Reply__act_get_state_t; 904 + #ifdef __MigPackStructs 905 + #pragma pack() 906 + #endif 907 + 908 + #ifdef __MigPackStructs 909 + #pragma pack(8) 910 + #endif 911 + typedef struct { 912 + mach_msg_header_t Head; 913 + NDR_record_t NDR; 914 + kern_return_t RetCode; 915 + } __Reply__act_set_state_t; 916 + #ifdef __MigPackStructs 917 + #pragma pack() 918 + #endif 919 + 920 + #ifdef __MigPackStructs 921 + #pragma pack(8) 922 + #endif 923 + typedef struct { 924 + mach_msg_header_t Head; 925 + NDR_record_t NDR; 926 + kern_return_t RetCode; 927 + mach_msg_type_number_t old_stateCnt; 928 + natural_t old_state[224]; 929 + } __Reply__thread_get_state_t; 930 + #ifdef __MigPackStructs 931 + #pragma pack() 932 + #endif 933 + 934 + #ifdef __MigPackStructs 935 + #pragma pack(8) 936 + #endif 937 + typedef struct { 938 + mach_msg_header_t Head; 939 + NDR_record_t NDR; 940 + kern_return_t RetCode; 941 + } __Reply__thread_set_state_t; 942 + #ifdef __MigPackStructs 943 + #pragma pack() 944 + #endif 945 + 946 + #ifdef __MigPackStructs 947 + #pragma pack(8) 948 + #endif 949 + typedef struct { 950 + mach_msg_header_t Head; 951 + NDR_record_t NDR; 952 + kern_return_t RetCode; 953 + } __Reply__thread_suspend_t; 954 + #ifdef __MigPackStructs 955 + #pragma pack() 956 + #endif 957 + 958 + #ifdef __MigPackStructs 959 + #pragma pack(8) 960 + #endif 961 + typedef struct { 962 + mach_msg_header_t Head; 963 + NDR_record_t NDR; 964 + kern_return_t RetCode; 965 + } __Reply__thread_resume_t; 966 + #ifdef __MigPackStructs 967 + #pragma pack() 968 + #endif 969 + 970 + #ifdef __MigPackStructs 971 + #pragma pack(8) 972 + #endif 973 + typedef struct { 974 + mach_msg_header_t Head; 975 + NDR_record_t NDR; 976 + kern_return_t RetCode; 977 + } __Reply__thread_abort_t; 978 + #ifdef __MigPackStructs 979 + #pragma pack() 980 + #endif 981 + 982 + #ifdef __MigPackStructs 983 + #pragma pack(8) 984 + #endif 985 + typedef struct { 986 + mach_msg_header_t Head; 987 + NDR_record_t NDR; 988 + kern_return_t RetCode; 989 + } __Reply__thread_abort_safely_t; 990 + #ifdef __MigPackStructs 991 + #pragma pack() 992 + #endif 993 + 994 + #ifdef __MigPackStructs 995 + #pragma pack(8) 996 + #endif 997 + typedef struct { 998 + mach_msg_header_t Head; 999 + NDR_record_t NDR; 1000 + kern_return_t RetCode; 1001 + } __Reply__thread_depress_abort_t; 1002 + #ifdef __MigPackStructs 1003 + #pragma pack() 1004 + #endif 1005 + 1006 + #ifdef __MigPackStructs 1007 + #pragma pack(8) 1008 + #endif 1009 + typedef struct { 1010 + mach_msg_header_t Head; 1011 + /* start of the kernel processed data */ 1012 + mach_msg_body_t msgh_body; 1013 + mach_msg_port_descriptor_t special_port; 1014 + /* end of the kernel processed data */ 1015 + } __Reply__thread_get_special_port_t; 1016 + #ifdef __MigPackStructs 1017 + #pragma pack() 1018 + #endif 1019 + 1020 + #ifdef __MigPackStructs 1021 + #pragma pack(8) 1022 + #endif 1023 + typedef struct { 1024 + mach_msg_header_t Head; 1025 + NDR_record_t NDR; 1026 + kern_return_t RetCode; 1027 + } __Reply__thread_set_special_port_t; 1028 + #ifdef __MigPackStructs 1029 + #pragma pack() 1030 + #endif 1031 + 1032 + #ifdef __MigPackStructs 1033 + #pragma pack(8) 1034 + #endif 1035 + typedef struct { 1036 + mach_msg_header_t Head; 1037 + NDR_record_t NDR; 1038 + kern_return_t RetCode; 1039 + mach_msg_type_number_t thread_info_outCnt; 1040 + integer_t thread_info_out[12]; 1041 + } __Reply__thread_info_t; 1042 + #ifdef __MigPackStructs 1043 + #pragma pack() 1044 + #endif 1045 + 1046 + #ifdef __MigPackStructs 1047 + #pragma pack(8) 1048 + #endif 1049 + typedef struct { 1050 + mach_msg_header_t Head; 1051 + NDR_record_t NDR; 1052 + kern_return_t RetCode; 1053 + } __Reply__thread_set_exception_ports_t; 1054 + #ifdef __MigPackStructs 1055 + #pragma pack() 1056 + #endif 1057 + 1058 + #ifdef __MigPackStructs 1059 + #pragma pack(8) 1060 + #endif 1061 + typedef struct { 1062 + mach_msg_header_t Head; 1063 + /* start of the kernel processed data */ 1064 + mach_msg_body_t msgh_body; 1065 + mach_msg_port_descriptor_t old_handlers[32]; 1066 + /* end of the kernel processed data */ 1067 + NDR_record_t NDR; 1068 + mach_msg_type_number_t masksCnt; 1069 + exception_mask_t masks[32]; 1070 + exception_behavior_t old_behaviors[32]; 1071 + thread_state_flavor_t old_flavors[32]; 1072 + } __Reply__thread_get_exception_ports_t; 1073 + #ifdef __MigPackStructs 1074 + #pragma pack() 1075 + #endif 1076 + 1077 + #ifdef __MigPackStructs 1078 + #pragma pack(8) 1079 + #endif 1080 + typedef struct { 1081 + mach_msg_header_t Head; 1082 + /* start of the kernel processed data */ 1083 + mach_msg_body_t msgh_body; 1084 + mach_msg_port_descriptor_t old_handlers[32]; 1085 + /* end of the kernel processed data */ 1086 + NDR_record_t NDR; 1087 + mach_msg_type_number_t masksCnt; 1088 + exception_mask_t masks[32]; 1089 + exception_behavior_t old_behaviors[32]; 1090 + thread_state_flavor_t old_flavors[32]; 1091 + } __Reply__thread_swap_exception_ports_t; 1092 + #ifdef __MigPackStructs 1093 + #pragma pack() 1094 + #endif 1095 + 1096 + #ifdef __MigPackStructs 1097 + #pragma pack(8) 1098 + #endif 1099 + typedef struct { 1100 + mach_msg_header_t Head; 1101 + NDR_record_t NDR; 1102 + kern_return_t RetCode; 1103 + } __Reply___kernelrpc_thread_policy_t; 1104 + #ifdef __MigPackStructs 1105 + #pragma pack() 1106 + #endif 1107 + 1108 + #ifdef __MigPackStructs 1109 + #pragma pack(8) 1110 + #endif 1111 + typedef struct { 1112 + mach_msg_header_t Head; 1113 + NDR_record_t NDR; 1114 + kern_return_t RetCode; 1115 + } __Reply___kernelrpc_thread_policy_set_t; 1116 + #ifdef __MigPackStructs 1117 + #pragma pack() 1118 + #endif 1119 + 1120 + #ifdef __MigPackStructs 1121 + #pragma pack(8) 1122 + #endif 1123 + typedef struct { 1124 + mach_msg_header_t Head; 1125 + NDR_record_t NDR; 1126 + kern_return_t RetCode; 1127 + mach_msg_type_number_t policy_infoCnt; 1128 + integer_t policy_info[16]; 1129 + boolean_t get_default; 1130 + } __Reply__thread_policy_get_t; 1131 + #ifdef __MigPackStructs 1132 + #pragma pack() 1133 + #endif 1134 + 1135 + #ifdef __MigPackStructs 1136 + #pragma pack(8) 1137 + #endif 1138 + typedef struct { 1139 + mach_msg_header_t Head; 1140 + NDR_record_t NDR; 1141 + kern_return_t RetCode; 1142 + } __Reply__thread_sample_t; 1143 + #ifdef __MigPackStructs 1144 + #pragma pack() 1145 + #endif 1146 + 1147 + #ifdef __MigPackStructs 1148 + #pragma pack(8) 1149 + #endif 1150 + typedef struct { 1151 + mach_msg_header_t Head; 1152 + NDR_record_t NDR; 1153 + kern_return_t RetCode; 1154 + } __Reply__etap_trace_thread_t; 1155 + #ifdef __MigPackStructs 1156 + #pragma pack() 1157 + #endif 1158 + 1159 + #ifdef __MigPackStructs 1160 + #pragma pack(8) 1161 + #endif 1162 + typedef struct { 1163 + mach_msg_header_t Head; 1164 + NDR_record_t NDR; 1165 + kern_return_t RetCode; 1166 + } __Reply__thread_assign_t; 1167 + #ifdef __MigPackStructs 1168 + #pragma pack() 1169 + #endif 1170 + 1171 + #ifdef __MigPackStructs 1172 + #pragma pack(8) 1173 + #endif 1174 + typedef struct { 1175 + mach_msg_header_t Head; 1176 + NDR_record_t NDR; 1177 + kern_return_t RetCode; 1178 + } __Reply__thread_assign_default_t; 1179 + #ifdef __MigPackStructs 1180 + #pragma pack() 1181 + #endif 1182 + 1183 + #ifdef __MigPackStructs 1184 + #pragma pack(8) 1185 + #endif 1186 + typedef struct { 1187 + mach_msg_header_t Head; 1188 + /* start of the kernel processed data */ 1189 + mach_msg_body_t msgh_body; 1190 + mach_msg_port_descriptor_t assigned_set; 1191 + /* end of the kernel processed data */ 1192 + } __Reply__thread_get_assignment_t; 1193 + #ifdef __MigPackStructs 1194 + #pragma pack() 1195 + #endif 1196 + 1197 + #ifdef __MigPackStructs 1198 + #pragma pack(8) 1199 + #endif 1200 + typedef struct { 1201 + mach_msg_header_t Head; 1202 + NDR_record_t NDR; 1203 + kern_return_t RetCode; 1204 + } __Reply___kernelrpc_thread_set_policy_t; 1205 + #ifdef __MigPackStructs 1206 + #pragma pack() 1207 + #endif 1208 + 1209 + #ifdef __MigPackStructs 1210 + #pragma pack(8) 1211 + #endif 1212 + typedef struct { 1213 + mach_msg_header_t Head; 1214 + /* start of the kernel processed data */ 1215 + mach_msg_body_t msgh_body; 1216 + mach_msg_port_descriptor_t voucher; 1217 + /* end of the kernel processed data */ 1218 + } __Reply__thread_get_mach_voucher_t; 1219 + #ifdef __MigPackStructs 1220 + #pragma pack() 1221 + #endif 1222 + 1223 + #ifdef __MigPackStructs 1224 + #pragma pack(8) 1225 + #endif 1226 + typedef struct { 1227 + mach_msg_header_t Head; 1228 + NDR_record_t NDR; 1229 + kern_return_t RetCode; 1230 + } __Reply__thread_set_mach_voucher_t; 1231 + #ifdef __MigPackStructs 1232 + #pragma pack() 1233 + #endif 1234 + 1235 + #ifdef __MigPackStructs 1236 + #pragma pack(8) 1237 + #endif 1238 + typedef struct { 1239 + mach_msg_header_t Head; 1240 + /* start of the kernel processed data */ 1241 + mach_msg_body_t msgh_body; 1242 + mach_msg_port_descriptor_t old_voucher; 1243 + /* end of the kernel processed data */ 1244 + } __Reply__thread_swap_mach_voucher_t; 1245 + #ifdef __MigPackStructs 1246 + #pragma pack() 1247 + #endif 1248 + #endif /* !__Reply__thread_act_subsystem__defined */ 1249 + 1250 + 1251 + /* union of all replies */ 1252 + 1253 + #ifndef __ReplyUnion__thread_act_subsystem__defined 1254 + #define __ReplyUnion__thread_act_subsystem__defined 1255 + union __ReplyUnion__thread_act_subsystem { 1256 + __Reply__thread_terminate_t Reply_thread_terminate; 1257 + __Reply__act_get_state_t Reply_act_get_state; 1258 + __Reply__act_set_state_t Reply_act_set_state; 1259 + __Reply__thread_get_state_t Reply_thread_get_state; 1260 + __Reply__thread_set_state_t Reply_thread_set_state; 1261 + __Reply__thread_suspend_t Reply_thread_suspend; 1262 + __Reply__thread_resume_t Reply_thread_resume; 1263 + __Reply__thread_abort_t Reply_thread_abort; 1264 + __Reply__thread_abort_safely_t Reply_thread_abort_safely; 1265 + __Reply__thread_depress_abort_t Reply_thread_depress_abort; 1266 + __Reply__thread_get_special_port_t Reply_thread_get_special_port; 1267 + __Reply__thread_set_special_port_t Reply_thread_set_special_port; 1268 + __Reply__thread_info_t Reply_thread_info; 1269 + __Reply__thread_set_exception_ports_t Reply_thread_set_exception_ports; 1270 + __Reply__thread_get_exception_ports_t Reply_thread_get_exception_ports; 1271 + __Reply__thread_swap_exception_ports_t Reply_thread_swap_exception_ports; 1272 + __Reply___kernelrpc_thread_policy_t Reply__kernelrpc_thread_policy; 1273 + __Reply___kernelrpc_thread_policy_set_t Reply__kernelrpc_thread_policy_set; 1274 + __Reply__thread_policy_get_t Reply_thread_policy_get; 1275 + __Reply__thread_sample_t Reply_thread_sample; 1276 + __Reply__etap_trace_thread_t Reply_etap_trace_thread; 1277 + __Reply__thread_assign_t Reply_thread_assign; 1278 + __Reply__thread_assign_default_t Reply_thread_assign_default; 1279 + __Reply__thread_get_assignment_t Reply_thread_get_assignment; 1280 + __Reply___kernelrpc_thread_set_policy_t Reply__kernelrpc_thread_set_policy; 1281 + __Reply__thread_get_mach_voucher_t Reply_thread_get_mach_voucher; 1282 + __Reply__thread_set_mach_voucher_t Reply_thread_set_mach_voucher; 1283 + __Reply__thread_swap_mach_voucher_t Reply_thread_swap_mach_voucher; 1284 + }; 1285 + #endif /* __RequestUnion__thread_act_subsystem__defined */ 1286 + 1287 + #ifndef subsystem_to_name_map_thread_act 1288 + #define subsystem_to_name_map_thread_act \ 1289 + { "thread_terminate", 3600 },\ 1290 + { "act_get_state", 3601 },\ 1291 + { "act_set_state", 3602 },\ 1292 + { "thread_get_state", 3603 },\ 1293 + { "thread_set_state", 3604 },\ 1294 + { "thread_suspend", 3605 },\ 1295 + { "thread_resume", 3606 },\ 1296 + { "thread_abort", 3607 },\ 1297 + { "thread_abort_safely", 3608 },\ 1298 + { "thread_depress_abort", 3609 },\ 1299 + { "thread_get_special_port", 3610 },\ 1300 + { "thread_set_special_port", 3611 },\ 1301 + { "thread_info", 3612 },\ 1302 + { "thread_set_exception_ports", 3613 },\ 1303 + { "thread_get_exception_ports", 3614 },\ 1304 + { "thread_swap_exception_ports", 3615 },\ 1305 + { "_kernelrpc_thread_policy", 3616 },\ 1306 + { "_kernelrpc_thread_policy_set", 3617 },\ 1307 + { "thread_policy_get", 3618 },\ 1308 + { "thread_sample", 3619 },\ 1309 + { "etap_trace_thread", 3620 },\ 1310 + { "thread_assign", 3621 },\ 1311 + { "thread_assign_default", 3622 },\ 1312 + { "thread_get_assignment", 3623 },\ 1313 + { "_kernelrpc_thread_set_policy", 3624 },\ 1314 + { "thread_get_mach_voucher", 3625 },\ 1315 + { "thread_set_mach_voucher", 3626 },\ 1316 + { "thread_swap_mach_voucher", 3627 } 1317 + #endif 1318 + 1319 + #ifdef __AfterMigServerHeader 1320 + __AfterMigServerHeader 1321 + #endif /* __AfterMigServerHeader */ 1322 + 1323 + #endif /* _thread_act_server_ */
+1308
lkm/mig/thread_act_internal.h
··· 1 + #ifndef _thread_act_user_ 2 + #define _thread_act_user_ 3 + 4 + /* Module thread_act */ 5 + 6 + #include <string.h> 7 + #include <mach/ndr.h> 8 + #include <mach/boolean.h> 9 + #include <mach/kern_return.h> 10 + #include <mach/notify.h> 11 + #include <mach/mach_types.h> 12 + #include <mach/message.h> 13 + #include <mach/mig_errors.h> 14 + #include <mach/port.h> 15 + 16 + /* BEGIN VOUCHER CODE */ 17 + 18 + #ifndef KERNEL 19 + #if defined(__has_include) 20 + #if __has_include(<mach/mig_voucher_support.h>) 21 + #ifndef USING_VOUCHERS 22 + #define USING_VOUCHERS 23 + #endif 24 + #ifndef __VOUCHER_FORWARD_TYPE_DECLS__ 25 + #define __VOUCHER_FORWARD_TYPE_DECLS__ 26 + #ifdef __cplusplus 27 + extern "C" { 28 + #endif 29 + extern boolean_t voucher_mach_msg_set(mach_msg_header_t *msg) __attribute__((weak_import)); 30 + #ifdef __cplusplus 31 + } 32 + #endif 33 + #endif // __VOUCHER_FORWARD_TYPE_DECLS__ 34 + #endif // __has_include(<mach/mach_voucher_types.h>) 35 + #endif // __has_include 36 + #endif // !KERNEL 37 + 38 + /* END VOUCHER CODE */ 39 + 40 + 41 + #ifdef AUTOTEST 42 + #ifndef FUNCTION_PTR_T 43 + #define FUNCTION_PTR_T 44 + typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); 45 + typedef struct { 46 + char *name; 47 + function_ptr_t function; 48 + } function_table_entry; 49 + typedef function_table_entry *function_table_t; 50 + #endif /* FUNCTION_PTR_T */ 51 + #endif /* AUTOTEST */ 52 + 53 + #ifndef thread_act_MSG_COUNT 54 + #define thread_act_MSG_COUNT 28 55 + #endif /* thread_act_MSG_COUNT */ 56 + 57 + #include <mach/std_types.h> 58 + #include <mach/mig.h> 59 + #include <mach/mig.h> 60 + #include <mach/mach_types.h> 61 + 62 + #ifdef __BeforeMigUserHeader 63 + __BeforeMigUserHeader 64 + #endif /* __BeforeMigUserHeader */ 65 + 66 + #include <sys/cdefs.h> 67 + __BEGIN_DECLS 68 + 69 + 70 + /* Routine thread_terminate */ 71 + #ifdef mig_external 72 + mig_external 73 + #else 74 + extern 75 + #endif /* mig_external */ 76 + kern_return_t thread_terminate 77 + ( 78 + thread_act_t target_act 79 + ); 80 + 81 + /* Routine act_get_state */ 82 + #ifdef mig_external 83 + mig_external 84 + #else 85 + extern 86 + #endif /* mig_external */ 87 + kern_return_t act_get_state 88 + ( 89 + thread_act_t target_act, 90 + int flavor, 91 + thread_state_t old_state, 92 + mach_msg_type_number_t *old_stateCnt 93 + ); 94 + 95 + /* Routine act_set_state */ 96 + #ifdef mig_external 97 + mig_external 98 + #else 99 + extern 100 + #endif /* mig_external */ 101 + kern_return_t act_set_state 102 + ( 103 + thread_act_t target_act, 104 + int flavor, 105 + thread_state_t new_state, 106 + mach_msg_type_number_t new_stateCnt 107 + ); 108 + 109 + /* Routine thread_get_state */ 110 + #ifdef mig_external 111 + mig_external 112 + #else 113 + extern 114 + #endif /* mig_external */ 115 + kern_return_t thread_get_state 116 + ( 117 + thread_act_t target_act, 118 + thread_state_flavor_t flavor, 119 + thread_state_t old_state, 120 + mach_msg_type_number_t *old_stateCnt 121 + ); 122 + 123 + /* Routine thread_set_state */ 124 + #ifdef mig_external 125 + mig_external 126 + #else 127 + extern 128 + #endif /* mig_external */ 129 + kern_return_t thread_set_state 130 + ( 131 + thread_act_t target_act, 132 + thread_state_flavor_t flavor, 133 + thread_state_t new_state, 134 + mach_msg_type_number_t new_stateCnt 135 + ); 136 + 137 + /* Routine thread_suspend */ 138 + #ifdef mig_external 139 + mig_external 140 + #else 141 + extern 142 + #endif /* mig_external */ 143 + kern_return_t thread_suspend 144 + ( 145 + thread_act_t target_act 146 + ); 147 + 148 + /* Routine thread_resume */ 149 + #ifdef mig_external 150 + mig_external 151 + #else 152 + extern 153 + #endif /* mig_external */ 154 + kern_return_t thread_resume 155 + ( 156 + thread_act_t target_act 157 + ); 158 + 159 + /* Routine thread_abort */ 160 + #ifdef mig_external 161 + mig_external 162 + #else 163 + extern 164 + #endif /* mig_external */ 165 + kern_return_t thread_abort 166 + ( 167 + thread_act_t target_act 168 + ); 169 + 170 + /* Routine thread_abort_safely */ 171 + #ifdef mig_external 172 + mig_external 173 + #else 174 + extern 175 + #endif /* mig_external */ 176 + kern_return_t thread_abort_safely 177 + ( 178 + thread_act_t target_act 179 + ); 180 + 181 + /* Routine thread_depress_abort */ 182 + #ifdef mig_external 183 + mig_external 184 + #else 185 + extern 186 + #endif /* mig_external */ 187 + kern_return_t thread_depress_abort 188 + ( 189 + thread_act_t thread 190 + ); 191 + 192 + /* Routine thread_get_special_port */ 193 + #ifdef mig_external 194 + mig_external 195 + #else 196 + extern 197 + #endif /* mig_external */ 198 + kern_return_t thread_get_special_port 199 + ( 200 + thread_act_t thr_act, 201 + int which_port, 202 + mach_port_t *special_port 203 + ); 204 + 205 + /* Routine thread_set_special_port */ 206 + #ifdef mig_external 207 + mig_external 208 + #else 209 + extern 210 + #endif /* mig_external */ 211 + kern_return_t thread_set_special_port 212 + ( 213 + thread_act_t thr_act, 214 + int which_port, 215 + mach_port_t special_port 216 + ); 217 + 218 + /* Routine thread_info */ 219 + #ifdef mig_external 220 + mig_external 221 + #else 222 + extern 223 + #endif /* mig_external */ 224 + kern_return_t thread_info 225 + ( 226 + thread_act_t target_act, 227 + thread_flavor_t flavor, 228 + thread_info_t thread_info_out, 229 + mach_msg_type_number_t *thread_info_outCnt 230 + ); 231 + 232 + /* Routine thread_set_exception_ports */ 233 + #ifdef mig_external 234 + mig_external 235 + #else 236 + extern 237 + #endif /* mig_external */ 238 + kern_return_t thread_set_exception_ports 239 + ( 240 + thread_act_t thread, 241 + exception_mask_t exception_mask, 242 + mach_port_t new_port, 243 + exception_behavior_t behavior, 244 + thread_state_flavor_t new_flavor 245 + ); 246 + 247 + /* Routine thread_get_exception_ports */ 248 + #ifdef mig_external 249 + mig_external 250 + #else 251 + extern 252 + #endif /* mig_external */ 253 + kern_return_t thread_get_exception_ports 254 + ( 255 + thread_act_t thread, 256 + exception_mask_t exception_mask, 257 + exception_mask_array_t masks, 258 + mach_msg_type_number_t *masksCnt, 259 + exception_handler_array_t old_handlers, 260 + exception_behavior_array_t old_behaviors, 261 + exception_flavor_array_t old_flavors 262 + ); 263 + 264 + /* Routine thread_swap_exception_ports */ 265 + #ifdef mig_external 266 + mig_external 267 + #else 268 + extern 269 + #endif /* mig_external */ 270 + kern_return_t thread_swap_exception_ports 271 + ( 272 + thread_act_t thread, 273 + exception_mask_t exception_mask, 274 + mach_port_t new_port, 275 + exception_behavior_t behavior, 276 + thread_state_flavor_t new_flavor, 277 + exception_mask_array_t masks, 278 + mach_msg_type_number_t *masksCnt, 279 + exception_handler_array_t old_handlers, 280 + exception_behavior_array_t old_behaviors, 281 + exception_flavor_array_t old_flavors 282 + ); 283 + 284 + /* Routine _kernelrpc_thread_policy */ 285 + #ifdef mig_external 286 + mig_external 287 + #else 288 + extern 289 + #endif /* mig_external */ 290 + kern_return_t _kernelrpc_thread_policy 291 + ( 292 + thread_act_t thr_act, 293 + policy_t policy, 294 + policy_base_t base, 295 + mach_msg_type_number_t baseCnt, 296 + boolean_t set_limit 297 + ); 298 + 299 + /* Routine _kernelrpc_thread_policy_set */ 300 + #ifdef mig_external 301 + mig_external 302 + #else 303 + extern 304 + #endif /* mig_external */ 305 + kern_return_t _kernelrpc_thread_policy_set 306 + ( 307 + thread_act_t thread, 308 + thread_policy_flavor_t flavor, 309 + thread_policy_t policy_info, 310 + mach_msg_type_number_t policy_infoCnt 311 + ); 312 + 313 + /* Routine thread_policy_get */ 314 + #ifdef mig_external 315 + mig_external 316 + #else 317 + extern 318 + #endif /* mig_external */ 319 + kern_return_t thread_policy_get 320 + ( 321 + thread_act_t thread, 322 + thread_policy_flavor_t flavor, 323 + thread_policy_t policy_info, 324 + mach_msg_type_number_t *policy_infoCnt, 325 + boolean_t *get_default 326 + ); 327 + 328 + /* Routine thread_sample */ 329 + #ifdef mig_external 330 + mig_external 331 + #else 332 + extern 333 + #endif /* mig_external */ 334 + kern_return_t thread_sample 335 + ( 336 + thread_act_t thread, 337 + mach_port_t reply 338 + ); 339 + 340 + /* Routine etap_trace_thread */ 341 + #ifdef mig_external 342 + mig_external 343 + #else 344 + extern 345 + #endif /* mig_external */ 346 + kern_return_t etap_trace_thread 347 + ( 348 + thread_act_t target_act, 349 + boolean_t trace_status 350 + ); 351 + 352 + /* Routine thread_assign */ 353 + #ifdef mig_external 354 + mig_external 355 + #else 356 + extern 357 + #endif /* mig_external */ 358 + kern_return_t thread_assign 359 + ( 360 + thread_act_t thread, 361 + processor_set_t new_set 362 + ); 363 + 364 + /* Routine thread_assign_default */ 365 + #ifdef mig_external 366 + mig_external 367 + #else 368 + extern 369 + #endif /* mig_external */ 370 + kern_return_t thread_assign_default 371 + ( 372 + thread_act_t thread 373 + ); 374 + 375 + /* Routine thread_get_assignment */ 376 + #ifdef mig_external 377 + mig_external 378 + #else 379 + extern 380 + #endif /* mig_external */ 381 + kern_return_t thread_get_assignment 382 + ( 383 + thread_act_t thread, 384 + processor_set_name_t *assigned_set 385 + ); 386 + 387 + /* Routine _kernelrpc_thread_set_policy */ 388 + #ifdef mig_external 389 + mig_external 390 + #else 391 + extern 392 + #endif /* mig_external */ 393 + kern_return_t _kernelrpc_thread_set_policy 394 + ( 395 + thread_act_t thr_act, 396 + processor_set_t pset, 397 + policy_t policy, 398 + policy_base_t base, 399 + mach_msg_type_number_t baseCnt, 400 + policy_limit_t limit, 401 + mach_msg_type_number_t limitCnt 402 + ); 403 + 404 + /* Routine thread_get_mach_voucher */ 405 + #ifdef mig_external 406 + mig_external 407 + #else 408 + extern 409 + #endif /* mig_external */ 410 + kern_return_t thread_get_mach_voucher 411 + ( 412 + thread_act_t thr_act, 413 + mach_voucher_selector_t which, 414 + ipc_voucher_t *voucher 415 + ); 416 + 417 + /* Routine thread_set_mach_voucher */ 418 + #ifdef mig_external 419 + mig_external 420 + #else 421 + extern 422 + #endif /* mig_external */ 423 + kern_return_t thread_set_mach_voucher 424 + ( 425 + thread_act_t thr_act, 426 + ipc_voucher_t voucher 427 + ); 428 + 429 + /* Routine thread_swap_mach_voucher */ 430 + #ifdef mig_external 431 + mig_external 432 + #else 433 + extern 434 + #endif /* mig_external */ 435 + kern_return_t thread_swap_mach_voucher 436 + ( 437 + thread_act_t thr_act, 438 + ipc_voucher_t new_voucher, 439 + ipc_voucher_t *old_voucher 440 + ); 441 + 442 + __END_DECLS 443 + 444 + /********************** Caution **************************/ 445 + /* The following data types should be used to calculate */ 446 + /* maximum message sizes only. The actual message may be */ 447 + /* smaller, and the position of the arguments within the */ 448 + /* message layout may vary from what is presented here. */ 449 + /* For example, if any of the arguments are variable- */ 450 + /* sized, and less than the maximum is sent, the data */ 451 + /* will be packed tight in the actual message to reduce */ 452 + /* the presence of holes. */ 453 + /********************** Caution **************************/ 454 + 455 + /* typedefs for all requests */ 456 + 457 + #ifndef __Request__thread_act_subsystem__defined 458 + #define __Request__thread_act_subsystem__defined 459 + 460 + #ifdef __MigPackStructs 461 + #pragma pack(8) 462 + #endif 463 + typedef struct { 464 + mach_msg_header_t Head; 465 + } __Request__thread_terminate_t; 466 + #ifdef __MigPackStructs 467 + #pragma pack() 468 + #endif 469 + 470 + #ifdef __MigPackStructs 471 + #pragma pack(8) 472 + #endif 473 + typedef struct { 474 + mach_msg_header_t Head; 475 + NDR_record_t NDR; 476 + int flavor; 477 + mach_msg_type_number_t old_stateCnt; 478 + } __Request__act_get_state_t; 479 + #ifdef __MigPackStructs 480 + #pragma pack() 481 + #endif 482 + 483 + #ifdef __MigPackStructs 484 + #pragma pack(8) 485 + #endif 486 + typedef struct { 487 + mach_msg_header_t Head; 488 + NDR_record_t NDR; 489 + int flavor; 490 + mach_msg_type_number_t new_stateCnt; 491 + natural_t new_state[224]; 492 + } __Request__act_set_state_t; 493 + #ifdef __MigPackStructs 494 + #pragma pack() 495 + #endif 496 + 497 + #ifdef __MigPackStructs 498 + #pragma pack(8) 499 + #endif 500 + typedef struct { 501 + mach_msg_header_t Head; 502 + NDR_record_t NDR; 503 + thread_state_flavor_t flavor; 504 + mach_msg_type_number_t old_stateCnt; 505 + } __Request__thread_get_state_t; 506 + #ifdef __MigPackStructs 507 + #pragma pack() 508 + #endif 509 + 510 + #ifdef __MigPackStructs 511 + #pragma pack(8) 512 + #endif 513 + typedef struct { 514 + mach_msg_header_t Head; 515 + NDR_record_t NDR; 516 + thread_state_flavor_t flavor; 517 + mach_msg_type_number_t new_stateCnt; 518 + natural_t new_state[224]; 519 + } __Request__thread_set_state_t; 520 + #ifdef __MigPackStructs 521 + #pragma pack() 522 + #endif 523 + 524 + #ifdef __MigPackStructs 525 + #pragma pack(8) 526 + #endif 527 + typedef struct { 528 + mach_msg_header_t Head; 529 + } __Request__thread_suspend_t; 530 + #ifdef __MigPackStructs 531 + #pragma pack() 532 + #endif 533 + 534 + #ifdef __MigPackStructs 535 + #pragma pack(8) 536 + #endif 537 + typedef struct { 538 + mach_msg_header_t Head; 539 + } __Request__thread_resume_t; 540 + #ifdef __MigPackStructs 541 + #pragma pack() 542 + #endif 543 + 544 + #ifdef __MigPackStructs 545 + #pragma pack(8) 546 + #endif 547 + typedef struct { 548 + mach_msg_header_t Head; 549 + } __Request__thread_abort_t; 550 + #ifdef __MigPackStructs 551 + #pragma pack() 552 + #endif 553 + 554 + #ifdef __MigPackStructs 555 + #pragma pack(8) 556 + #endif 557 + typedef struct { 558 + mach_msg_header_t Head; 559 + } __Request__thread_abort_safely_t; 560 + #ifdef __MigPackStructs 561 + #pragma pack() 562 + #endif 563 + 564 + #ifdef __MigPackStructs 565 + #pragma pack(8) 566 + #endif 567 + typedef struct { 568 + mach_msg_header_t Head; 569 + } __Request__thread_depress_abort_t; 570 + #ifdef __MigPackStructs 571 + #pragma pack() 572 + #endif 573 + 574 + #ifdef __MigPackStructs 575 + #pragma pack(8) 576 + #endif 577 + typedef struct { 578 + mach_msg_header_t Head; 579 + NDR_record_t NDR; 580 + int which_port; 581 + } __Request__thread_get_special_port_t; 582 + #ifdef __MigPackStructs 583 + #pragma pack() 584 + #endif 585 + 586 + #ifdef __MigPackStructs 587 + #pragma pack(8) 588 + #endif 589 + typedef struct { 590 + mach_msg_header_t Head; 591 + /* start of the kernel processed data */ 592 + mach_msg_body_t msgh_body; 593 + mach_msg_port_descriptor_t special_port; 594 + /* end of the kernel processed data */ 595 + NDR_record_t NDR; 596 + int which_port; 597 + } __Request__thread_set_special_port_t; 598 + #ifdef __MigPackStructs 599 + #pragma pack() 600 + #endif 601 + 602 + #ifdef __MigPackStructs 603 + #pragma pack(8) 604 + #endif 605 + typedef struct { 606 + mach_msg_header_t Head; 607 + NDR_record_t NDR; 608 + thread_flavor_t flavor; 609 + mach_msg_type_number_t thread_info_outCnt; 610 + } __Request__thread_info_t; 611 + #ifdef __MigPackStructs 612 + #pragma pack() 613 + #endif 614 + 615 + #ifdef __MigPackStructs 616 + #pragma pack(8) 617 + #endif 618 + typedef struct { 619 + mach_msg_header_t Head; 620 + /* start of the kernel processed data */ 621 + mach_msg_body_t msgh_body; 622 + mach_msg_port_descriptor_t new_port; 623 + /* end of the kernel processed data */ 624 + NDR_record_t NDR; 625 + exception_mask_t exception_mask; 626 + exception_behavior_t behavior; 627 + thread_state_flavor_t new_flavor; 628 + } __Request__thread_set_exception_ports_t; 629 + #ifdef __MigPackStructs 630 + #pragma pack() 631 + #endif 632 + 633 + #ifdef __MigPackStructs 634 + #pragma pack(8) 635 + #endif 636 + typedef struct { 637 + mach_msg_header_t Head; 638 + NDR_record_t NDR; 639 + exception_mask_t exception_mask; 640 + } __Request__thread_get_exception_ports_t; 641 + #ifdef __MigPackStructs 642 + #pragma pack() 643 + #endif 644 + 645 + #ifdef __MigPackStructs 646 + #pragma pack(8) 647 + #endif 648 + typedef struct { 649 + mach_msg_header_t Head; 650 + /* start of the kernel processed data */ 651 + mach_msg_body_t msgh_body; 652 + mach_msg_port_descriptor_t new_port; 653 + /* end of the kernel processed data */ 654 + NDR_record_t NDR; 655 + exception_mask_t exception_mask; 656 + exception_behavior_t behavior; 657 + thread_state_flavor_t new_flavor; 658 + } __Request__thread_swap_exception_ports_t; 659 + #ifdef __MigPackStructs 660 + #pragma pack() 661 + #endif 662 + 663 + #ifdef __MigPackStructs 664 + #pragma pack(8) 665 + #endif 666 + typedef struct { 667 + mach_msg_header_t Head; 668 + NDR_record_t NDR; 669 + policy_t policy; 670 + mach_msg_type_number_t baseCnt; 671 + integer_t base[5]; 672 + boolean_t set_limit; 673 + } __Request___kernelrpc_thread_policy_t; 674 + #ifdef __MigPackStructs 675 + #pragma pack() 676 + #endif 677 + 678 + #ifdef __MigPackStructs 679 + #pragma pack(8) 680 + #endif 681 + typedef struct { 682 + mach_msg_header_t Head; 683 + NDR_record_t NDR; 684 + thread_policy_flavor_t flavor; 685 + mach_msg_type_number_t policy_infoCnt; 686 + integer_t policy_info[16]; 687 + } __Request___kernelrpc_thread_policy_set_t; 688 + #ifdef __MigPackStructs 689 + #pragma pack() 690 + #endif 691 + 692 + #ifdef __MigPackStructs 693 + #pragma pack(8) 694 + #endif 695 + typedef struct { 696 + mach_msg_header_t Head; 697 + NDR_record_t NDR; 698 + thread_policy_flavor_t flavor; 699 + mach_msg_type_number_t policy_infoCnt; 700 + boolean_t get_default; 701 + } __Request__thread_policy_get_t; 702 + #ifdef __MigPackStructs 703 + #pragma pack() 704 + #endif 705 + 706 + #ifdef __MigPackStructs 707 + #pragma pack(8) 708 + #endif 709 + typedef struct { 710 + mach_msg_header_t Head; 711 + /* start of the kernel processed data */ 712 + mach_msg_body_t msgh_body; 713 + mach_msg_port_descriptor_t reply; 714 + /* end of the kernel processed data */ 715 + } __Request__thread_sample_t; 716 + #ifdef __MigPackStructs 717 + #pragma pack() 718 + #endif 719 + 720 + #ifdef __MigPackStructs 721 + #pragma pack(8) 722 + #endif 723 + typedef struct { 724 + mach_msg_header_t Head; 725 + NDR_record_t NDR; 726 + boolean_t trace_status; 727 + } __Request__etap_trace_thread_t; 728 + #ifdef __MigPackStructs 729 + #pragma pack() 730 + #endif 731 + 732 + #ifdef __MigPackStructs 733 + #pragma pack(8) 734 + #endif 735 + typedef struct { 736 + mach_msg_header_t Head; 737 + /* start of the kernel processed data */ 738 + mach_msg_body_t msgh_body; 739 + mach_msg_port_descriptor_t new_set; 740 + /* end of the kernel processed data */ 741 + } __Request__thread_assign_t; 742 + #ifdef __MigPackStructs 743 + #pragma pack() 744 + #endif 745 + 746 + #ifdef __MigPackStructs 747 + #pragma pack(8) 748 + #endif 749 + typedef struct { 750 + mach_msg_header_t Head; 751 + } __Request__thread_assign_default_t; 752 + #ifdef __MigPackStructs 753 + #pragma pack() 754 + #endif 755 + 756 + #ifdef __MigPackStructs 757 + #pragma pack(8) 758 + #endif 759 + typedef struct { 760 + mach_msg_header_t Head; 761 + } __Request__thread_get_assignment_t; 762 + #ifdef __MigPackStructs 763 + #pragma pack() 764 + #endif 765 + 766 + #ifdef __MigPackStructs 767 + #pragma pack(8) 768 + #endif 769 + typedef struct { 770 + mach_msg_header_t Head; 771 + /* start of the kernel processed data */ 772 + mach_msg_body_t msgh_body; 773 + mach_msg_port_descriptor_t pset; 774 + /* end of the kernel processed data */ 775 + NDR_record_t NDR; 776 + policy_t policy; 777 + mach_msg_type_number_t baseCnt; 778 + integer_t base[5]; 779 + mach_msg_type_number_t limitCnt; 780 + integer_t limit[1]; 781 + } __Request___kernelrpc_thread_set_policy_t; 782 + #ifdef __MigPackStructs 783 + #pragma pack() 784 + #endif 785 + 786 + #ifdef __MigPackStructs 787 + #pragma pack(8) 788 + #endif 789 + typedef struct { 790 + mach_msg_header_t Head; 791 + NDR_record_t NDR; 792 + mach_voucher_selector_t which; 793 + } __Request__thread_get_mach_voucher_t; 794 + #ifdef __MigPackStructs 795 + #pragma pack() 796 + #endif 797 + 798 + #ifdef __MigPackStructs 799 + #pragma pack(8) 800 + #endif 801 + typedef struct { 802 + mach_msg_header_t Head; 803 + /* start of the kernel processed data */ 804 + mach_msg_body_t msgh_body; 805 + mach_msg_port_descriptor_t voucher; 806 + /* end of the kernel processed data */ 807 + } __Request__thread_set_mach_voucher_t; 808 + #ifdef __MigPackStructs 809 + #pragma pack() 810 + #endif 811 + 812 + #ifdef __MigPackStructs 813 + #pragma pack(8) 814 + #endif 815 + typedef struct { 816 + mach_msg_header_t Head; 817 + /* start of the kernel processed data */ 818 + mach_msg_body_t msgh_body; 819 + mach_msg_port_descriptor_t new_voucher; 820 + mach_msg_port_descriptor_t old_voucher; 821 + /* end of the kernel processed data */ 822 + } __Request__thread_swap_mach_voucher_t; 823 + #ifdef __MigPackStructs 824 + #pragma pack() 825 + #endif 826 + #endif /* !__Request__thread_act_subsystem__defined */ 827 + 828 + /* union of all requests */ 829 + 830 + #ifndef __RequestUnion__thread_act_subsystem__defined 831 + #define __RequestUnion__thread_act_subsystem__defined 832 + union __RequestUnion__thread_act_subsystem { 833 + __Request__thread_terminate_t Request_thread_terminate; 834 + __Request__act_get_state_t Request_act_get_state; 835 + __Request__act_set_state_t Request_act_set_state; 836 + __Request__thread_get_state_t Request_thread_get_state; 837 + __Request__thread_set_state_t Request_thread_set_state; 838 + __Request__thread_suspend_t Request_thread_suspend; 839 + __Request__thread_resume_t Request_thread_resume; 840 + __Request__thread_abort_t Request_thread_abort; 841 + __Request__thread_abort_safely_t Request_thread_abort_safely; 842 + __Request__thread_depress_abort_t Request_thread_depress_abort; 843 + __Request__thread_get_special_port_t Request_thread_get_special_port; 844 + __Request__thread_set_special_port_t Request_thread_set_special_port; 845 + __Request__thread_info_t Request_thread_info; 846 + __Request__thread_set_exception_ports_t Request_thread_set_exception_ports; 847 + __Request__thread_get_exception_ports_t Request_thread_get_exception_ports; 848 + __Request__thread_swap_exception_ports_t Request_thread_swap_exception_ports; 849 + __Request___kernelrpc_thread_policy_t Request__kernelrpc_thread_policy; 850 + __Request___kernelrpc_thread_policy_set_t Request__kernelrpc_thread_policy_set; 851 + __Request__thread_policy_get_t Request_thread_policy_get; 852 + __Request__thread_sample_t Request_thread_sample; 853 + __Request__etap_trace_thread_t Request_etap_trace_thread; 854 + __Request__thread_assign_t Request_thread_assign; 855 + __Request__thread_assign_default_t Request_thread_assign_default; 856 + __Request__thread_get_assignment_t Request_thread_get_assignment; 857 + __Request___kernelrpc_thread_set_policy_t Request__kernelrpc_thread_set_policy; 858 + __Request__thread_get_mach_voucher_t Request_thread_get_mach_voucher; 859 + __Request__thread_set_mach_voucher_t Request_thread_set_mach_voucher; 860 + __Request__thread_swap_mach_voucher_t Request_thread_swap_mach_voucher; 861 + }; 862 + #endif /* !__RequestUnion__thread_act_subsystem__defined */ 863 + /* typedefs for all replies */ 864 + 865 + #ifndef __Reply__thread_act_subsystem__defined 866 + #define __Reply__thread_act_subsystem__defined 867 + 868 + #ifdef __MigPackStructs 869 + #pragma pack(8) 870 + #endif 871 + typedef struct { 872 + mach_msg_header_t Head; 873 + NDR_record_t NDR; 874 + kern_return_t RetCode; 875 + } __Reply__thread_terminate_t; 876 + #ifdef __MigPackStructs 877 + #pragma pack() 878 + #endif 879 + 880 + #ifdef __MigPackStructs 881 + #pragma pack(8) 882 + #endif 883 + typedef struct { 884 + mach_msg_header_t Head; 885 + NDR_record_t NDR; 886 + kern_return_t RetCode; 887 + mach_msg_type_number_t old_stateCnt; 888 + natural_t old_state[224]; 889 + } __Reply__act_get_state_t; 890 + #ifdef __MigPackStructs 891 + #pragma pack() 892 + #endif 893 + 894 + #ifdef __MigPackStructs 895 + #pragma pack(8) 896 + #endif 897 + typedef struct { 898 + mach_msg_header_t Head; 899 + NDR_record_t NDR; 900 + kern_return_t RetCode; 901 + } __Reply__act_set_state_t; 902 + #ifdef __MigPackStructs 903 + #pragma pack() 904 + #endif 905 + 906 + #ifdef __MigPackStructs 907 + #pragma pack(8) 908 + #endif 909 + typedef struct { 910 + mach_msg_header_t Head; 911 + NDR_record_t NDR; 912 + kern_return_t RetCode; 913 + mach_msg_type_number_t old_stateCnt; 914 + natural_t old_state[224]; 915 + } __Reply__thread_get_state_t; 916 + #ifdef __MigPackStructs 917 + #pragma pack() 918 + #endif 919 + 920 + #ifdef __MigPackStructs 921 + #pragma pack(8) 922 + #endif 923 + typedef struct { 924 + mach_msg_header_t Head; 925 + NDR_record_t NDR; 926 + kern_return_t RetCode; 927 + } __Reply__thread_set_state_t; 928 + #ifdef __MigPackStructs 929 + #pragma pack() 930 + #endif 931 + 932 + #ifdef __MigPackStructs 933 + #pragma pack(8) 934 + #endif 935 + typedef struct { 936 + mach_msg_header_t Head; 937 + NDR_record_t NDR; 938 + kern_return_t RetCode; 939 + } __Reply__thread_suspend_t; 940 + #ifdef __MigPackStructs 941 + #pragma pack() 942 + #endif 943 + 944 + #ifdef __MigPackStructs 945 + #pragma pack(8) 946 + #endif 947 + typedef struct { 948 + mach_msg_header_t Head; 949 + NDR_record_t NDR; 950 + kern_return_t RetCode; 951 + } __Reply__thread_resume_t; 952 + #ifdef __MigPackStructs 953 + #pragma pack() 954 + #endif 955 + 956 + #ifdef __MigPackStructs 957 + #pragma pack(8) 958 + #endif 959 + typedef struct { 960 + mach_msg_header_t Head; 961 + NDR_record_t NDR; 962 + kern_return_t RetCode; 963 + } __Reply__thread_abort_t; 964 + #ifdef __MigPackStructs 965 + #pragma pack() 966 + #endif 967 + 968 + #ifdef __MigPackStructs 969 + #pragma pack(8) 970 + #endif 971 + typedef struct { 972 + mach_msg_header_t Head; 973 + NDR_record_t NDR; 974 + kern_return_t RetCode; 975 + } __Reply__thread_abort_safely_t; 976 + #ifdef __MigPackStructs 977 + #pragma pack() 978 + #endif 979 + 980 + #ifdef __MigPackStructs 981 + #pragma pack(8) 982 + #endif 983 + typedef struct { 984 + mach_msg_header_t Head; 985 + NDR_record_t NDR; 986 + kern_return_t RetCode; 987 + } __Reply__thread_depress_abort_t; 988 + #ifdef __MigPackStructs 989 + #pragma pack() 990 + #endif 991 + 992 + #ifdef __MigPackStructs 993 + #pragma pack(8) 994 + #endif 995 + typedef struct { 996 + mach_msg_header_t Head; 997 + /* start of the kernel processed data */ 998 + mach_msg_body_t msgh_body; 999 + mach_msg_port_descriptor_t special_port; 1000 + /* end of the kernel processed data */ 1001 + } __Reply__thread_get_special_port_t; 1002 + #ifdef __MigPackStructs 1003 + #pragma pack() 1004 + #endif 1005 + 1006 + #ifdef __MigPackStructs 1007 + #pragma pack(8) 1008 + #endif 1009 + typedef struct { 1010 + mach_msg_header_t Head; 1011 + NDR_record_t NDR; 1012 + kern_return_t RetCode; 1013 + } __Reply__thread_set_special_port_t; 1014 + #ifdef __MigPackStructs 1015 + #pragma pack() 1016 + #endif 1017 + 1018 + #ifdef __MigPackStructs 1019 + #pragma pack(8) 1020 + #endif 1021 + typedef struct { 1022 + mach_msg_header_t Head; 1023 + NDR_record_t NDR; 1024 + kern_return_t RetCode; 1025 + mach_msg_type_number_t thread_info_outCnt; 1026 + integer_t thread_info_out[12]; 1027 + } __Reply__thread_info_t; 1028 + #ifdef __MigPackStructs 1029 + #pragma pack() 1030 + #endif 1031 + 1032 + #ifdef __MigPackStructs 1033 + #pragma pack(8) 1034 + #endif 1035 + typedef struct { 1036 + mach_msg_header_t Head; 1037 + NDR_record_t NDR; 1038 + kern_return_t RetCode; 1039 + } __Reply__thread_set_exception_ports_t; 1040 + #ifdef __MigPackStructs 1041 + #pragma pack() 1042 + #endif 1043 + 1044 + #ifdef __MigPackStructs 1045 + #pragma pack(8) 1046 + #endif 1047 + typedef struct { 1048 + mach_msg_header_t Head; 1049 + /* start of the kernel processed data */ 1050 + mach_msg_body_t msgh_body; 1051 + mach_msg_port_descriptor_t old_handlers[32]; 1052 + /* end of the kernel processed data */ 1053 + NDR_record_t NDR; 1054 + mach_msg_type_number_t masksCnt; 1055 + exception_mask_t masks[32]; 1056 + exception_behavior_t old_behaviors[32]; 1057 + thread_state_flavor_t old_flavors[32]; 1058 + } __Reply__thread_get_exception_ports_t; 1059 + #ifdef __MigPackStructs 1060 + #pragma pack() 1061 + #endif 1062 + 1063 + #ifdef __MigPackStructs 1064 + #pragma pack(8) 1065 + #endif 1066 + typedef struct { 1067 + mach_msg_header_t Head; 1068 + /* start of the kernel processed data */ 1069 + mach_msg_body_t msgh_body; 1070 + mach_msg_port_descriptor_t old_handlers[32]; 1071 + /* end of the kernel processed data */ 1072 + NDR_record_t NDR; 1073 + mach_msg_type_number_t masksCnt; 1074 + exception_mask_t masks[32]; 1075 + exception_behavior_t old_behaviors[32]; 1076 + thread_state_flavor_t old_flavors[32]; 1077 + } __Reply__thread_swap_exception_ports_t; 1078 + #ifdef __MigPackStructs 1079 + #pragma pack() 1080 + #endif 1081 + 1082 + #ifdef __MigPackStructs 1083 + #pragma pack(8) 1084 + #endif 1085 + typedef struct { 1086 + mach_msg_header_t Head; 1087 + NDR_record_t NDR; 1088 + kern_return_t RetCode; 1089 + } __Reply___kernelrpc_thread_policy_t; 1090 + #ifdef __MigPackStructs 1091 + #pragma pack() 1092 + #endif 1093 + 1094 + #ifdef __MigPackStructs 1095 + #pragma pack(8) 1096 + #endif 1097 + typedef struct { 1098 + mach_msg_header_t Head; 1099 + NDR_record_t NDR; 1100 + kern_return_t RetCode; 1101 + } __Reply___kernelrpc_thread_policy_set_t; 1102 + #ifdef __MigPackStructs 1103 + #pragma pack() 1104 + #endif 1105 + 1106 + #ifdef __MigPackStructs 1107 + #pragma pack(8) 1108 + #endif 1109 + typedef struct { 1110 + mach_msg_header_t Head; 1111 + NDR_record_t NDR; 1112 + kern_return_t RetCode; 1113 + mach_msg_type_number_t policy_infoCnt; 1114 + integer_t policy_info[16]; 1115 + boolean_t get_default; 1116 + } __Reply__thread_policy_get_t; 1117 + #ifdef __MigPackStructs 1118 + #pragma pack() 1119 + #endif 1120 + 1121 + #ifdef __MigPackStructs 1122 + #pragma pack(8) 1123 + #endif 1124 + typedef struct { 1125 + mach_msg_header_t Head; 1126 + NDR_record_t NDR; 1127 + kern_return_t RetCode; 1128 + } __Reply__thread_sample_t; 1129 + #ifdef __MigPackStructs 1130 + #pragma pack() 1131 + #endif 1132 + 1133 + #ifdef __MigPackStructs 1134 + #pragma pack(8) 1135 + #endif 1136 + typedef struct { 1137 + mach_msg_header_t Head; 1138 + NDR_record_t NDR; 1139 + kern_return_t RetCode; 1140 + } __Reply__etap_trace_thread_t; 1141 + #ifdef __MigPackStructs 1142 + #pragma pack() 1143 + #endif 1144 + 1145 + #ifdef __MigPackStructs 1146 + #pragma pack(8) 1147 + #endif 1148 + typedef struct { 1149 + mach_msg_header_t Head; 1150 + NDR_record_t NDR; 1151 + kern_return_t RetCode; 1152 + } __Reply__thread_assign_t; 1153 + #ifdef __MigPackStructs 1154 + #pragma pack() 1155 + #endif 1156 + 1157 + #ifdef __MigPackStructs 1158 + #pragma pack(8) 1159 + #endif 1160 + typedef struct { 1161 + mach_msg_header_t Head; 1162 + NDR_record_t NDR; 1163 + kern_return_t RetCode; 1164 + } __Reply__thread_assign_default_t; 1165 + #ifdef __MigPackStructs 1166 + #pragma pack() 1167 + #endif 1168 + 1169 + #ifdef __MigPackStructs 1170 + #pragma pack(8) 1171 + #endif 1172 + typedef struct { 1173 + mach_msg_header_t Head; 1174 + /* start of the kernel processed data */ 1175 + mach_msg_body_t msgh_body; 1176 + mach_msg_port_descriptor_t assigned_set; 1177 + /* end of the kernel processed data */ 1178 + } __Reply__thread_get_assignment_t; 1179 + #ifdef __MigPackStructs 1180 + #pragma pack() 1181 + #endif 1182 + 1183 + #ifdef __MigPackStructs 1184 + #pragma pack(8) 1185 + #endif 1186 + typedef struct { 1187 + mach_msg_header_t Head; 1188 + NDR_record_t NDR; 1189 + kern_return_t RetCode; 1190 + } __Reply___kernelrpc_thread_set_policy_t; 1191 + #ifdef __MigPackStructs 1192 + #pragma pack() 1193 + #endif 1194 + 1195 + #ifdef __MigPackStructs 1196 + #pragma pack(8) 1197 + #endif 1198 + typedef struct { 1199 + mach_msg_header_t Head; 1200 + /* start of the kernel processed data */ 1201 + mach_msg_body_t msgh_body; 1202 + mach_msg_port_descriptor_t voucher; 1203 + /* end of the kernel processed data */ 1204 + } __Reply__thread_get_mach_voucher_t; 1205 + #ifdef __MigPackStructs 1206 + #pragma pack() 1207 + #endif 1208 + 1209 + #ifdef __MigPackStructs 1210 + #pragma pack(8) 1211 + #endif 1212 + typedef struct { 1213 + mach_msg_header_t Head; 1214 + NDR_record_t NDR; 1215 + kern_return_t RetCode; 1216 + } __Reply__thread_set_mach_voucher_t; 1217 + #ifdef __MigPackStructs 1218 + #pragma pack() 1219 + #endif 1220 + 1221 + #ifdef __MigPackStructs 1222 + #pragma pack(8) 1223 + #endif 1224 + typedef struct { 1225 + mach_msg_header_t Head; 1226 + /* start of the kernel processed data */ 1227 + mach_msg_body_t msgh_body; 1228 + mach_msg_port_descriptor_t old_voucher; 1229 + /* end of the kernel processed data */ 1230 + } __Reply__thread_swap_mach_voucher_t; 1231 + #ifdef __MigPackStructs 1232 + #pragma pack() 1233 + #endif 1234 + #endif /* !__Reply__thread_act_subsystem__defined */ 1235 + 1236 + /* union of all replies */ 1237 + 1238 + #ifndef __ReplyUnion__thread_act_subsystem__defined 1239 + #define __ReplyUnion__thread_act_subsystem__defined 1240 + union __ReplyUnion__thread_act_subsystem { 1241 + __Reply__thread_terminate_t Reply_thread_terminate; 1242 + __Reply__act_get_state_t Reply_act_get_state; 1243 + __Reply__act_set_state_t Reply_act_set_state; 1244 + __Reply__thread_get_state_t Reply_thread_get_state; 1245 + __Reply__thread_set_state_t Reply_thread_set_state; 1246 + __Reply__thread_suspend_t Reply_thread_suspend; 1247 + __Reply__thread_resume_t Reply_thread_resume; 1248 + __Reply__thread_abort_t Reply_thread_abort; 1249 + __Reply__thread_abort_safely_t Reply_thread_abort_safely; 1250 + __Reply__thread_depress_abort_t Reply_thread_depress_abort; 1251 + __Reply__thread_get_special_port_t Reply_thread_get_special_port; 1252 + __Reply__thread_set_special_port_t Reply_thread_set_special_port; 1253 + __Reply__thread_info_t Reply_thread_info; 1254 + __Reply__thread_set_exception_ports_t Reply_thread_set_exception_ports; 1255 + __Reply__thread_get_exception_ports_t Reply_thread_get_exception_ports; 1256 + __Reply__thread_swap_exception_ports_t Reply_thread_swap_exception_ports; 1257 + __Reply___kernelrpc_thread_policy_t Reply__kernelrpc_thread_policy; 1258 + __Reply___kernelrpc_thread_policy_set_t Reply__kernelrpc_thread_policy_set; 1259 + __Reply__thread_policy_get_t Reply_thread_policy_get; 1260 + __Reply__thread_sample_t Reply_thread_sample; 1261 + __Reply__etap_trace_thread_t Reply_etap_trace_thread; 1262 + __Reply__thread_assign_t Reply_thread_assign; 1263 + __Reply__thread_assign_default_t Reply_thread_assign_default; 1264 + __Reply__thread_get_assignment_t Reply_thread_get_assignment; 1265 + __Reply___kernelrpc_thread_set_policy_t Reply__kernelrpc_thread_set_policy; 1266 + __Reply__thread_get_mach_voucher_t Reply_thread_get_mach_voucher; 1267 + __Reply__thread_set_mach_voucher_t Reply_thread_set_mach_voucher; 1268 + __Reply__thread_swap_mach_voucher_t Reply_thread_swap_mach_voucher; 1269 + }; 1270 + #endif /* !__RequestUnion__thread_act_subsystem__defined */ 1271 + 1272 + #ifndef subsystem_to_name_map_thread_act 1273 + #define subsystem_to_name_map_thread_act \ 1274 + { "thread_terminate", 3600 },\ 1275 + { "act_get_state", 3601 },\ 1276 + { "act_set_state", 3602 },\ 1277 + { "thread_get_state", 3603 },\ 1278 + { "thread_set_state", 3604 },\ 1279 + { "thread_suspend", 3605 },\ 1280 + { "thread_resume", 3606 },\ 1281 + { "thread_abort", 3607 },\ 1282 + { "thread_abort_safely", 3608 },\ 1283 + { "thread_depress_abort", 3609 },\ 1284 + { "thread_get_special_port", 3610 },\ 1285 + { "thread_set_special_port", 3611 },\ 1286 + { "thread_info", 3612 },\ 1287 + { "thread_set_exception_ports", 3613 },\ 1288 + { "thread_get_exception_ports", 3614 },\ 1289 + { "thread_swap_exception_ports", 3615 },\ 1290 + { "_kernelrpc_thread_policy", 3616 },\ 1291 + { "_kernelrpc_thread_policy_set", 3617 },\ 1292 + { "thread_policy_get", 3618 },\ 1293 + { "thread_sample", 3619 },\ 1294 + { "etap_trace_thread", 3620 },\ 1295 + { "thread_assign", 3621 },\ 1296 + { "thread_assign_default", 3622 },\ 1297 + { "thread_get_assignment", 3623 },\ 1298 + { "_kernelrpc_thread_set_policy", 3624 },\ 1299 + { "thread_get_mach_voucher", 3625 },\ 1300 + { "thread_set_mach_voucher", 3626 },\ 1301 + { "thread_swap_mach_voucher", 3627 } 1302 + #endif 1303 + 1304 + #ifdef __AfterMigUserHeader 1305 + __AfterMigUserHeader 1306 + #endif /* __AfterMigUserHeader */ 1307 + 1308 + #endif /* _thread_act_user_ */
+2 -6
lkm/servers/mach_host.c
··· 141 141 142 142 if (*host_info_outCnt <= HOST_BASIC_INFO_COUNT) 143 143 { 144 - int pos = 0, last_phys_id = -1; 144 + int pos, last_phys_id = -1; 145 145 146 146 *host_info_outCnt = HOST_BASIC_INFO_COUNT; 147 147 hinfo->max_mem = i.totalram; 148 148 hinfo->logical_cpu = 0; 149 149 hinfo->physical_cpu = 0; 150 150 151 - while (1) 151 + for (pos = 0;; pos++) 152 152 { 153 153 pos = cpumask_next(pos - 1, cpu_online_mask); 154 154 if (pos >= nr_cpu_ids) ··· 162 162 hinfo->logical_cpu++; 163 163 164 164 if (cpu->phys_proc_id == last_phys_id) 165 - { 166 - pos++; 167 165 continue; 168 - } 169 166 170 167 last_phys_id = cpu->phys_proc_id; 171 168 hinfo->physical_cpu += cpu->booted_cores; 172 169 } 173 170 #endif 174 - pos++; 175 171 } 176 172 177 173 hinfo->logical_cpu_max = hinfo->logical_cpu;
+1
lkm/servers/stub.h
··· 19 19 20 20 #ifndef SERVERS_STUB_H 21 21 #define SERVERS_STUB_H 22 + #include "../debug.h" 22 23 23 24 #define UNIMPL_MIG_CALL() debug_msg("STUB MIG call %s in " __FILE__ "\n", __func__) 24 25
+377
lkm/servers/thread_act.c
··· 1 + /* 2 + * Darling Mach Linux Kernel Module 3 + * Copyright (C) 2015 Lubos Dolezel 4 + * 5 + * This program is free software; you can redistribute it and/or 6 + * modify it under the terms of the GNU General Public License 7 + * as published by the Free Software Foundation; either version 2 8 + * of the License, or (at your option) 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, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 + */ 19 + 20 + #include <mach/mach_types.h> 21 + #include "../mach_includes.h" 22 + #include "../ipc_server.h" 23 + #include "stub.h" 24 + #include <linux/sched.h> 25 + #include "thread_act.h" 26 + 27 + struct thread_private 28 + { 29 + pid_t thread_id; 30 + }; 31 + 32 + static 33 + void __thread_free(server_port_t* port) 34 + { 35 + kfree(port->private_data); 36 + } 37 + 38 + extern struct mig_subsystem thread_act_subsystem; 39 + void ipc_port_make_thread(darling_mach_port_t* port) 40 + { 41 + struct thread_private* priv; 42 + 43 + port->is_server_port = true; 44 + port->server_port.subsystem = (mig_subsystem_t) &thread_act_subsystem; 45 + port->server_port.cb_free = __thread_free; 46 + 47 + priv = (struct thread_private*) kmalloc(sizeof(struct thread_private), 48 + GFP_KERNEL); 49 + 50 + port->server_port.private_data = priv; 51 + priv->thread_id = current->pid; 52 + } 53 + 54 + pid_t get_thread_pid(darling_mach_port_t* port) 55 + { 56 + struct thread_private* priv; 57 + 58 + priv = (struct thread_private*) port->server_port.private_data; 59 + return priv->thread_id; 60 + } 61 + 62 + kern_return_t thread_terminate 63 + ( 64 + thread_act_t target_act 65 + ) 66 + { 67 + UNIMPL_MIG_CALL(); 68 + return KERN_NOT_SUPPORTED; 69 + } 70 + 71 + kern_return_t act_get_state 72 + ( 73 + thread_act_t target_act, 74 + int flavor, 75 + thread_state_t old_state, 76 + mach_msg_type_number_t *old_stateCnt 77 + ) 78 + { 79 + UNIMPL_MIG_CALL(); 80 + return KERN_NOT_SUPPORTED; 81 + } 82 + 83 + kern_return_t act_set_state 84 + ( 85 + thread_act_t target_act, 86 + int flavor, 87 + thread_state_t new_state, 88 + mach_msg_type_number_t new_stateCnt 89 + ) 90 + { 91 + UNIMPL_MIG_CALL(); 92 + return KERN_NOT_SUPPORTED; 93 + } 94 + 95 + kern_return_t thread_get_state 96 + ( 97 + thread_act_t target_act, 98 + thread_state_flavor_t flavor, 99 + thread_state_t old_state, 100 + mach_msg_type_number_t *old_stateCnt 101 + ) 102 + { 103 + UNIMPL_MIG_CALL(); 104 + return KERN_NOT_SUPPORTED; 105 + } 106 + 107 + kern_return_t thread_set_state 108 + ( 109 + thread_act_t target_act, 110 + thread_state_flavor_t flavor, 111 + thread_state_t new_state, 112 + mach_msg_type_number_t new_stateCnt 113 + ) 114 + { 115 + UNIMPL_MIG_CALL(); 116 + return KERN_NOT_SUPPORTED; 117 + } 118 + 119 + kern_return_t thread_suspend 120 + ( 121 + thread_act_t target_act 122 + ) 123 + { 124 + UNIMPL_MIG_CALL(); 125 + return KERN_NOT_SUPPORTED; 126 + } 127 + 128 + kern_return_t thread_resume 129 + ( 130 + thread_act_t target_act 131 + ) 132 + { 133 + UNIMPL_MIG_CALL(); 134 + return KERN_NOT_SUPPORTED; 135 + } 136 + 137 + kern_return_t thread_abort 138 + ( 139 + thread_act_t target_act 140 + ) 141 + { 142 + UNIMPL_MIG_CALL(); 143 + return KERN_NOT_SUPPORTED; 144 + } 145 + 146 + kern_return_t thread_abort_safely 147 + ( 148 + thread_act_t target_act 149 + ) 150 + { 151 + UNIMPL_MIG_CALL(); 152 + return KERN_NOT_SUPPORTED; 153 + } 154 + 155 + kern_return_t thread_depress_abort 156 + ( 157 + thread_act_t thread 158 + ) 159 + { 160 + UNIMPL_MIG_CALL(); 161 + return KERN_NOT_SUPPORTED; 162 + } 163 + 164 + kern_return_t thread_get_special_port 165 + ( 166 + thread_act_t thr_act, 167 + int which_port, 168 + mach_port_t *special_port 169 + ) 170 + { 171 + UNIMPL_MIG_CALL(); 172 + return KERN_NOT_SUPPORTED; 173 + } 174 + 175 + kern_return_t thread_set_special_port 176 + ( 177 + thread_act_t thr_act, 178 + int which_port, 179 + mach_port_t special_port 180 + ) 181 + { 182 + UNIMPL_MIG_CALL(); 183 + return KERN_NOT_SUPPORTED; 184 + } 185 + 186 + kern_return_t thread_info 187 + ( 188 + thread_act_t target_act, 189 + thread_flavor_t flavor, 190 + thread_info_t thread_info_out, 191 + mach_msg_type_number_t *thread_info_outCnt 192 + ) 193 + { 194 + UNIMPL_MIG_CALL(); 195 + return KERN_NOT_SUPPORTED; 196 + } 197 + 198 + kern_return_t thread_set_exception_ports 199 + ( 200 + thread_act_t thread, 201 + exception_mask_t exception_mask, 202 + mach_port_t new_port, 203 + exception_behavior_t behavior, 204 + thread_state_flavor_t new_flavor 205 + ) 206 + { 207 + UNIMPL_MIG_CALL(); 208 + return KERN_NOT_SUPPORTED; 209 + } 210 + 211 + kern_return_t thread_get_exception_ports 212 + ( 213 + thread_act_t thread, 214 + exception_mask_t exception_mask, 215 + exception_mask_array_t masks, 216 + mach_msg_type_number_t *masksCnt, 217 + exception_handler_array_t old_handlers, 218 + exception_behavior_array_t old_behaviors, 219 + exception_flavor_array_t old_flavors 220 + ) 221 + { 222 + UNIMPL_MIG_CALL(); 223 + return KERN_NOT_SUPPORTED; 224 + } 225 + 226 + kern_return_t thread_swap_exception_ports 227 + ( 228 + thread_act_t thread, 229 + exception_mask_t exception_mask, 230 + mach_port_t new_port, 231 + exception_behavior_t behavior, 232 + thread_state_flavor_t new_flavor, 233 + exception_mask_array_t masks, 234 + mach_msg_type_number_t *masksCnt, 235 + exception_handler_array_t old_handlers, 236 + exception_behavior_array_t old_behaviors, 237 + exception_flavor_array_t old_flavors 238 + ) 239 + { 240 + UNIMPL_MIG_CALL(); 241 + return KERN_NOT_SUPPORTED; 242 + } 243 + 244 + kern_return_t _kernelrpc_thread_policy 245 + ( 246 + thread_act_t thr_act, 247 + policy_t policy, 248 + policy_base_t base, 249 + mach_msg_type_number_t baseCnt, 250 + boolean_t set_limit 251 + ) 252 + { 253 + UNIMPL_MIG_CALL(); 254 + return KERN_NOT_SUPPORTED; 255 + } 256 + 257 + kern_return_t _kernelrpc_thread_policy_set 258 + ( 259 + thread_act_t thread, 260 + thread_policy_flavor_t flavor, 261 + thread_policy_t policy_info, 262 + mach_msg_type_number_t policy_infoCnt 263 + ) 264 + { 265 + UNIMPL_MIG_CALL(); 266 + return KERN_NOT_SUPPORTED; 267 + } 268 + 269 + kern_return_t thread_policy_get 270 + ( 271 + thread_act_t thread, 272 + thread_policy_flavor_t flavor, 273 + thread_policy_t policy_info, 274 + mach_msg_type_number_t *policy_infoCnt, 275 + boolean_t *get_default 276 + ) 277 + { 278 + UNIMPL_MIG_CALL(); 279 + return KERN_NOT_SUPPORTED; 280 + } 281 + 282 + kern_return_t thread_sample 283 + ( 284 + thread_act_t thread, 285 + mach_port_t reply 286 + ) 287 + { 288 + UNIMPL_MIG_CALL(); 289 + return KERN_NOT_SUPPORTED; 290 + } 291 + 292 + kern_return_t etap_trace_thread 293 + ( 294 + thread_act_t target_act, 295 + boolean_t trace_status 296 + ) 297 + { 298 + UNIMPL_MIG_CALL(); 299 + return KERN_NOT_SUPPORTED; 300 + } 301 + 302 + kern_return_t thread_assign 303 + ( 304 + thread_act_t thread, 305 + processor_set_t new_set 306 + ) 307 + { 308 + UNIMPL_MIG_CALL(); 309 + return KERN_NOT_SUPPORTED; 310 + } 311 + 312 + kern_return_t thread_assign_default 313 + ( 314 + thread_act_t thread 315 + ) 316 + { 317 + UNIMPL_MIG_CALL(); 318 + return KERN_NOT_SUPPORTED; 319 + } 320 + 321 + kern_return_t thread_get_assignment 322 + ( 323 + thread_act_t thread, 324 + processor_set_name_t *assigned_set 325 + ) 326 + { 327 + UNIMPL_MIG_CALL(); 328 + return KERN_NOT_SUPPORTED; 329 + } 330 + 331 + kern_return_t _kernelrpc_thread_set_policy 332 + ( 333 + thread_act_t thr_act, 334 + processor_set_t pset, 335 + policy_t policy, 336 + policy_base_t base, 337 + mach_msg_type_number_t baseCnt, 338 + policy_limit_t limit, 339 + mach_msg_type_number_t limitCnt 340 + ) 341 + { 342 + UNIMPL_MIG_CALL(); 343 + return KERN_NOT_SUPPORTED; 344 + } 345 + 346 + kern_return_t thread_get_mach_voucher 347 + ( 348 + thread_act_t thr_act, 349 + mach_voucher_selector_t which, 350 + ipc_voucher_t *voucher 351 + ) 352 + { 353 + UNIMPL_MIG_CALL(); 354 + return KERN_NOT_SUPPORTED; 355 + } 356 + 357 + kern_return_t thread_set_mach_voucher 358 + ( 359 + thread_act_t thr_act, 360 + ipc_voucher_t voucher 361 + ) 362 + { 363 + UNIMPL_MIG_CALL(); 364 + return KERN_NOT_SUPPORTED; 365 + } 366 + 367 + kern_return_t thread_swap_mach_voucher 368 + ( 369 + thread_act_t thr_act, 370 + ipc_voucher_t new_voucher, 371 + ipc_voucher_t *old_voucher 372 + ) 373 + { 374 + UNIMPL_MIG_CALL(); 375 + return KERN_NOT_SUPPORTED; 376 + } 377 +
+27
lkm/servers/thread_act.h
··· 1 + /* 2 + * Darling Mach Linux Kernel Module 3 + * Copyright (C) 2015 Lubos Dolezel 4 + * 5 + * This program is free software; you can redistribute it and/or 6 + * modify it under the terms of the GNU General Public License 7 + * as published by the Free Software Foundation; either version 2 8 + * of the License, or (at your option) 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, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 + */ 19 + 20 + #ifndef SERVER_THREAD_ACT_H 21 + #define SERVER_THREAD_ACT_H 22 + #include "../ipc_types.h" 23 + 24 + void ipc_port_make_thread(darling_mach_port_t* port); 25 + pid_t get_thread_pid(darling_mach_port_t* port); 26 + 27 + #endif
+86 -5
lkm/traps.c
··· 25 25 #include <linux/list.h> 26 26 #include <linux/sched.h> 27 27 #include <linux/uaccess.h> 28 + #include <linux/file.h> 29 + #include <linux/dcache.h> 28 30 #include "darling_task.h" 29 31 #include "traps.h" 30 32 #include "ipc_space.h" ··· 34 36 #include "debug.h" 35 37 #include "ipc_server.h" 36 38 #include "proc_entry.h" 39 + #include "bsd_ioctl.h" 37 40 #include "servers/mach_host.h" 41 + #include "servers/thread_act.h" 38 42 #include "primitives/semaphore.h" 39 43 40 44 MODULE_LICENSE("GPL"); ··· 67 71 [sc(NR_semaphore_wait_signal_trap)] = (trap_handler) semaphore_wait_signal_trap, 68 72 [sc(NR_semaphore_timedwait_signal_trap)] = (trap_handler) semaphore_timedwait_trap, 69 73 [sc(NR_semaphore_timedwait_trap)] = (trap_handler) semaphore_timedwait_signal_trap, 74 + [sc(NR_bsd_ioctl_trap)] = (trap_handler) bsd_ioctl_trap, 75 + [sc(NR_thread_self_trap)] = (trap_handler) mach_thread_self_trap, 70 76 }; 71 77 #undef sc 72 78 ··· 118 124 119 125 int mach_dev_open(struct inode* ino, struct file* file) 120 126 { 121 - darling_mach_port_t* port; 127 + darling_mach_port_t* task_port; 128 + darling_mach_port_t* thread_port; 129 + mach_task_t* task; 130 + 131 + if (ipc_port_new(&task_port) != KERN_SUCCESS) 132 + return -ENOMEM; 122 133 123 - if (ipc_port_new(&port) != KERN_SUCCESS) 134 + if (ipc_port_new(&thread_port) != KERN_SUCCESS) 135 + { 136 + ipc_port_put(task_port); 124 137 return -ENOMEM; 138 + } 125 139 126 - ipc_port_make_task(port, current->pid); 127 - file->private_data = port; 140 + task = ipc_port_make_task(task_port, current->pid); 141 + file->private_data = task_port; 128 142 129 - darling_task_set_current(ipc_port_get_task(port)); 143 + ipc_port_make_thread(thread_port); 144 + 145 + darling_task_set_current(ipc_port_get_task(task_port)); 146 + darling_task_register_thread(task, thread_port); 130 147 131 148 return 0; 132 149 } ··· 258 275 ipc_port_lock(task->task_self); 259 276 260 277 ret = ipc_space_make_send(&task->namespace, task->task_self, false, &name); 278 + 279 + ipc_port_unlock(task->task_self); 280 + 281 + if (ret == KERN_SUCCESS) 282 + return name; 283 + else 284 + return 0; 285 + } 286 + 287 + mach_port_name_t mach_thread_self_trap(mach_task_t* task) 288 + { 289 + mach_port_name_t name; 290 + kern_return_t ret; 291 + darling_mach_port_t* thread_port; 292 + 293 + ipc_port_lock(task->task_self); 294 + 295 + thread_port = darling_task_lookup_thread(task, current->pid); 296 + 297 + if (thread_port != NULL) 298 + ret = ipc_space_make_send(&task->namespace, thread_port, false, &name); 299 + else 300 + ret = KERN_FAILURE; 261 301 262 302 ipc_port_unlock(task->task_self); 263 303 ··· 650 690 mach_semaphore_signal(right_signal->port); 651 691 652 692 return ret; 693 + } 694 + 695 + long bsd_ioctl_trap(mach_task_t* task, struct bsd_ioctl_args* in_args) 696 + { 697 + struct bsd_ioctl_args args; 698 + struct file* f; 699 + char name[60]; 700 + long retval = 0; 701 + 702 + if (copy_from_user(&args, in_args, sizeof(args))) 703 + return -EFAULT; 704 + 705 + f = fget(args.fd); 706 + if (f == NULL) 707 + return -EBADF; 708 + 709 + if (f->f_op->unlocked_ioctl == NULL) 710 + { 711 + fput(f); 712 + return -ENOTTY; 713 + } 714 + 715 + if (d_path(&f->f_path, name, sizeof(name)) == NULL) 716 + { 717 + fput(f); 718 + return -EBADF; 719 + } 720 + 721 + // Perform ioctl translation based on name 722 + if (strncmp(name, "socket:", 7) == 0) 723 + bsd_ioctl_xlate_socket(&args); 724 + else if (strncmp(name, "/dev/tty", 8) == 0) 725 + bsd_ioctl_xlate_tty(&args); 726 + else if (strncmp(name, "/dev/pts", 8) == 0) 727 + bsd_ioctl_xlate_pts(&args); 728 + 729 + retval = f->f_op->unlocked_ioctl(f, args.request, args.arg); 730 + 731 + fput(f); 732 + 733 + return retval; 653 734 } 654 735 655 736 module_init(mach_init);
+2
lkm/traps.h
··· 36 36 kern_return_t _kernelrpc_mach_port_destroy_trap(mach_task_t* task, 37 37 struct mach_port_destroy_args* args); 38 38 mach_port_name_t mach_task_self_trap(mach_task_t* task); 39 + mach_port_name_t mach_thread_self_trap(mach_task_t* task); 39 40 mach_port_name_t mach_host_self_trap(mach_task_t* task); 40 41 kern_return_t _kernelrpc_mach_port_allocate_trap(mach_task_t* task, 41 42 struct mach_port_allocate_args* args); ··· 54 55 struct semaphore_timedwait_args* args); 55 56 kern_return_t semaphore_timedwait_signal_trap(mach_task_t* task, 56 57 struct semaphore_timedwait_signal_args* args); 58 + long bsd_ioctl_trap(mach_task_t* task, struct bsd_ioctl_args* fd); 57 59 58 60 // Internal 59 61 kern_return_t _kernelrpc_mach_port_destroy(mach_task_t* task,