aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCameron Katri <me@cameronkatri.com>2021-05-20 16:23:47 -0400
committerCameron Katri <me@cameronkatri.com>2021-05-20 16:23:47 -0400
commit985f8904c132bc258df18a82941d93d4470c6b5e (patch)
treef00e6424bf138ee7c1ac68808813d4685ccffab9
parent861289845fcf7dbe9b289d9695fe6808ff13be2b (diff)
downloadapple_cmds-985f8904c132bc258df18a82941d93d4470c6b5e.tar.gz
apple_cmds-985f8904c132bc258df18a82941d93d4470c6b5e.tar.zst
apple_cmds-985f8904c132bc258df18a82941d93d4470c6b5e.zip
bootstrap_cmds: Update to 121.100.1
-rw-r--r--bootstrap_cmds/.apple_version2
-rw-r--r--bootstrap_cmds/migcom.tproj/server.c8
-rw-r--r--bootstrap_cmds/migcom.tproj/user.c54
3 files changed, 18 insertions, 46 deletions
diff --git a/bootstrap_cmds/.apple_version b/bootstrap_cmds/.apple_version
index ca285c2..8e50c91 100644
--- a/bootstrap_cmds/.apple_version
+++ b/bootstrap_cmds/.apple_version
@@ -1 +1 @@
-116.100.1
+121.100.1
diff --git a/bootstrap_cmds/migcom.tproj/server.c b/bootstrap_cmds/migcom.tproj/server.c
index 7bbed53..5b22b46 100644
--- a/bootstrap_cmds/migcom.tproj/server.c
+++ b/bootstrap_cmds/migcom.tproj/server.c
@@ -921,6 +921,8 @@ static void
WriteCheckMsgSize(FILE *file, argument_t *arg)
{
routine_t *rt = arg->argRoutine;
+ ipc_type_t *it = arg->argType;
+ ipc_type_t *btype = it->itElement;
if (arg->argCount && !arg->argSameCount)
WriteRequestNDRConvertIntRepOneArgUse(file, arg->argCount);
@@ -928,7 +930,8 @@ WriteCheckMsgSize(FILE *file, argument_t *arg)
fprintf(file, "#if\t__MigTypeCheck\n");
/* verify that the user-code-provided count does not exceed the maximum count allowed by the type. */
- fprintf(file, "\t" "if ( In%dP->%s > %d )\n", arg->argCount->argRequestPos, arg->argCount->argMsgField, arg->argType->itNumber);
+ fprintf(file, "\t" "if ( In%dP->%s > %d )\n", arg->argCount->argRequestPos,
+ arg->argCount->argMsgField, it->itNumber/btype->itNumber);
fputs("\t\t" "return MIG_BAD_ARGUMENTS;\n", file);
/* ...end... */
@@ -955,7 +958,8 @@ WriteCheckMsgSize(FILE *file, argument_t *arg)
fprintf(file, "#if\t__MigTypeCheck\n");
/* verify that the user-code-provided count does not exceed the maximum count allowed by the type. */
- fprintf(file, "\t" "if ( In%dP->%s > %d )\n", arg->argCount->argRequestPos, arg->argCount->argMsgField, arg->argType->itNumber);
+ fprintf(file, "\t" "if ( In%dP->%s > %d )\n", arg->argCount->argRequestPos,
+ arg->argCount->argMsgField, it->itNumber/btype->itNumber);
fputs("\t\t" "return MIG_BAD_ARGUMENTS;\n", file);
/* ...end... */
diff --git a/bootstrap_cmds/migcom.tproj/user.c b/bootstrap_cmds/migcom.tproj/user.c
index 839732d..6e9d27c 100644
--- a/bootstrap_cmds/migcom.tproj/user.c
+++ b/bootstrap_cmds/migcom.tproj/user.c
@@ -55,14 +55,6 @@
#include "utils.h"
#include "global.h"
-#ifndef DISABLE_SPECIAL_REPLY_PORT_IN_CHROOT
-#define DISABLE_SPECIAL_REPLY_PORT_IN_CHROOT 1
-#endif
-
-#ifndef DISABLE_SPECIAL_REPLY_PORT_IN_SIMULATOR
-#define DISABLE_SPECIAL_REPLY_PORT_IN_SIMULATOR 1
-#endif
-
#ifndef USE_IMMEDIATE_SEND_TIMEOUT
#define USE_IMMEDIATE_SEND_TIMEOUT 0
#endif
@@ -196,29 +188,9 @@ WriteMyIncludes(FILE *file, statement_t *stats)
fprintf(file, "\n");
fprintf(file, "#include <TargetConditionals.h>\n");
fprintf(file, "#include <mach/mach_sync_ipc.h>\n");
-#if DISABLE_SPECIAL_REPLY_PORT_IN_SIMULATOR
- fprintf(file, "#ifndef __MigCanUseSpecialReplyPort\n");
- fprintf(file, "#if TARGET_OS_SIMULATOR\n");
- fprintf(file, "#define __MigCanUseSpecialReplyPort 0\n");
- fprintf(file, "#define mig_get_special_reply_port() MACH_PORT_DEAD\n");
- fprintf(file, "#define mig_dealloc_special_reply_port(port) __builtin_trap()\n");
- fprintf(file, "#endif\n");
- fprintf(file, "#endif /* __MigCanUseSpecialReplyPort */\n");
-#endif
-#if DISABLE_SPECIAL_REPLY_PORT_IN_CHROOT
- fprintf(file, "#ifndef __MigCanUseSpecialReplyPort\n");
- fprintf(file, "#if TARGET_OS_OSX\n");
- fprintf(file, "extern _Bool _os_xbs_chrooted;\n");
- fprintf(file, "#define __MigCanUseSpecialReplyPort (!_os_xbs_chrooted)\n");
- fprintf(file, "#endif\n");
- fprintf(file, "#endif /* __MigCanUseSpecialReplyPort */\n");
-#endif
- fprintf(file, "#ifndef __MigCanUseSpecialReplyPort\n");
- fprintf(file, "#define __MigCanUseSpecialReplyPort 1\n");
- fprintf(file, "#endif /* __MigCanUseSpecialReplyPort */\n");
fprintf(file, "#ifndef __MigSpecialReplyPortMsgOption\n");
- fprintf(file, "#define __MigSpecialReplyPortMsgOption (__MigCanUseSpecialReplyPort ? "
- "(MACH_SEND_SYNC_OVERRIDE|MACH_SEND_SYNC_USE_THRPRI|MACH_RCV_SYNC_WAIT) : MACH_MSG_OPTION_NONE)\n");
+ fprintf(file, "#define __MigSpecialReplyPortMsgOption "
+ "(MACH_SEND_SYNC_OVERRIDE|MACH_SEND_SYNC_USE_THRPRI|MACH_RCV_SYNC_WAIT)\n");
fprintf(file, "#endif /* __MigSpecialReplyPortMsgOption */\n");
}
/*
@@ -256,11 +228,7 @@ WriteOneMachErrorDefine(FILE *file, char *name, boolean_t timeout, boolean_t Spe
fprintf(file, "\tcase MACH_SEND_INVALID_DATA: \\\n");
fprintf(file, "\tcase MACH_SEND_INVALID_DEST: \\\n");
fprintf(file, "\tcase MACH_SEND_INVALID_HEADER: \\\n");
- if (SpecialReplyPort) {
- fprintf(file, "\t\tif (!__MigCanUseSpecialReplyPort) { \\\n");
- fprintf(file, "\t\t\tmig_put_reply_port(InP->Head.msgh_reply_port); \\\n");
- fprintf(file, "\t\t} \\\n");
- } else {
+ if (!SpecialReplyPort) {
fprintf(file, "\t\tmig_put_reply_port(InP->Head.msgh_reply_port); \\\n");
}
fprintf(file, "\t\tbreak; \\\n");
@@ -270,11 +238,7 @@ WriteOneMachErrorDefine(FILE *file, char *name, boolean_t timeout, boolean_t Spe
}
fprintf(file, "\tdefault: \\\n");
if (SpecialReplyPort) {
- fprintf(file, "\t\tif (__MigCanUseSpecialReplyPort) { \\\n");
- fprintf(file, "\t\t\tmig_dealloc_special_reply_port(InP->Head.msgh_reply_port); \\\n");
- fprintf(file, "\t\t} else { \\\n");
- fprintf(file, "\t\t\tmig_dealloc_reply_port(InP->Head.msgh_reply_port); \\\n");
- fprintf(file, "\t\t} \\\n");
+ fprintf(file, "\t\tmig_dealloc_special_reply_port(InP->Head.msgh_reply_port); \\\n");
} else {
fprintf(file, "\t\tmig_dealloc_reply_port(InP->Head.msgh_reply_port); \\\n");
}
@@ -392,7 +356,7 @@ WriteRequestHead(FILE *file, routine_t *rt)
else if (rt->rtOneWay)
fprintf(file, "\tInP->%s = MACH_PORT_NULL;\n", rt->rtReplyPort->argMsgField);
else if (rt->rtUseSpecialReplyPort)
- fprintf(file, "\tInP->%s = __MigCanUseSpecialReplyPort ? mig_get_special_reply_port() : mig_get_reply_port();\n", rt->rtReplyPort->argMsgField);
+ fprintf(file, "\tInP->%s = mig_get_special_reply_port();\n", rt->rtReplyPort->argMsgField);
else
fprintf(file, "\tInP->%s = mig_get_reply_port();\n", rt->rtReplyPort->argMsgField);
@@ -1967,6 +1931,8 @@ static void
WriteCheckMsgSize(FILE *file, argument_t *arg)
{
routine_t *rt = arg->argRoutine;
+ ipc_type_t *it = arg->argType;
+ ipc_type_t *btype = it->itElement;
/* If there aren't any more Out args after this, then
we can use the msgh_size_delta value directly in
@@ -1981,7 +1947,8 @@ WriteCheckMsgSize(FILE *file, argument_t *arg)
/*
* emit code to verify that the server-code-provided count does not exceed the maximum count allowed by the type.
*/
- fprintf(file, "\t" "if ( Out%dP->%s > %d )\n", arg->argCount->argReplyPos, arg->argCount->argMsgField, arg->argType->itNumber);
+ fprintf(file, "\t" "if ( Out%dP->%s > %d )\n", arg->argCount->argReplyPos,
+ arg->argCount->argMsgField, it->itNumber/btype->itNumber);
fputs("\t\t" "return MIG_TYPE_ERROR;\n", file);
/* ...end... */
@@ -2010,7 +1977,8 @@ WriteCheckMsgSize(FILE *file, argument_t *arg)
/*
* emit code to verify that the server-code-provided count does not exceed the maximum count allowed by the type.
*/
- fprintf(file, "\t" "if ( Out%dP->%s > %d )\n", arg->argCount->argReplyPos, arg->argCount->argMsgField, arg->argType->itNumber);
+ fprintf(file, "\t" "if ( Out%dP->%s > %d )\n", arg->argCount->argReplyPos,
+ arg->argCount->argMsgField, it->itNumber/btype->itNumber);
fputs("\t\t" "return MIG_TYPE_ERROR;\n", file);
/* ...end... */