diff options
-rw-r--r-- | generated/manual-mach.inc.h | 122 | ||||
-rwxr-xr-x | script/gen-manual-mach.sh | 10 |
2 files changed, 95 insertions, 37 deletions
diff --git a/generated/manual-mach.inc.h b/generated/manual-mach.inc.h index 616acde..cfb8fd8 100644 --- a/generated/manual-mach.inc.h +++ b/generated/manual-mach.inc.h @@ -93,14 +93,43 @@ kern_return_t manual_thread_set_state mach_msg_type_number_t new_stateCnt , mach_port_t reply_port); + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t old_stateCnt; + } __Request__manual_thread_get_state_t __attribute__((unused)); + + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[224]; + } __Request__manual_thread_set_state_t __attribute__((unused)); + + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t old_stateCnt; + natural_t old_state[224]; + } __Reply__manual_thread_get_state_t __attribute__((unused)); + + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__manual_thread_set_state_t __attribute__((unused)); + /* * IDENTIFICATION: - * stub generated Tue Oct 27 21:13:20 2015 + * stub generated Tue Oct 27 21:24:44 2015 * with a MiG generated by bootstrap_cmds-93 * OPTIONS: */ -#define __MIG_check__Reply__thread_act_subsystem__ 1 +#define __MIG_check__Reply__manual_thread_act_subsystem__ 1 @@ -196,13 +225,13 @@ kern_return_t manual_thread_set_state -#if !defined(__MIG_check__Reply__thread_get_state_t_manual__defined) -#define __MIG_check__Reply__thread_get_state_t_manual__defined +#if !defined(__MIG_check__Reply__manual_thread_get_state_t__defined) +#define __MIG_check__Reply__manual_thread_get_state_t__defined -mig_internal kern_return_t __MIG_check__Reply__thread_get_state_t(__Reply__thread_get_state_t *Out0P) +mig_internal kern_return_t __MIG_check__Reply__manual_thread_get_state_t(__Reply__manual_thread_get_state_t *Out0P) { - typedef __Reply__thread_get_state_t __Reply __attribute__((unused)); + typedef __Reply__manual_thread_get_state_t __Reply __attribute__((unused)); unsigned int msgh_size; if (Out0P->Head.msgh_id != 3703) { @@ -232,7 +261,7 @@ mig_internal kern_return_t __MIG_check__Reply__thread_get_state_t(__Reply__threa return MACH_MSG_SUCCESS; } -#endif /* !defined(__MIG_check__Reply__thread_get_state_t_manual__defined) */ +#endif /* !defined(__MIG_check__Reply__manual_thread_get_state_t__defined) */ /* Routine thread_get_state */ static kern_return_t manual_thread_get_state ( @@ -302,9 +331,9 @@ static kern_return_t manual_thread_get_state mach_msg_return_t msg_result; -#ifdef __MIG_check__Reply__thread_get_state_t_manual__defined +#ifdef __MIG_check__Reply__manual_thread_get_state_t__defined kern_return_t check_result; -#endif /* __MIG_check__Reply__thread_get_state_t_manual__defined */ +#endif /* __MIG_check__Reply__manual_thread_get_state_t__defined */ __DeclareSendRpc(3603, "thread_get_state") @@ -343,11 +372,11 @@ static kern_return_t manual_thread_get_state } -#if defined(__MIG_check__Reply__thread_get_state_t_manual__defined) - check_result = __MIG_check__Reply__thread_get_state_t((__Reply__thread_get_state_t *)Out0P); +#if defined(__MIG_check__Reply__manual_thread_get_state_t__defined) + check_result = __MIG_check__Reply__manual_thread_get_state_t((__Reply__manual_thread_get_state_t *)Out0P); if (check_result != MACH_MSG_SUCCESS) { return check_result; } -#endif /* defined(__MIG_check__Reply__thread_get_state_t_manual__defined) */ +#endif /* defined(__MIG_check__Reply__manual_thread_get_state_t__defined) */ if (Out0P->old_stateCnt > *old_stateCnt) { (void)manual_memcpy((char *) old_state, (const char *) Out0P->old_state, 4 * *old_stateCnt); @@ -361,13 +390,13 @@ static kern_return_t manual_thread_get_state return KERN_SUCCESS; } -#if !defined(__MIG_check__Reply__thread_set_state_t_manual__defined) -#define __MIG_check__Reply__thread_set_state_t_manual__defined +#if !defined(__MIG_check__Reply__manual_thread_set_state_t__defined) +#define __MIG_check__Reply__manual_thread_set_state_t__defined -mig_internal kern_return_t __MIG_check__Reply__thread_set_state_t(__Reply__thread_set_state_t *Out0P) +mig_internal kern_return_t __MIG_check__Reply__manual_thread_set_state_t(__Reply__manual_thread_set_state_t *Out0P) { - typedef __Reply__thread_set_state_t __Reply __attribute__((unused)); + typedef __Reply__manual_thread_set_state_t __Reply __attribute__((unused)); if (Out0P->Head.msgh_id != 3704) { if (Out0P->Head.msgh_id == MACH_NOTIFY_SEND_ONCE) { return MIG_SERVER_DIED; } @@ -383,7 +412,7 @@ mig_internal kern_return_t __MIG_check__Reply__thread_set_state_t(__Reply__threa return Out0P->RetCode; } } -#endif /* !defined(__MIG_check__Reply__thread_set_state_t_manual__defined) */ +#endif /* !defined(__MIG_check__Reply__manual_thread_set_state_t__defined) */ /* Routine thread_set_state */ static kern_return_t manual_thread_set_state ( @@ -451,9 +480,9 @@ static kern_return_t manual_thread_set_state mach_msg_return_t msg_result; unsigned int msgh_size; -#ifdef __MIG_check__Reply__thread_set_state_t_manual__defined +#ifdef __MIG_check__Reply__manual_thread_set_state_t__defined kern_return_t check_result; -#endif /* __MIG_check__Reply__thread_set_state_t_manual__defined */ +#endif /* __MIG_check__Reply__manual_thread_set_state_t__defined */ __DeclareSendRpc(3604, "thread_set_state") @@ -495,11 +524,11 @@ static kern_return_t manual_thread_set_state } -#if defined(__MIG_check__Reply__thread_set_state_t_manual__defined) - check_result = __MIG_check__Reply__thread_set_state_t((__Reply__thread_set_state_t *)Out0P); +#if defined(__MIG_check__Reply__manual_thread_set_state_t__defined) + check_result = __MIG_check__Reply__manual_thread_set_state_t((__Reply__manual_thread_set_state_t *)Out0P); if (check_result != MACH_MSG_SUCCESS) { return check_result; } -#endif /* defined(__MIG_check__Reply__thread_set_state_t_manual__defined) */ +#endif /* defined(__MIG_check__Reply__manual_thread_set_state_t__defined) */ return KERN_SUCCESS; } @@ -525,14 +554,39 @@ kern_return_t manual_mach_vm_remap vm_inherit_t inheritance , mach_port_t reply_port); + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t src_task; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_vm_address_t target_address; + mach_vm_size_t size; + mach_vm_offset_t mask; + int flags; + mach_vm_address_t src_address; + boolean_t copy; + vm_inherit_t inheritance; + } __Request__manual_mach_vm_remap_t __attribute__((unused)); + + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_vm_address_t target_address; + vm_prot_t cur_protection; + vm_prot_t max_protection; + } __Reply__manual_mach_vm_remap_t __attribute__((unused)); + /* * IDENTIFICATION: - * stub generated Tue Oct 27 21:13:20 2015 + * stub generated Tue Oct 27 21:24:44 2015 * with a MiG generated by bootstrap_cmds-93 * OPTIONS: */ -#define __MIG_check__Reply__mach_vm_subsystem__ 1 +#define __MIG_check__Reply__manual_mach_vm_subsystem__ 1 @@ -628,13 +682,13 @@ kern_return_t manual_mach_vm_remap -#if !defined(__MIG_check__Reply__mach_vm_remap_t_manual__defined) -#define __MIG_check__Reply__mach_vm_remap_t_manual__defined +#if !defined(__MIG_check__Reply__manual_mach_vm_remap_t__defined) +#define __MIG_check__Reply__manual_mach_vm_remap_t__defined -mig_internal kern_return_t __MIG_check__Reply__mach_vm_remap_t(__Reply___kernelrpc_mach_vm_remap_t *Out0P) +mig_internal kern_return_t __MIG_check__Reply__manual_mach_vm_remap_t(__Reply__manual_mach_vm_remap_t *Out0P) { - typedef __Reply__mach_vm_remap_t __Reply __attribute__((unused)); + typedef __Reply__manual_mach_vm_remap_t __Reply __attribute__((unused)); unsigned int msgh_size; if (Out0P->Head.msgh_id != 4913) { if (Out0P->Head.msgh_id == MACH_NOTIFY_SEND_ONCE) @@ -657,7 +711,7 @@ mig_internal kern_return_t __MIG_check__Reply__mach_vm_remap_t(__Reply___kernelr return MACH_MSG_SUCCESS; } -#endif /* !defined(__MIG_check__Reply__mach_vm_remap_t_manual__defined) */ +#endif /* !defined(__MIG_check__Reply__manual_mach_vm_remap_t__defined) */ /* Routine mach_vm_remap */ static kern_return_t manual_mach_vm_remap ( @@ -745,9 +799,9 @@ static kern_return_t manual_mach_vm_remap mach_msg_return_t msg_result; -#ifdef __MIG_check__Reply__mach_vm_remap_t_manual__defined +#ifdef __MIG_check__Reply__manual_mach_vm_remap_t__defined kern_return_t check_result; -#endif /* __MIG_check__Reply__mach_vm_remap_t_manual__defined */ +#endif /* __MIG_check__Reply__manual_mach_vm_remap_t__defined */ __DeclareSendRpc(4813, "mach_vm_remap") @@ -813,11 +867,11 @@ static kern_return_t manual_mach_vm_remap } -#if defined(__MIG_check__Reply__mach_vm_remap_t_manual__defined) - check_result = __MIG_check__Reply__mach_vm_remap_t((__Reply___kernelrpc_mach_vm_remap_t *)Out0P); +#if defined(__MIG_check__Reply__manual_mach_vm_remap_t__defined) + check_result = __MIG_check__Reply__manual_mach_vm_remap_t((__Reply__manual_mach_vm_remap_t *)Out0P); if (check_result != MACH_MSG_SUCCESS) { return check_result; } -#endif /* defined(__MIG_check__Reply__mach_vm_remap_t_manual__defined) */ +#endif /* defined(__MIG_check__Reply__manual_mach_vm_remap_t__defined) */ *target_address = Out0P->target_address; diff --git a/script/gen-manual-mach.sh b/script/gen-manual-mach.sh index e973bce..b309e0c 100755 --- a/script/gen-manual-mach.sh +++ b/script/gen-manual-mach.sh @@ -1,19 +1,23 @@ #!/bin/bash out=generated/manual-mach.inc.h +pat='/thread_[gs]et_state|vm_remap/' (mig -user /dev/stdout -server /dev/null -header /dev/stdout /usr/include/mach/{thread_act,mach_vm}.defs | egrep -v '^(#ifndef|#define|#endif).*_user_' | egrep -v '#include "stdout"' | unifdef -D__MigTypeCheck | sed -E 's/(mach_msg|memcpy)\(/manual_\1(/g; s/^\)/, mach_port_t reply_port)/; - s/_kernelrpc_//; + s/_kernelrpc_//g; + s/(Request|Reply)__/\1__manual_/g; s/^([a-z].*)?kern_return_t[[:blank:]]+([a-z])/\1kern_return_t manual_\2/; s/mig_external/static/; - s/__defined/_manual__defined/g; s/mig_get_reply_port\(\)/reply_port/g' | awk 'BEGIN { on = 1; } /^\/\* Routine / || - (/__MIG_check__Reply__/ && /^#[ie]/) { on = /thread_[gs]et_state|vm_remap/; } + (/__MIG_check__Reply__/ && /^#[ie]/) { on = '"$pat"'; } on { print; } + /typedef struct {/ { xon = 1; accum = ""; } + xon { accum = accum $0 "\n"; } + xon && /} / { if('"$pat"') print accum; xon = 0; } /#endif.*__AfterMigUserHeader/ { on = 1; } ' > $out) || rm -f $out |