| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815 |
- /*
- * IDENTIFICATION:
- * stub generated Tue Apr 7 09:10:21 2020
- * with a MiG generated by bootstrap_cmds-116
- * OPTIONS:
- */
- #ifdef __x86_64__
- #define __MIG_check__Reply__mach_exc_subsystem__ 1
- #include "mach_exc.h"
- /* TODO: #include <mach/mach.h> */
- #ifdef __cplusplus
- extern "C" {
- #endif /* __cplusplus */
- extern void mach_msg_destroy(mach_msg_header_t *);
- #ifdef __cplusplus
- }
- #endif /* __cplusplus */
- #ifndef mig_internal
- #define mig_internal static __inline__
- #endif /* mig_internal */
- #ifndef mig_external
- #define mig_external
- #endif /* mig_external */
- #if !defined(__MigTypeCheck) && defined(TypeCheck)
- #define __MigTypeCheck TypeCheck /* Legacy setting */
- #endif /* !defined(__MigTypeCheck) */
- #if !defined(__MigKernelSpecificCode) && defined(_MIG_KERNEL_SPECIFIC_CODE_)
- #define __MigKernelSpecificCode _MIG_KERNEL_SPECIFIC_CODE_ /* Legacy setting */
- #endif /* !defined(__MigKernelSpecificCode) */
- #ifndef LimitCheck
- #define LimitCheck 0
- #endif /* LimitCheck */
- #ifndef min
- #define min(a,b) ( ((a) < (b))? (a): (b) )
- #endif /* min */
- #if !defined(_WALIGN_)
- #define _WALIGN_(x) (((x) + 3) & ~3)
- #endif /* !defined(_WALIGN_) */
- #if !defined(_WALIGNSZ_)
- #define _WALIGNSZ_(x) _WALIGN_(sizeof(x))
- #endif /* !defined(_WALIGNSZ_) */
- #ifndef UseStaticTemplates
- #define UseStaticTemplates 0
- #endif /* UseStaticTemplates */
- #ifndef MIG_SERVER_ROUTINE
- #define MIG_SERVER_ROUTINE
- #endif
- #ifndef __MachMsgErrorWithTimeout
- #define __MachMsgErrorWithTimeout(_R_) { \
- switch (_R_) { \
- case MACH_SEND_INVALID_DATA: \
- case MACH_SEND_INVALID_DEST: \
- case MACH_SEND_INVALID_HEADER: \
- mig_put_reply_port(InP->Head.msgh_reply_port); \
- break; \
- case MACH_SEND_TIMED_OUT: \
- case MACH_RCV_TIMED_OUT: \
- default: \
- mig_dealloc_reply_port(InP->Head.msgh_reply_port); \
- } \
- }
- #endif /* __MachMsgErrorWithTimeout */
- #ifndef __MachMsgErrorWithoutTimeout
- #define __MachMsgErrorWithoutTimeout(_R_) { \
- switch (_R_) { \
- case MACH_SEND_INVALID_DATA: \
- case MACH_SEND_INVALID_DEST: \
- case MACH_SEND_INVALID_HEADER: \
- mig_put_reply_port(InP->Head.msgh_reply_port); \
- break; \
- default: \
- mig_dealloc_reply_port(InP->Head.msgh_reply_port); \
- } \
- }
- #endif /* __MachMsgErrorWithoutTimeout */
- #ifndef __DeclareSendRpc
- #define __DeclareSendRpc(_NUM_, _NAME_)
- #endif /* __DeclareSendRpc */
- #ifndef __BeforeSendRpc
- #define __BeforeSendRpc(_NUM_, _NAME_)
- #endif /* __BeforeSendRpc */
- #ifndef __AfterSendRpc
- #define __AfterSendRpc(_NUM_, _NAME_)
- #endif /* __AfterSendRpc */
- #ifndef __DeclareSendSimple
- #define __DeclareSendSimple(_NUM_, _NAME_)
- #endif /* __DeclareSendSimple */
- #ifndef __BeforeSendSimple
- #define __BeforeSendSimple(_NUM_, _NAME_)
- #endif /* __BeforeSendSimple */
- #ifndef __AfterSendSimple
- #define __AfterSendSimple(_NUM_, _NAME_)
- #endif /* __AfterSendSimple */
- #define msgh_request_port msgh_remote_port
- #define msgh_reply_port msgh_local_port
- #if ( __MigTypeCheck )
- #if __MIG_check__Reply__mach_exc_subsystem__
- #if !defined(__MIG_check__Reply__mach_exception_raise_t__defined)
- #define __MIG_check__Reply__mach_exception_raise_t__defined
- mig_internal kern_return_t __MIG_check__Reply__mach_exception_raise_t(__Reply__mach_exception_raise_t *Out0P)
- {
- typedef __Reply__mach_exception_raise_t __Reply __attribute__((unused));
- if (Out0P->Head.msgh_id != 2505) {
- if (Out0P->Head.msgh_id == MACH_NOTIFY_SEND_ONCE)
- { return MIG_SERVER_DIED; }
- else
- { return MIG_REPLY_MISMATCH; }
- }
- #if __MigTypeCheck
- if ((Out0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
- (Out0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Reply)))
- { return MIG_TYPE_ERROR ; }
- #endif /* __MigTypeCheck */
- #if __MigTypeCheck
- if (Out0P->Head.msgh_request_port != MACH_PORT_NULL) {
- return MIG_TYPE_ERROR;
- }
- #endif /* __MigTypeCheck */
- {
- return Out0P->RetCode;
- }
- }
- #endif /* !defined(__MIG_check__Reply__mach_exception_raise_t__defined) */
- #endif /* __MIG_check__Reply__mach_exc_subsystem__ */
- #endif /* ( __MigTypeCheck ) */
- /* Routine mach_exception_raise */
- mig_external kern_return_t mach_exception_raise
- (
- mach_port_t exception_port,
- mach_port_t thread,
- mach_port_t task,
- exception_type_t exception,
- mach_exception_data_t code,
- mach_msg_type_number_t codeCnt
- )
- {
- #ifdef __MigPackStructs
- #pragma pack(push, 4)
- #endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t thread;
- mach_msg_port_descriptor_t task;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- exception_type_t exception;
- mach_msg_type_number_t codeCnt;
- int64_t code[2];
- } Request __attribute__((unused));
- #ifdef __MigPackStructs
- #pragma pack(pop)
- #endif
- #ifdef __MigPackStructs
- #pragma pack(push, 4)
- #endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- mach_msg_trailer_t trailer;
- } Reply __attribute__((unused));
- #ifdef __MigPackStructs
- #pragma pack(pop)
- #endif
- #ifdef __MigPackStructs
- #pragma pack(push, 4)
- #endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply __attribute__((unused));
- #ifdef __MigPackStructs
- #pragma pack(pop)
- #endif
- /*
- * typedef struct {
- * mach_msg_header_t Head;
- * NDR_record_t NDR;
- * kern_return_t RetCode;
- * } mig_reply_error_t;
- */
- union {
- Request In;
- Reply Out;
- } Mess;
- Request *InP = &Mess.In;
- Reply *Out0P = &Mess.Out;
- mach_msg_return_t msg_result;
- unsigned int msgh_size;
- #ifdef __MIG_check__Reply__mach_exception_raise_t__defined
- kern_return_t check_result;
- #endif /* __MIG_check__Reply__mach_exception_raise_t__defined */
- __DeclareSendRpc(2405, "mach_exception_raise")
- #if UseStaticTemplates
- const static mach_msg_port_descriptor_t threadTemplate = {
- /* name = */ MACH_PORT_NULL,
- /* pad1 = */ 0,
- /* pad2 = */ 0,
- /* disp = */ 19,
- /* type = */ MACH_MSG_PORT_DESCRIPTOR,
- };
- #endif /* UseStaticTemplates */
- #if UseStaticTemplates
- const static mach_msg_port_descriptor_t taskTemplate = {
- /* name = */ MACH_PORT_NULL,
- /* pad1 = */ 0,
- /* pad2 = */ 0,
- /* disp = */ 19,
- /* type = */ MACH_MSG_PORT_DESCRIPTOR,
- };
- #endif /* UseStaticTemplates */
- InP->msgh_body.msgh_descriptor_count = 2;
- #if UseStaticTemplates
- InP->thread = threadTemplate;
- InP->thread.name = thread;
- #else /* UseStaticTemplates */
- InP->thread.name = thread;
- InP->thread.disposition = 19;
- InP->thread.type = MACH_MSG_PORT_DESCRIPTOR;
- #endif /* UseStaticTemplates */
- #if UseStaticTemplates
- InP->task = taskTemplate;
- InP->task.name = task;
- #else /* UseStaticTemplates */
- InP->task.name = task;
- InP->task.disposition = 19;
- InP->task.type = MACH_MSG_PORT_DESCRIPTOR;
- #endif /* UseStaticTemplates */
- InP->NDR = NDR_record;
- InP->exception = exception;
- if (codeCnt > 2) {
- { return MIG_ARRAY_TOO_LARGE; }
- }
- (void)memcpy((char *) InP->code, (const char *) code, 8 * codeCnt);
- InP->codeCnt = codeCnt;
- msgh_size = (mach_msg_size_t)(sizeof(Request) - 16) + ((8 * codeCnt));
- InP->Head.msgh_bits = MACH_MSGH_BITS_COMPLEX|
- MACH_MSGH_BITS(19, MACH_MSG_TYPE_MAKE_SEND_ONCE);
- /* msgh_size passed as argument */
- InP->Head.msgh_request_port = exception_port;
- InP->Head.msgh_reply_port = mig_get_reply_port();
- InP->Head.msgh_id = 2405;
- InP->Head.msgh_reserved = 0;
-
- /* BEGIN VOUCHER CODE */
- #ifdef USING_VOUCHERS
- if (voucher_mach_msg_set != NULL) {
- voucher_mach_msg_set(&InP->Head);
- }
- #endif // USING_VOUCHERS
-
- /* END VOUCHER CODE */
- __BeforeSendRpc(2405, "mach_exception_raise")
- msg_result = mach_msg(&InP->Head, MACH_SEND_MSG|MACH_RCV_MSG|MACH_MSG_OPTION_NONE, msgh_size, (mach_msg_size_t)sizeof(Reply), InP->Head.msgh_reply_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
- __AfterSendRpc(2405, "mach_exception_raise")
- if (msg_result != MACH_MSG_SUCCESS) {
- __MachMsgErrorWithoutTimeout(msg_result);
- }
- if (msg_result != MACH_MSG_SUCCESS) {
- { return msg_result; }
- }
- #if defined(__MIG_check__Reply__mach_exception_raise_t__defined)
- check_result = __MIG_check__Reply__mach_exception_raise_t((__Reply__mach_exception_raise_t *)Out0P);
- if (check_result != MACH_MSG_SUCCESS) {
- mach_msg_destroy(&Out0P->Head);
- { return check_result; }
- }
- #endif /* defined(__MIG_check__Reply__mach_exception_raise_t__defined) */
- return KERN_SUCCESS;
- }
- #if ( __MigTypeCheck )
- #if __MIG_check__Reply__mach_exc_subsystem__
- #if !defined(__MIG_check__Reply__mach_exception_raise_state_t__defined)
- #define __MIG_check__Reply__mach_exception_raise_state_t__defined
- mig_internal kern_return_t __MIG_check__Reply__mach_exception_raise_state_t(__Reply__mach_exception_raise_state_t *Out0P)
- {
- typedef __Reply__mach_exception_raise_state_t __Reply __attribute__((unused));
- #if __MigTypeCheck
- unsigned int msgh_size;
- #endif /* __MigTypeCheck */
- if (Out0P->Head.msgh_id != 2506) {
- if (Out0P->Head.msgh_id == MACH_NOTIFY_SEND_ONCE)
- { return MIG_SERVER_DIED; }
- else
- { return MIG_REPLY_MISMATCH; }
- }
- #if __MigTypeCheck
- msgh_size = Out0P->Head.msgh_size;
- if ((Out0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
- ((msgh_size > (mach_msg_size_t)sizeof(__Reply) || msgh_size < (mach_msg_size_t)(sizeof(__Reply) - 2456)) &&
- (msgh_size != (mach_msg_size_t)sizeof(mig_reply_error_t) ||
- Out0P->RetCode == KERN_SUCCESS)))
- { return MIG_TYPE_ERROR ; }
- #endif /* __MigTypeCheck */
- #if __MigTypeCheck
- if (Out0P->Head.msgh_request_port != MACH_PORT_NULL) {
- return MIG_TYPE_ERROR;
- }
- #endif /* __MigTypeCheck */
- if (Out0P->RetCode != KERN_SUCCESS) {
- return ((mig_reply_error_t *)Out0P)->RetCode;
- }
- #if __MigTypeCheck
- if ( Out0P->new_stateCnt > 614 )
- return MIG_TYPE_ERROR;
- if (((msgh_size - (mach_msg_size_t)(sizeof(__Reply) - 2456)) / 4< Out0P->new_stateCnt) ||
- (msgh_size != (mach_msg_size_t)(sizeof(__Reply) - 2456) + Out0P->new_stateCnt * 4))
- { return MIG_TYPE_ERROR ; }
- #endif /* __MigTypeCheck */
- return MACH_MSG_SUCCESS;
- }
- #endif /* !defined(__MIG_check__Reply__mach_exception_raise_state_t__defined) */
- #endif /* __MIG_check__Reply__mach_exc_subsystem__ */
- #endif /* ( __MigTypeCheck ) */
- /* Routine mach_exception_raise_state */
- mig_external kern_return_t mach_exception_raise_state
- (
- mach_port_t exception_port,
- exception_type_t exception,
- const mach_exception_data_t code,
- mach_msg_type_number_t codeCnt,
- int *flavor,
- const thread_state_t old_state,
- mach_msg_type_number_t old_stateCnt,
- thread_state_t new_state,
- mach_msg_type_number_t *new_stateCnt
- )
- {
- #ifdef __MigPackStructs
- #pragma pack(push, 4)
- #endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- exception_type_t exception;
- mach_msg_type_number_t codeCnt;
- int64_t code[2];
- int flavor;
- mach_msg_type_number_t old_stateCnt;
- natural_t old_state[614];
- } Request __attribute__((unused));
- #ifdef __MigPackStructs
- #pragma pack(pop)
- #endif
- #ifdef __MigPackStructs
- #pragma pack(push, 4)
- #endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- int flavor;
- mach_msg_type_number_t new_stateCnt;
- natural_t new_state[614];
- mach_msg_trailer_t trailer;
- } Reply __attribute__((unused));
- #ifdef __MigPackStructs
- #pragma pack(pop)
- #endif
- #ifdef __MigPackStructs
- #pragma pack(push, 4)
- #endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- int flavor;
- mach_msg_type_number_t new_stateCnt;
- natural_t new_state[614];
- } __Reply __attribute__((unused));
- #ifdef __MigPackStructs
- #pragma pack(pop)
- #endif
- /*
- * typedef struct {
- * mach_msg_header_t Head;
- * NDR_record_t NDR;
- * kern_return_t RetCode;
- * } mig_reply_error_t;
- */
- union {
- Request In;
- Reply Out;
- } Mess;
- Request *InP = &Mess.In;
- Reply *Out0P = &Mess.Out;
- mach_msg_return_t msg_result;
- unsigned int msgh_size;
- unsigned int msgh_size_delta;
- #ifdef __MIG_check__Reply__mach_exception_raise_state_t__defined
- kern_return_t check_result;
- #endif /* __MIG_check__Reply__mach_exception_raise_state_t__defined */
- __DeclareSendRpc(2406, "mach_exception_raise_state")
- InP->NDR = NDR_record;
- InP->exception = exception;
- if (codeCnt > 2) {
- { return MIG_ARRAY_TOO_LARGE; }
- }
- (void)memcpy((char *) InP->code, (const char *) code, 8 * codeCnt);
- InP->codeCnt = codeCnt;
- msgh_size_delta = (8 * codeCnt);
- msgh_size = (mach_msg_size_t)(sizeof(Request) - 2472) + msgh_size_delta;
- InP = (Request *) ((pointer_t) InP + msgh_size_delta - 16);
- InP->flavor = *flavor;
- if (old_stateCnt > 614) {
- { return MIG_ARRAY_TOO_LARGE; }
- }
- (void)memcpy((char *) InP->old_state, (const char *) old_state, 4 * old_stateCnt);
- InP->old_stateCnt = old_stateCnt;
- msgh_size += (4 * old_stateCnt);
- InP = &Mess.In;
- InP->Head.msgh_bits =
- MACH_MSGH_BITS(19, MACH_MSG_TYPE_MAKE_SEND_ONCE);
- /* msgh_size passed as argument */
- InP->Head.msgh_request_port = exception_port;
- InP->Head.msgh_reply_port = mig_get_reply_port();
- InP->Head.msgh_id = 2406;
- InP->Head.msgh_reserved = 0;
-
- /* BEGIN VOUCHER CODE */
- #ifdef USING_VOUCHERS
- if (voucher_mach_msg_set != NULL) {
- voucher_mach_msg_set(&InP->Head);
- }
- #endif // USING_VOUCHERS
-
- /* END VOUCHER CODE */
- __BeforeSendRpc(2406, "mach_exception_raise_state")
- msg_result = mach_msg(&InP->Head, MACH_SEND_MSG|MACH_RCV_MSG|MACH_MSG_OPTION_NONE, msgh_size, (mach_msg_size_t)sizeof(Reply), InP->Head.msgh_reply_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
- __AfterSendRpc(2406, "mach_exception_raise_state")
- if (msg_result != MACH_MSG_SUCCESS) {
- __MachMsgErrorWithoutTimeout(msg_result);
- }
- if (msg_result != MACH_MSG_SUCCESS) {
- { return msg_result; }
- }
- #if defined(__MIG_check__Reply__mach_exception_raise_state_t__defined)
- check_result = __MIG_check__Reply__mach_exception_raise_state_t((__Reply__mach_exception_raise_state_t *)Out0P);
- if (check_result != MACH_MSG_SUCCESS) {
- mach_msg_destroy(&Out0P->Head);
- { return check_result; }
- }
- #endif /* defined(__MIG_check__Reply__mach_exception_raise_state_t__defined) */
- *flavor = Out0P->flavor;
- if (Out0P->new_stateCnt > 614) {
- (void)memcpy((char *) new_state, (const char *) Out0P->new_state, 4 * 614);
- *new_stateCnt = Out0P->new_stateCnt;
- { return MIG_ARRAY_TOO_LARGE; }
- }
- (void)memcpy((char *) new_state, (const char *) Out0P->new_state, 4 * Out0P->new_stateCnt);
- *new_stateCnt = Out0P->new_stateCnt;
- return KERN_SUCCESS;
- }
- #if ( __MigTypeCheck )
- #if __MIG_check__Reply__mach_exc_subsystem__
- #if !defined(__MIG_check__Reply__mach_exception_raise_state_identity_t__defined)
- #define __MIG_check__Reply__mach_exception_raise_state_identity_t__defined
- mig_internal kern_return_t __MIG_check__Reply__mach_exception_raise_state_identity_t(__Reply__mach_exception_raise_state_identity_t *Out0P)
- {
- typedef __Reply__mach_exception_raise_state_identity_t __Reply __attribute__((unused));
- #if __MigTypeCheck
- unsigned int msgh_size;
- #endif /* __MigTypeCheck */
- if (Out0P->Head.msgh_id != 2507) {
- if (Out0P->Head.msgh_id == MACH_NOTIFY_SEND_ONCE)
- { return MIG_SERVER_DIED; }
- else
- { return MIG_REPLY_MISMATCH; }
- }
- #if __MigTypeCheck
- msgh_size = Out0P->Head.msgh_size;
- if ((Out0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
- ((msgh_size > (mach_msg_size_t)sizeof(__Reply) || msgh_size < (mach_msg_size_t)(sizeof(__Reply) - 2456)) &&
- (msgh_size != (mach_msg_size_t)sizeof(mig_reply_error_t) ||
- Out0P->RetCode == KERN_SUCCESS)))
- { return MIG_TYPE_ERROR ; }
- #endif /* __MigTypeCheck */
- #if __MigTypeCheck
- if (Out0P->Head.msgh_request_port != MACH_PORT_NULL) {
- return MIG_TYPE_ERROR;
- }
- #endif /* __MigTypeCheck */
- if (Out0P->RetCode != KERN_SUCCESS) {
- return ((mig_reply_error_t *)Out0P)->RetCode;
- }
- #if __MigTypeCheck
- if ( Out0P->new_stateCnt > 614 )
- return MIG_TYPE_ERROR;
- if (((msgh_size - (mach_msg_size_t)(sizeof(__Reply) - 2456)) / 4< Out0P->new_stateCnt) ||
- (msgh_size != (mach_msg_size_t)(sizeof(__Reply) - 2456) + Out0P->new_stateCnt * 4))
- { return MIG_TYPE_ERROR ; }
- #endif /* __MigTypeCheck */
- return MACH_MSG_SUCCESS;
- }
- #endif /* !defined(__MIG_check__Reply__mach_exception_raise_state_identity_t__defined) */
- #endif /* __MIG_check__Reply__mach_exc_subsystem__ */
- #endif /* ( __MigTypeCheck ) */
- /* Routine mach_exception_raise_state_identity */
- mig_external kern_return_t mach_exception_raise_state_identity
- (
- mach_port_t exception_port,
- mach_port_t thread,
- mach_port_t task,
- exception_type_t exception,
- mach_exception_data_t code,
- mach_msg_type_number_t codeCnt,
- int *flavor,
- thread_state_t old_state,
- mach_msg_type_number_t old_stateCnt,
- thread_state_t new_state,
- mach_msg_type_number_t *new_stateCnt
- )
- {
- #ifdef __MigPackStructs
- #pragma pack(push, 4)
- #endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t thread;
- mach_msg_port_descriptor_t task;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- exception_type_t exception;
- mach_msg_type_number_t codeCnt;
- int64_t code[2];
- int flavor;
- mach_msg_type_number_t old_stateCnt;
- natural_t old_state[614];
- } Request __attribute__((unused));
- #ifdef __MigPackStructs
- #pragma pack(pop)
- #endif
- #ifdef __MigPackStructs
- #pragma pack(push, 4)
- #endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- int flavor;
- mach_msg_type_number_t new_stateCnt;
- natural_t new_state[614];
- mach_msg_trailer_t trailer;
- } Reply __attribute__((unused));
- #ifdef __MigPackStructs
- #pragma pack(pop)
- #endif
- #ifdef __MigPackStructs
- #pragma pack(push, 4)
- #endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- int flavor;
- mach_msg_type_number_t new_stateCnt;
- natural_t new_state[614];
- } __Reply __attribute__((unused));
- #ifdef __MigPackStructs
- #pragma pack(pop)
- #endif
- /*
- * typedef struct {
- * mach_msg_header_t Head;
- * NDR_record_t NDR;
- * kern_return_t RetCode;
- * } mig_reply_error_t;
- */
- union {
- Request In;
- Reply Out;
- } Mess;
- Request *InP = &Mess.In;
- Reply *Out0P = &Mess.Out;
- mach_msg_return_t msg_result;
- unsigned int msgh_size;
- unsigned int msgh_size_delta;
- #ifdef __MIG_check__Reply__mach_exception_raise_state_identity_t__defined
- kern_return_t check_result;
- #endif /* __MIG_check__Reply__mach_exception_raise_state_identity_t__defined */
- __DeclareSendRpc(2407, "mach_exception_raise_state_identity")
- #if UseStaticTemplates
- const static mach_msg_port_descriptor_t threadTemplate = {
- /* name = */ MACH_PORT_NULL,
- /* pad1 = */ 0,
- /* pad2 = */ 0,
- /* disp = */ 19,
- /* type = */ MACH_MSG_PORT_DESCRIPTOR,
- };
- #endif /* UseStaticTemplates */
- #if UseStaticTemplates
- const static mach_msg_port_descriptor_t taskTemplate = {
- /* name = */ MACH_PORT_NULL,
- /* pad1 = */ 0,
- /* pad2 = */ 0,
- /* disp = */ 19,
- /* type = */ MACH_MSG_PORT_DESCRIPTOR,
- };
- #endif /* UseStaticTemplates */
- InP->msgh_body.msgh_descriptor_count = 2;
- #if UseStaticTemplates
- InP->thread = threadTemplate;
- InP->thread.name = thread;
- #else /* UseStaticTemplates */
- InP->thread.name = thread;
- InP->thread.disposition = 19;
- InP->thread.type = MACH_MSG_PORT_DESCRIPTOR;
- #endif /* UseStaticTemplates */
- #if UseStaticTemplates
- InP->task = taskTemplate;
- InP->task.name = task;
- #else /* UseStaticTemplates */
- InP->task.name = task;
- InP->task.disposition = 19;
- InP->task.type = MACH_MSG_PORT_DESCRIPTOR;
- #endif /* UseStaticTemplates */
- InP->NDR = NDR_record;
- InP->exception = exception;
- if (codeCnt > 2) {
- { return MIG_ARRAY_TOO_LARGE; }
- }
- (void)memcpy((char *) InP->code, (const char *) code, 8 * codeCnt);
- InP->codeCnt = codeCnt;
- msgh_size_delta = (8 * codeCnt);
- msgh_size = (mach_msg_size_t)(sizeof(Request) - 2472) + msgh_size_delta;
- InP = (Request *) ((pointer_t) InP + msgh_size_delta - 16);
- InP->flavor = *flavor;
- if (old_stateCnt > 614) {
- { return MIG_ARRAY_TOO_LARGE; }
- }
- (void)memcpy((char *) InP->old_state, (const char *) old_state, 4 * old_stateCnt);
- InP->old_stateCnt = old_stateCnt;
- msgh_size += (4 * old_stateCnt);
- InP = &Mess.In;
- InP->Head.msgh_bits = MACH_MSGH_BITS_COMPLEX|
- MACH_MSGH_BITS(19, MACH_MSG_TYPE_MAKE_SEND_ONCE);
- /* msgh_size passed as argument */
- InP->Head.msgh_request_port = exception_port;
- InP->Head.msgh_reply_port = mig_get_reply_port();
- InP->Head.msgh_id = 2407;
- InP->Head.msgh_reserved = 0;
-
- /* BEGIN VOUCHER CODE */
- #ifdef USING_VOUCHERS
- if (voucher_mach_msg_set != NULL) {
- voucher_mach_msg_set(&InP->Head);
- }
- #endif // USING_VOUCHERS
-
- /* END VOUCHER CODE */
- __BeforeSendRpc(2407, "mach_exception_raise_state_identity")
- msg_result = mach_msg(&InP->Head, MACH_SEND_MSG|MACH_RCV_MSG|MACH_MSG_OPTION_NONE, msgh_size, (mach_msg_size_t)sizeof(Reply), InP->Head.msgh_reply_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
- __AfterSendRpc(2407, "mach_exception_raise_state_identity")
- if (msg_result != MACH_MSG_SUCCESS) {
- __MachMsgErrorWithoutTimeout(msg_result);
- }
- if (msg_result != MACH_MSG_SUCCESS) {
- { return msg_result; }
- }
- #if defined(__MIG_check__Reply__mach_exception_raise_state_identity_t__defined)
- check_result = __MIG_check__Reply__mach_exception_raise_state_identity_t((__Reply__mach_exception_raise_state_identity_t *)Out0P);
- if (check_result != MACH_MSG_SUCCESS) {
- mach_msg_destroy(&Out0P->Head);
- { return check_result; }
- }
- #endif /* defined(__MIG_check__Reply__mach_exception_raise_state_identity_t__defined) */
- *flavor = Out0P->flavor;
- if (Out0P->new_stateCnt > 614) {
- (void)memcpy((char *) new_state, (const char *) Out0P->new_state, 4 * 614);
- *new_stateCnt = Out0P->new_stateCnt;
- { return MIG_ARRAY_TOO_LARGE; }
- }
- (void)memcpy((char *) new_state, (const char *) Out0P->new_state, 4 * Out0P->new_stateCnt);
- *new_stateCnt = Out0P->new_stateCnt;
- return KERN_SUCCESS;
- }
- #endif
|