diff options
author | root <root@(null).(none)> | 2009-05-03 17:20:00 +0200 |
---|---|---|
committer | root <root@(null).(none)> | 2009-05-03 17:20:00 +0200 |
commit | e0faf22f31c48fb27b43c1825897d26e58feafc4 (patch) | |
tree | 65a09372b31e08a3a865bd0a88cd2718bafcd643 /boot.backup1/ourmach_hostServer.c |
This is my initial working version.
There is a bug in boot in this version: subhurd sometimes cannot boot.
Diffstat (limited to 'boot.backup1/ourmach_hostServer.c')
-rw-r--r-- | boot.backup1/ourmach_hostServer.c | 2596 |
1 files changed, 2596 insertions, 0 deletions
diff --git a/boot.backup1/ourmach_hostServer.c b/boot.backup1/ourmach_hostServer.c new file mode 100644 index 00000000..4ede0429 --- /dev/null +++ b/boot.backup1/ourmach_hostServer.c @@ -0,0 +1,2596 @@ +/* Module mach_host */ + +#ifndef _GNU_SOURCE +#define _GNU_SOURCE 1 +#endif + +#define EXPORT_BOOLEAN +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/mig_support.h> + +#ifndef mig_internal +#define mig_internal static +#endif + +#ifndef mig_external +#define mig_external +#endif + +#ifndef TypeCheck +#define TypeCheck 1 +#endif + +#ifndef UseExternRCSId +#define UseExternRCSId 1 +#endif + +#define BAD_TYPECHECK(type, check) ({\ + union { mach_msg_type_t t; unsigned32_t w; } _t, _c;\ + _t.t = *(type); _c.t = *(check); _t.w != _c.w; }) +#define msgh_request_port msgh_local_port +#define MACH_MSGH_BITS_REQUEST(bits) MACH_MSGH_BITS_LOCAL(bits) +#define msgh_reply_port msgh_remote_port +#define MACH_MSGH_BITS_REPLY(bits) MACH_MSGH_BITS_REMOTE(bits) + +#include <mach/std_types.h> +#include <mach/mach_types.h> + +/* Routine host_processors */ +mig_internal void _Xhost_processors + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + mach_msg_type_long_t processor_listType; + processor_array_t processor_list; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_host_processors + (mach_port_t host_priv, processor_array_t *processor_list, mach_msg_type_number_t *processor_listCnt); + + auto const mach_msg_type_long_t processor_listType = { + { + /* msgt_name = */ 0, + /* msgt_size = */ 0, + /* msgt_number = */ 0, + /* msgt_inline = */ FALSE, + /* msgt_longform = */ TRUE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }, + /* msgtl_name = */ 19, + /* msgtl_size = */ 32, + /* msgtl_number = */ 0, + }; + + mach_msg_type_number_t processor_listCnt; + +#if TypeCheck + if ((In0P->Head.msgh_size != 24) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_host_processors(In0P->Head.msgh_request_port, &OutP->processor_list, &processor_listCnt); + if (OutP->RetCode != KERN_SUCCESS) + return; + + OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; + OutP->Head.msgh_size = 48; + + OutP->processor_listType = processor_listType; + + OutP->processor_listType.msgtl_number = processor_listCnt; +} + +/* Routine yyy_host_info */ +mig_internal void _Xyyy_host_info + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t flavorType; + int flavor; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + mach_msg_type_long_t host_info_outType; + natural_t host_info_out[1024]; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_yyy_host_info + (mach_port_t host, int flavor, host_info_t host_info_out, mach_msg_type_number_t *host_info_outCnt); + + auto const mach_msg_type_t flavorCheck = { + /* msgt_name = */ 2, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + auto const mach_msg_type_long_t host_info_outType = { + { + /* msgt_name = */ 0, + /* msgt_size = */ 0, + /* msgt_number = */ 0, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ TRUE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }, + /* msgtl_name = */ 2, + /* msgtl_size = */ 32, + /* msgtl_number = */ 1024, + }; + + mach_msg_type_number_t host_info_outCnt; + +#if TypeCheck + if ((In0P->Head.msgh_size != 32) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->flavorType, &flavorCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + host_info_outCnt = 1024; + + OutP->RetCode = S_yyy_host_info(In0P->Head.msgh_request_port, In0P->flavor, OutP->host_info_out, &host_info_outCnt); + if (OutP->RetCode != KERN_SUCCESS) + return; + + OutP->host_info_outType = host_info_outType; + + OutP->host_info_outType.msgtl_number = host_info_outCnt; + OutP->Head.msgh_size = 44 + (4 * host_info_outCnt); +} + +/* Routine yyy_processor_info */ +mig_internal void _Xyyy_processor_info + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t flavorType; + int flavor; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + mach_msg_type_t hostType; + mach_port_t host; + mach_msg_type_long_t processor_info_outType; + natural_t processor_info_out[1024]; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_yyy_processor_info + (mach_port_t processor, int flavor, mach_port_t *host, processor_info_t processor_info_out, mach_msg_type_number_t *processor_info_outCnt); + + auto const mach_msg_type_t flavorCheck = { + /* msgt_name = */ 2, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + auto const mach_msg_type_t hostType = { + /* msgt_name = */ 19, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + auto const mach_msg_type_long_t processor_info_outType = { + { + /* msgt_name = */ 0, + /* msgt_size = */ 0, + /* msgt_number = */ 0, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ TRUE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }, + /* msgtl_name = */ 2, + /* msgtl_size = */ 32, + /* msgtl_number = */ 1024, + }; + + mach_msg_type_number_t processor_info_outCnt; + +#if TypeCheck + if ((In0P->Head.msgh_size != 32) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->flavorType, &flavorCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + processor_info_outCnt = 1024; + + OutP->RetCode = S_yyy_processor_info(In0P->Head.msgh_request_port, In0P->flavor, &OutP->host, OutP->processor_info_out, &processor_info_outCnt); + if (OutP->RetCode != KERN_SUCCESS) + return; + + OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; + + OutP->hostType = hostType; + + OutP->processor_info_outType = processor_info_outType; + + OutP->processor_info_outType.msgtl_number = processor_info_outCnt; + OutP->Head.msgh_size = 52 + (4 * processor_info_outCnt); +} + +/* Routine processor_start */ +mig_internal void _Xprocessor_start + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_processor_start + (mach_port_t processor); + +#if TypeCheck + if ((In0P->Head.msgh_size != 24) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_processor_start(In0P->Head.msgh_request_port); +} + +/* Routine processor_exit */ +mig_internal void _Xprocessor_exit + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_processor_exit + (mach_port_t processor); + +#if TypeCheck + if ((In0P->Head.msgh_size != 24) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_processor_exit(In0P->Head.msgh_request_port); +} + +/* Routine yyy_processor_control */ +mig_internal void _Xyyy_processor_control + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + mach_msg_type_long_t processor_cmdType; + natural_t processor_cmd[1024]; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_yyy_processor_control + (mach_port_t processor, processor_info_t processor_cmd, mach_msg_type_number_t processor_cmdCnt); + + unsigned int msgh_size; + +#if TypeCheck + msgh_size = In0P->Head.msgh_size; + if ((msgh_size < 36) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if ((In0P->processor_cmdType.msgtl_header.msgt_inline != TRUE) || + (In0P->processor_cmdType.msgtl_header.msgt_longform != TRUE) || + (In0P->processor_cmdType.msgtl_name != 2) || + (In0P->processor_cmdType.msgtl_size != 32)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (msgh_size != 36 + (4 * In0P->processor_cmdType.msgtl_number)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_yyy_processor_control(In0P->Head.msgh_request_port, In0P->processor_cmd, In0P->processor_cmdType.msgtl_number); +} + +/* Routine processor_set_default */ +mig_internal void _Xprocessor_set_default + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + mach_msg_type_t default_setType; + mach_port_t default_set; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_processor_set_default + (mach_port_t host, mach_port_t *default_set); + + auto const mach_msg_type_t default_setType = { + /* msgt_name = */ 19, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + +#if TypeCheck + if ((In0P->Head.msgh_size != 24) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_processor_set_default(In0P->Head.msgh_request_port, &OutP->default_set); + if (OutP->RetCode != KERN_SUCCESS) + return; + + OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; + OutP->Head.msgh_size = 40; + + OutP->default_setType = default_setType; +} + +/* Routine xxx_processor_set_default_priv */ +mig_internal void _Xxxx_processor_set_default_priv + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + mach_msg_type_t default_setType; + mach_port_t default_set; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_xxx_processor_set_default_priv + (mach_port_t host, mach_port_t *default_set); + + auto const mach_msg_type_t default_setType = { + /* msgt_name = */ 19, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + +#if TypeCheck + if ((In0P->Head.msgh_size != 24) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_xxx_processor_set_default_priv(In0P->Head.msgh_request_port, &OutP->default_set); + if (OutP->RetCode != KERN_SUCCESS) + return; + + OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; + OutP->Head.msgh_size = 40; + + OutP->default_setType = default_setType; +} + +/* Routine processor_set_create */ +mig_internal void _Xprocessor_set_create + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + mach_msg_type_t new_setType; + mach_port_t new_set; + mach_msg_type_t new_nameType; + mach_port_t new_name; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_processor_set_create + (mach_port_t host, mach_port_t *new_set, mach_port_t *new_name); + + auto const mach_msg_type_t new_setType = { + /* msgt_name = */ 19, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + auto const mach_msg_type_t new_nameType = { + /* msgt_name = */ 19, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + +#if TypeCheck + if ((In0P->Head.msgh_size != 24) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_processor_set_create(In0P->Head.msgh_request_port, &OutP->new_set, &OutP->new_name); + if (OutP->RetCode != KERN_SUCCESS) + return; + + OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; + OutP->Head.msgh_size = 48; + + OutP->new_setType = new_setType; + + OutP->new_nameType = new_nameType; +} + +/* Routine processor_set_destroy */ +mig_internal void _Xprocessor_set_destroy + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_processor_set_destroy + (mach_port_t set); + +#if TypeCheck + if ((In0P->Head.msgh_size != 24) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_processor_set_destroy(In0P->Head.msgh_request_port); +} + +/* Routine yyy_processor_set_info */ +mig_internal void _Xyyy_processor_set_info + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t flavorType; + int flavor; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + mach_msg_type_t hostType; + mach_port_t host; + mach_msg_type_long_t info_outType; + natural_t info_out[1024]; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_yyy_processor_set_info + (mach_port_t set_name, int flavor, mach_port_t *host, processor_set_info_t info_out, mach_msg_type_number_t *info_outCnt); + + auto const mach_msg_type_t flavorCheck = { + /* msgt_name = */ 2, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + auto const mach_msg_type_t hostType = { + /* msgt_name = */ 19, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + auto const mach_msg_type_long_t info_outType = { + { + /* msgt_name = */ 0, + /* msgt_size = */ 0, + /* msgt_number = */ 0, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ TRUE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }, + /* msgtl_name = */ 2, + /* msgtl_size = */ 32, + /* msgtl_number = */ 1024, + }; + + mach_msg_type_number_t info_outCnt; + +#if TypeCheck + if ((In0P->Head.msgh_size != 32) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->flavorType, &flavorCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + info_outCnt = 1024; + + OutP->RetCode = S_yyy_processor_set_info(In0P->Head.msgh_request_port, In0P->flavor, &OutP->host, OutP->info_out, &info_outCnt); + if (OutP->RetCode != KERN_SUCCESS) + return; + + OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; + + OutP->hostType = hostType; + + OutP->info_outType = info_outType; + + OutP->info_outType.msgtl_number = info_outCnt; + OutP->Head.msgh_size = 52 + (4 * info_outCnt); +} + +/* Routine processor_assign */ +mig_internal void _Xprocessor_assign + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t new_setType; + mach_port_t new_set; + mach_msg_type_t waitType; + boolean_t wait; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_processor_assign + (mach_port_t processor, mach_port_t new_set, boolean_t wait); + + auto const mach_msg_type_t new_setCheck = { + /* msgt_name = */ 17, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + auto const mach_msg_type_t waitCheck = { + /* msgt_name = */ 0, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + +#if TypeCheck + if ((In0P->Head.msgh_size != 40) || + !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->new_setType, &new_setCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->waitType, &waitCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_processor_assign(In0P->Head.msgh_request_port, In0P->new_set, In0P->wait); +} + +/* Routine processor_get_assignment */ +mig_internal void _Xprocessor_get_assignment + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + mach_msg_type_t assigned_setType; + mach_port_t assigned_set; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_processor_get_assignment + (mach_port_t processor, mach_port_t *assigned_set); + + auto const mach_msg_type_t assigned_setType = { + /* msgt_name = */ 19, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + +#if TypeCheck + if ((In0P->Head.msgh_size != 24) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_processor_get_assignment(In0P->Head.msgh_request_port, &OutP->assigned_set); + if (OutP->RetCode != KERN_SUCCESS) + return; + + OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; + OutP->Head.msgh_size = 40; + + OutP->assigned_setType = assigned_setType; +} + +/* Routine thread_assign */ +mig_internal void _Xthread_assign + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t new_setType; + mach_port_t new_set; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_thread_assign + (mach_port_t thread, mach_port_t new_set); + + auto const mach_msg_type_t new_setCheck = { + /* msgt_name = */ 17, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + +#if TypeCheck + if ((In0P->Head.msgh_size != 32) || + !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->new_setType, &new_setCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_thread_assign(In0P->Head.msgh_request_port, In0P->new_set); +} + +/* Routine thread_assign_default */ +mig_internal void _Xthread_assign_default + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_thread_assign_default + (mach_port_t thread); + +#if TypeCheck + if ((In0P->Head.msgh_size != 24) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_thread_assign_default(In0P->Head.msgh_request_port); +} + +/* Routine thread_get_assignment */ +mig_internal void _Xthread_get_assignment + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + mach_msg_type_t assigned_setType; + mach_port_t assigned_set; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_thread_get_assignment + (mach_port_t thread, mach_port_t *assigned_set); + + auto const mach_msg_type_t assigned_setType = { + /* msgt_name = */ 19, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + +#if TypeCheck + if ((In0P->Head.msgh_size != 24) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_thread_get_assignment(In0P->Head.msgh_request_port, &OutP->assigned_set); + if (OutP->RetCode != KERN_SUCCESS) + return; + + OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; + OutP->Head.msgh_size = 40; + + OutP->assigned_setType = assigned_setType; +} + +/* Routine task_assign */ +mig_internal void _Xtask_assign + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t new_setType; + mach_port_t new_set; + mach_msg_type_t assign_threadsType; + boolean_t assign_threads; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_task_assign + (mach_port_t task, mach_port_t new_set, boolean_t assign_threads); + + auto const mach_msg_type_t new_setCheck = { + /* msgt_name = */ 17, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + auto const mach_msg_type_t assign_threadsCheck = { + /* msgt_name = */ 0, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + +#if TypeCheck + if ((In0P->Head.msgh_size != 40) || + !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->new_setType, &new_setCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->assign_threadsType, &assign_threadsCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_task_assign(In0P->Head.msgh_request_port, In0P->new_set, In0P->assign_threads); +} + +/* Routine task_assign_default */ +mig_internal void _Xtask_assign_default + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t assign_threadsType; + boolean_t assign_threads; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_task_assign_default + (mach_port_t task, boolean_t assign_threads); + + auto const mach_msg_type_t assign_threadsCheck = { + /* msgt_name = */ 0, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + +#if TypeCheck + if ((In0P->Head.msgh_size != 32) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->assign_threadsType, &assign_threadsCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_task_assign_default(In0P->Head.msgh_request_port, In0P->assign_threads); +} + +/* Routine task_get_assignment */ +mig_internal void _Xtask_get_assignment + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + mach_msg_type_t assigned_setType; + mach_port_t assigned_set; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_task_get_assignment + (mach_port_t task, mach_port_t *assigned_set); + + auto const mach_msg_type_t assigned_setType = { + /* msgt_name = */ 19, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + +#if TypeCheck + if ((In0P->Head.msgh_size != 24) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_task_get_assignment(In0P->Head.msgh_request_port, &OutP->assigned_set); + if (OutP->RetCode != KERN_SUCCESS) + return; + + OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; + OutP->Head.msgh_size = 40; + + OutP->assigned_setType = assigned_setType; +} + +/* Routine host_kernel_version */ +mig_internal void _Xhost_kernel_version + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + mach_msg_type_long_t kernel_versionType; + kernel_version_t kernel_version; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_host_kernel_version + (mach_port_t host, kernel_version_t kernel_version); + + auto const mach_msg_type_long_t kernel_versionType = { + { + /* msgt_name = */ 0, + /* msgt_size = */ 0, + /* msgt_number = */ 0, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ TRUE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }, + /* msgtl_name = */ 12, + /* msgtl_size = */ 4096, + /* msgtl_number = */ 1, + }; + +#if TypeCheck + if ((In0P->Head.msgh_size != 24) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_host_kernel_version(In0P->Head.msgh_request_port, OutP->kernel_version); + if (OutP->RetCode != KERN_SUCCESS) + return; + + OutP->Head.msgh_size = 556; + + OutP->kernel_versionType = kernel_versionType; +} + +/* Routine thread_priority */ +mig_internal void _Xthread_priority + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t priorityType; + int priority; + mach_msg_type_t set_maxType; + boolean_t set_max; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_thread_priority + (mach_port_t thread, int priority, boolean_t set_max); + + auto const mach_msg_type_t priorityCheck = { + /* msgt_name = */ 2, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + auto const mach_msg_type_t set_maxCheck = { + /* msgt_name = */ 0, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + +#if TypeCheck + if ((In0P->Head.msgh_size != 40) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->priorityType, &priorityCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->set_maxType, &set_maxCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_thread_priority(In0P->Head.msgh_request_port, In0P->priority, In0P->set_max); +} + +/* Routine thread_max_priority */ +mig_internal void _Xthread_max_priority + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t processor_setType; + mach_port_t processor_set; + mach_msg_type_t max_priorityType; + int max_priority; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_thread_max_priority + (mach_port_t thread, mach_port_t processor_set, int max_priority); + + auto const mach_msg_type_t processor_setCheck = { + /* msgt_name = */ 17, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + auto const mach_msg_type_t max_priorityCheck = { + /* msgt_name = */ 2, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + +#if TypeCheck + if ((In0P->Head.msgh_size != 40) || + !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->processor_setType, &processor_setCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->max_priorityType, &max_priorityCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_thread_max_priority(In0P->Head.msgh_request_port, In0P->processor_set, In0P->max_priority); +} + +/* Routine task_priority */ +mig_internal void _Xtask_priority + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t priorityType; + int priority; + mach_msg_type_t change_threadsType; + boolean_t change_threads; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_task_priority + (mach_port_t task, int priority, boolean_t change_threads); + + auto const mach_msg_type_t priorityCheck = { + /* msgt_name = */ 2, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + auto const mach_msg_type_t change_threadsCheck = { + /* msgt_name = */ 0, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + +#if TypeCheck + if ((In0P->Head.msgh_size != 40) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->priorityType, &priorityCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->change_threadsType, &change_threadsCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_task_priority(In0P->Head.msgh_request_port, In0P->priority, In0P->change_threads); +} + +/* Routine processor_set_max_priority */ +mig_internal void _Xprocessor_set_max_priority + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t max_priorityType; + int max_priority; + mach_msg_type_t change_threadsType; + boolean_t change_threads; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_processor_set_max_priority + (mach_port_t processor_set, int max_priority, boolean_t change_threads); + + auto const mach_msg_type_t max_priorityCheck = { + /* msgt_name = */ 2, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + auto const mach_msg_type_t change_threadsCheck = { + /* msgt_name = */ 0, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + +#if TypeCheck + if ((In0P->Head.msgh_size != 40) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->max_priorityType, &max_priorityCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->change_threadsType, &change_threadsCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_processor_set_max_priority(In0P->Head.msgh_request_port, In0P->max_priority, In0P->change_threads); +} + +/* Routine thread_policy */ +mig_internal void _Xthread_policy + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t policyType; + int policy; + mach_msg_type_t dataType; + int data; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_thread_policy + (mach_port_t thread, int policy, int data); + + auto const mach_msg_type_t policyCheck = { + /* msgt_name = */ 2, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + auto const mach_msg_type_t dataCheck = { + /* msgt_name = */ 2, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + +#if TypeCheck + if ((In0P->Head.msgh_size != 40) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->policyType, &policyCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->dataType, &dataCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_thread_policy(In0P->Head.msgh_request_port, In0P->policy, In0P->data); +} + +/* Routine processor_set_policy_enable */ +mig_internal void _Xprocessor_set_policy_enable + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t policyType; + int policy; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_processor_set_policy_enable + (mach_port_t processor_set, int policy); + + auto const mach_msg_type_t policyCheck = { + /* msgt_name = */ 2, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + +#if TypeCheck + if ((In0P->Head.msgh_size != 32) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->policyType, &policyCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_processor_set_policy_enable(In0P->Head.msgh_request_port, In0P->policy); +} + +/* Routine processor_set_policy_disable */ +mig_internal void _Xprocessor_set_policy_disable + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t policyType; + int policy; + mach_msg_type_t change_threadsType; + boolean_t change_threads; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_processor_set_policy_disable + (mach_port_t processor_set, int policy, boolean_t change_threads); + + auto const mach_msg_type_t policyCheck = { + /* msgt_name = */ 2, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + auto const mach_msg_type_t change_threadsCheck = { + /* msgt_name = */ 0, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + +#if TypeCheck + if ((In0P->Head.msgh_size != 40) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->policyType, &policyCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->change_threadsType, &change_threadsCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_processor_set_policy_disable(In0P->Head.msgh_request_port, In0P->policy, In0P->change_threads); +} + +/* Routine processor_set_tasks */ +mig_internal void _Xprocessor_set_tasks + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + mach_msg_type_long_t task_listType; + task_array_t task_list; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_processor_set_tasks + (mach_port_t processor_set, task_array_t *task_list, mach_msg_type_number_t *task_listCnt); + + auto const mach_msg_type_long_t task_listType = { + { + /* msgt_name = */ 0, + /* msgt_size = */ 0, + /* msgt_number = */ 0, + /* msgt_inline = */ FALSE, + /* msgt_longform = */ TRUE, + /* msgt_deallocate = */ TRUE, + /* msgt_unused = */ 0 + }, + /* msgtl_name = */ 19, + /* msgtl_size = */ 32, + /* msgtl_number = */ 0, + }; + + mach_msg_type_number_t task_listCnt; + +#if TypeCheck + if ((In0P->Head.msgh_size != 24) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_processor_set_tasks(In0P->Head.msgh_request_port, &OutP->task_list, &task_listCnt); + if (OutP->RetCode != KERN_SUCCESS) + return; + + OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; + OutP->Head.msgh_size = 48; + + OutP->task_listType = task_listType; + + OutP->task_listType.msgtl_number = task_listCnt; +} + +/* Routine processor_set_threads */ +mig_internal void _Xprocessor_set_threads + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + mach_msg_type_long_t thread_listType; + thread_array_t thread_list; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_processor_set_threads + (mach_port_t processor_set, thread_array_t *thread_list, mach_msg_type_number_t *thread_listCnt); + + auto const mach_msg_type_long_t thread_listType = { + { + /* msgt_name = */ 0, + /* msgt_size = */ 0, + /* msgt_number = */ 0, + /* msgt_inline = */ FALSE, + /* msgt_longform = */ TRUE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }, + /* msgtl_name = */ 19, + /* msgtl_size = */ 32, + /* msgtl_number = */ 0, + }; + + mach_msg_type_number_t thread_listCnt; + +#if TypeCheck + if ((In0P->Head.msgh_size != 24) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_processor_set_threads(In0P->Head.msgh_request_port, &OutP->thread_list, &thread_listCnt); + if (OutP->RetCode != KERN_SUCCESS) + return; + + OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; + OutP->Head.msgh_size = 48; + + OutP->thread_listType = thread_listType; + + OutP->thread_listType.msgtl_number = thread_listCnt; +} + +/* Routine host_processor_sets */ +mig_internal void _Xhost_processor_sets + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + mach_msg_type_long_t processor_setsType; + processor_set_name_array_t processor_sets; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_host_processor_sets + (mach_port_t host, processor_set_name_array_t *processor_sets, mach_msg_type_number_t *processor_setsCnt); + + auto const mach_msg_type_long_t processor_setsType = { + { + /* msgt_name = */ 0, + /* msgt_size = */ 0, + /* msgt_number = */ 0, + /* msgt_inline = */ FALSE, + /* msgt_longform = */ TRUE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }, + /* msgtl_name = */ 19, + /* msgtl_size = */ 32, + /* msgtl_number = */ 0, + }; + + mach_msg_type_number_t processor_setsCnt; + +#if TypeCheck + if ((In0P->Head.msgh_size != 24) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_host_processor_sets(In0P->Head.msgh_request_port, &OutP->processor_sets, &processor_setsCnt); + if (OutP->RetCode != KERN_SUCCESS) + return; + + OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; + OutP->Head.msgh_size = 48; + + OutP->processor_setsType = processor_setsType; + + OutP->processor_setsType.msgtl_number = processor_setsCnt; +} + +/* Routine host_processor_set_priv */ +mig_internal void _Xhost_processor_set_priv + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t set_nameType; + mach_port_t set_name; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + mach_msg_type_t setType; + mach_port_t set; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_host_processor_set_priv + (mach_port_t host_priv, mach_port_t set_name, mach_port_t *set, mach_msg_type_name_t *setPoly); + + boolean_t msgh_simple; + auto const mach_msg_type_t set_nameCheck = { + /* msgt_name = */ 17, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + auto const mach_msg_type_t setType = { + /* msgt_name = */ -1, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + mach_msg_type_name_t setPoly; + +#if TypeCheck + if ((In0P->Head.msgh_size != 32) || + !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->set_nameType, &set_nameCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_host_processor_set_priv(In0P->Head.msgh_request_port, In0P->set_name, &OutP->set, &setPoly); + if (OutP->RetCode != KERN_SUCCESS) + return; + + msgh_simple = TRUE; + OutP->Head.msgh_size = 40; + + OutP->setType = setType; + + if (MACH_MSG_TYPE_PORT_ANY(setPoly)) + msgh_simple = FALSE; + + OutP->setType.msgt_name = setPoly; + + if (!msgh_simple) + OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; +} + +/* Routine thread_depress_abort */ +mig_internal void _Xthread_depress_abort + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_thread_depress_abort + (mach_port_t thread); + +#if TypeCheck + if ((In0P->Head.msgh_size != 24) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_thread_depress_abort(In0P->Head.msgh_request_port); +} + +/* Routine host_set_time */ +mig_internal void _Xhost_set_time + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t new_timeType; + time_value_t new_time; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_host_set_time + (mach_port_t host_priv, time_value_t new_time); + + auto const mach_msg_type_t new_timeCheck = { + /* msgt_name = */ 2, + /* msgt_size = */ 32, + /* msgt_number = */ 2, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + +#if TypeCheck + if ((In0P->Head.msgh_size != 36) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->new_timeType, &new_timeCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_host_set_time(In0P->Head.msgh_request_port, In0P->new_time); +} + +/* Routine host_adjust_time */ +mig_internal void _Xhost_adjust_time + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t new_adjustmentType; + time_value_t new_adjustment; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + mach_msg_type_t old_adjustmentType; + time_value_t old_adjustment; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_host_adjust_time + (mach_port_t host_priv, time_value_t new_adjustment, time_value_t *old_adjustment); + + auto const mach_msg_type_t new_adjustmentCheck = { + /* msgt_name = */ 2, + /* msgt_size = */ 32, + /* msgt_number = */ 2, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + auto const mach_msg_type_t old_adjustmentType = { + /* msgt_name = */ 2, + /* msgt_size = */ 32, + /* msgt_number = */ 2, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + +#if TypeCheck + if ((In0P->Head.msgh_size != 36) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->new_adjustmentType, &new_adjustmentCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_host_adjust_time(In0P->Head.msgh_request_port, In0P->new_adjustment, &OutP->old_adjustment); + if (OutP->RetCode != KERN_SUCCESS) + return; + + OutP->Head.msgh_size = 44; + + OutP->old_adjustmentType = old_adjustmentType; +} + +/* Routine host_get_time */ +mig_internal void _Xhost_get_time + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + mach_msg_type_t current_timeType; + time_value_t current_time; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_host_get_time + (mach_port_t host, time_value_t *current_time); + + auto const mach_msg_type_t current_timeType = { + /* msgt_name = */ 2, + /* msgt_size = */ 32, + /* msgt_number = */ 2, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + +#if TypeCheck + if ((In0P->Head.msgh_size != 24) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_host_get_time(In0P->Head.msgh_request_port, &OutP->current_time); + if (OutP->RetCode != KERN_SUCCESS) + return; + + OutP->Head.msgh_size = 44; + + OutP->current_timeType = current_timeType; +} + +/* Routine host_reboot */ +mig_internal void _Xhost_reboot + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t optionsType; + int options; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_host_reboot + (mach_port_t host_priv, int options); + + auto const mach_msg_type_t optionsCheck = { + /* msgt_name = */ 2, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + +#if TypeCheck + if ((In0P->Head.msgh_size != 32) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->optionsType, &optionsCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_host_reboot(In0P->Head.msgh_request_port, In0P->options); +} + +/* Routine vm_wire */ +mig_internal void _Xvm_wire + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t taskType; + mach_port_t task; + mach_msg_type_t addressType; + vm_address_t address; + mach_msg_type_t sizeType; + vm_size_t size; + mach_msg_type_t accessType; + vm_prot_t access; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_vm_wire + (mach_port_t host_priv, mach_port_t task, vm_address_t address, vm_size_t size, vm_prot_t access); + + auto const mach_msg_type_t taskCheck = { + /* msgt_name = */ 17, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + auto const mach_msg_type_t addressCheck = { + /* msgt_name = */ 2, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + auto const mach_msg_type_t sizeCheck = { + /* msgt_name = */ 2, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + auto const mach_msg_type_t accessCheck = { + /* msgt_name = */ 2, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + +#if TypeCheck + if ((In0P->Head.msgh_size != 56) || + !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->taskType, &taskCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->addressType, &addressCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->sizeType, &sizeCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->accessType, &accessCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_vm_wire(In0P->Head.msgh_request_port, In0P->task, In0P->address, In0P->size, In0P->access); +} + +/* Routine thread_wire */ +mig_internal void _Xthread_wire + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t threadType; + mach_port_t thread; + mach_msg_type_t wiredType; + boolean_t wired; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_thread_wire + (mach_port_t host_priv, mach_port_t thread, boolean_t wired); + + auto const mach_msg_type_t threadCheck = { + /* msgt_name = */ 17, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + auto const mach_msg_type_t wiredCheck = { + /* msgt_name = */ 0, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + +#if TypeCheck + if ((In0P->Head.msgh_size != 40) || + !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->threadType, &threadCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->wiredType, &wiredCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_thread_wire(In0P->Head.msgh_request_port, In0P->thread, In0P->wired); +} + +/* Routine host_info */ +mig_internal void _Xhost_info + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t flavorType; + int flavor; + mach_msg_type_t host_info_outCntType; + mach_msg_type_number_t host_info_outCnt; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + mach_msg_type_t host_info_outType; + natural_t host_info_out[1024]; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_host_info + (mach_port_t host, int flavor, host_info_t host_info_out, mach_msg_type_number_t *host_info_outCnt); + + auto const mach_msg_type_t flavorCheck = { + /* msgt_name = */ 2, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + auto const mach_msg_type_t host_info_outCntCheck = { + /* msgt_name = */ MACH_MSG_TYPE_INTEGER_32, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + auto const mach_msg_type_t host_info_outType = { + /* msgt_name = */ 2, + /* msgt_size = */ 32, + /* msgt_number = */ 1024, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + mach_msg_type_number_t host_info_outCnt; + +#if TypeCheck + if ((In0P->Head.msgh_size != 40) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->flavorType, &flavorCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->host_info_outCntType, &host_info_outCntCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + host_info_outCnt = 1024; + if (In0P->host_info_outCnt < host_info_outCnt) + host_info_outCnt = In0P->host_info_outCnt; + + OutP->RetCode = S_host_info(In0P->Head.msgh_request_port, In0P->flavor, OutP->host_info_out, &host_info_outCnt); + if (OutP->RetCode != KERN_SUCCESS) + return; + + OutP->host_info_outType = host_info_outType; + + OutP->host_info_outType.msgt_number = host_info_outCnt; + OutP->Head.msgh_size = 36 + (4 * host_info_outCnt); +} + +/* Routine processor_info */ +mig_internal void _Xprocessor_info + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t flavorType; + int flavor; + mach_msg_type_t processor_info_outCntType; + mach_msg_type_number_t processor_info_outCnt; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + mach_msg_type_t hostType; + mach_port_t host; + mach_msg_type_t processor_info_outType; + natural_t processor_info_out[1024]; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_processor_info + (mach_port_t processor, int flavor, mach_port_t *host, processor_info_t processor_info_out, mach_msg_type_number_t *processor_info_outCnt); + + auto const mach_msg_type_t flavorCheck = { + /* msgt_name = */ 2, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + auto const mach_msg_type_t processor_info_outCntCheck = { + /* msgt_name = */ MACH_MSG_TYPE_INTEGER_32, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + auto const mach_msg_type_t hostType = { + /* msgt_name = */ 19, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + auto const mach_msg_type_t processor_info_outType = { + /* msgt_name = */ 2, + /* msgt_size = */ 32, + /* msgt_number = */ 1024, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + mach_msg_type_number_t processor_info_outCnt; + +#if TypeCheck + if ((In0P->Head.msgh_size != 40) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->flavorType, &flavorCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->processor_info_outCntType, &processor_info_outCntCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + processor_info_outCnt = 1024; + if (In0P->processor_info_outCnt < processor_info_outCnt) + processor_info_outCnt = In0P->processor_info_outCnt; + + OutP->RetCode = S_processor_info(In0P->Head.msgh_request_port, In0P->flavor, &OutP->host, OutP->processor_info_out, &processor_info_outCnt); + if (OutP->RetCode != KERN_SUCCESS) + return; + + OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; + + OutP->hostType = hostType; + + OutP->processor_info_outType = processor_info_outType; + + OutP->processor_info_outType.msgt_number = processor_info_outCnt; + OutP->Head.msgh_size = 44 + (4 * processor_info_outCnt); +} + +/* Routine processor_set_info */ +mig_internal void _Xprocessor_set_info + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t flavorType; + int flavor; + mach_msg_type_t info_outCntType; + mach_msg_type_number_t info_outCnt; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + mach_msg_type_t hostType; + mach_port_t host; + mach_msg_type_t info_outType; + natural_t info_out[1024]; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_processor_set_info + (mach_port_t set_name, int flavor, mach_port_t *host, processor_set_info_t info_out, mach_msg_type_number_t *info_outCnt); + + auto const mach_msg_type_t flavorCheck = { + /* msgt_name = */ 2, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + auto const mach_msg_type_t info_outCntCheck = { + /* msgt_name = */ MACH_MSG_TYPE_INTEGER_32, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + auto const mach_msg_type_t hostType = { + /* msgt_name = */ 19, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + auto const mach_msg_type_t info_outType = { + /* msgt_name = */ 2, + /* msgt_size = */ 32, + /* msgt_number = */ 1024, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + mach_msg_type_number_t info_outCnt; + +#if TypeCheck + if ((In0P->Head.msgh_size != 40) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->flavorType, &flavorCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (BAD_TYPECHECK(&In0P->info_outCntType, &info_outCntCheck)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + info_outCnt = 1024; + if (In0P->info_outCnt < info_outCnt) + info_outCnt = In0P->info_outCnt; + + OutP->RetCode = S_processor_set_info(In0P->Head.msgh_request_port, In0P->flavor, &OutP->host, OutP->info_out, &info_outCnt); + if (OutP->RetCode != KERN_SUCCESS) + return; + + OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; + + OutP->hostType = hostType; + + OutP->info_outType = info_outType; + + OutP->info_outType.msgt_number = info_outCnt; + OutP->Head.msgh_size = 44 + (4 * info_outCnt); +} + +/* Routine processor_control */ +mig_internal void _Xprocessor_control + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t processor_cmdType; + natural_t processor_cmd[1024]; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_processor_control + (mach_port_t processor, processor_info_t processor_cmd, mach_msg_type_number_t processor_cmdCnt); + + unsigned int msgh_size; + +#if TypeCheck + msgh_size = In0P->Head.msgh_size; + if ((msgh_size < 28) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if ((In0P->processor_cmdType.msgt_inline != TRUE) || + (In0P->processor_cmdType.msgt_longform != FALSE) || + (In0P->processor_cmdType.msgt_name != 2) || + (In0P->processor_cmdType.msgt_size != 32)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + +#if TypeCheck + if (msgh_size != 28 + (4 * In0P->processor_cmdType.msgt_number)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_processor_control(In0P->Head.msgh_request_port, In0P->processor_cmd, In0P->processor_cmdType.msgt_number); +} + +/* Routine host_get_boot_info */ +mig_internal void _Xhost_get_boot_info + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + typedef struct { + mach_msg_header_t Head; + } Request; + + typedef struct { + mach_msg_header_t Head; + mach_msg_type_t RetCodeType; + kern_return_t RetCode; + mach_msg_type_long_t boot_infoType; + kernel_boot_info_t boot_info; + } Reply; + + register Request *In0P = (Request *) InHeadP; + register Reply *OutP = (Reply *) OutHeadP; + mig_external kern_return_t S_host_get_boot_info + (mach_port_t host_priv, kernel_boot_info_t boot_info); + + auto const mach_msg_type_long_t boot_infoType = { + { + /* msgt_name = */ 0, + /* msgt_size = */ 0, + /* msgt_number = */ 0, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ TRUE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }, + /* msgtl_name = */ 12, + /* msgtl_size = */ 32768, + /* msgtl_number = */ 1, + }; + +#if TypeCheck + if ((In0P->Head.msgh_size != 24) || + (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) + { OutP->RetCode = MIG_BAD_ARGUMENTS; return; } +#endif /* TypeCheck */ + + OutP->RetCode = S_host_get_boot_info(In0P->Head.msgh_request_port, OutP->boot_info); + if (OutP->RetCode != KERN_SUCCESS) + return; + + OutP->Head.msgh_size = 4140; + + OutP->boot_infoType = boot_infoType; +} + +static mig_routine_t mach_host_server_routines[] = { + _Xhost_processors, + _Xyyy_host_info, + _Xyyy_processor_info, + _Xprocessor_start, + _Xprocessor_exit, + _Xyyy_processor_control, + _Xprocessor_set_default, + _Xxxx_processor_set_default_priv, + _Xprocessor_set_create, + _Xprocessor_set_destroy, + _Xyyy_processor_set_info, + _Xprocessor_assign, + _Xprocessor_get_assignment, + _Xthread_assign, + _Xthread_assign_default, + _Xthread_get_assignment, + _Xtask_assign, + _Xtask_assign_default, + _Xtask_get_assignment, + _Xhost_kernel_version, + _Xthread_priority, + _Xthread_max_priority, + _Xtask_priority, + _Xprocessor_set_max_priority, + _Xthread_policy, + _Xprocessor_set_policy_enable, + _Xprocessor_set_policy_disable, + _Xprocessor_set_tasks, + _Xprocessor_set_threads, + _Xhost_processor_sets, + _Xhost_processor_set_priv, + _Xthread_depress_abort, + _Xhost_set_time, + _Xhost_adjust_time, + _Xhost_get_time, + _Xhost_reboot, + _Xvm_wire, + _Xthread_wire, + _Xhost_info, + _Xprocessor_info, + _Xprocessor_set_info, + _Xprocessor_control, + _Xhost_get_boot_info, +}; + +mig_external boolean_t mach_host_server + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) +{ + register mach_msg_header_t *InP = InHeadP; + register mig_reply_header_t *OutP = (mig_reply_header_t *) OutHeadP; + + auto const mach_msg_type_t RetCodeType = { + /* msgt_name = */ MACH_MSG_TYPE_INTEGER_32, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + register mig_routine_t routine; + + OutP->Head.msgh_bits = MACH_MSGH_BITS(MACH_MSGH_BITS_REPLY(InP->msgh_bits), 0); + OutP->Head.msgh_size = sizeof *OutP; + OutP->Head.msgh_remote_port = InP->msgh_reply_port; + OutP->Head.msgh_local_port = MACH_PORT_NULL; + OutP->Head.msgh_seqno = 0; + OutP->Head.msgh_id = InP->msgh_id + 100; + + OutP->RetCodeType = RetCodeType; + + if ((InP->msgh_id > 2642) || (InP->msgh_id < 2600) || + ((routine = mach_host_server_routines[InP->msgh_id - 2600]) == 0)) { + OutP->RetCode = MIG_BAD_ID; + return FALSE; + } + (*routine) (InP, &OutP->Head); + return TRUE; +} + +mig_external mig_routine_t mach_host_server_routine + (const mach_msg_header_t *InHeadP) +{ + register int msgh_id; + + msgh_id = InHeadP->msgh_id - 2600; + + if ((msgh_id > 42) || (msgh_id < 0)) + return 0; + + return mach_host_server_routines[msgh_id]; +} + |