+
+#if CONFIG_EMBEDDED
+ /*
+ * The darkboot flag is specified by the bootloader and is stored in
+ * boot_args->bootFlags. This flag is available starting revision 2.
+ */
+ boot_args *args = (boot_args *) PE_state.bootArgs;
+ if ((args != NULL) && (args->Revision >= kBootArgsRevision2)) {
+ darkboot = (args->bootFlags & kBootFlagsDarkBoot) ? 1 : 0;
+ } else {
+ darkboot = 0;
+ }
+#endif
+
+#if PROC_REF_DEBUG
+ if (PE_parse_boot_argn("-disable_procref_tracking", namep, sizeof(namep))) {
+ proc_ref_tracking_disabled = 1;
+ }
+#endif
+
+#if OS_REASON_DEBUG
+ if (PE_parse_boot_argn("-disable_osreason_debug", namep, sizeof(namep))) {
+ os_reason_debug_disabled = 1;
+ }
+#endif
+
+ PE_parse_boot_argn("sigrestrict", &sigrestrict_arg, sizeof(sigrestrict_arg));
+
+#if DEVELOPMENT || DEBUG
+ if (PE_parse_boot_argn("-no_sigsys", namep, sizeof(namep))) {
+ send_sigsys = false;
+ }
+
+ if (PE_parse_boot_argn("alt-dyld", dyld_alt_path, sizeof(dyld_alt_path))) {
+ if (strlen(dyld_alt_path) > 0) {
+ use_alt_dyld = 1;
+ }
+ }
+ PE_parse_boot_argn("dyld_flags", &dyld_flags, sizeof(dyld_flags));
+
+ if (PE_parse_boot_argn("-disable_syscallfilter", &namep, sizeof(namep))) {
+ syscallfilter_disable = 1;
+ }
+
+#if __arm64__
+ if (PE_parse_boot_argn("legacy_footprint_entitlement_mode", &legacy_footprint_entitlement_mode, sizeof(legacy_footprint_entitlement_mode))) {
+ /*
+ * legacy_footprint_entitlement_mode specifies the behavior we want associated
+ * with the entitlement. The supported modes are:
+ *
+ * LEGACY_FOOTPRINT_ENTITLEMENT_IGNORE:
+ * Indicates that we want every process to have the memory accounting
+ * that is available in iOS 12.0 and beyond.
+ *
+ * LEGACY_FOOTPRINT_ENTITLEMENT_IOS11_ACCT:
+ * Indicates that for every process that has the 'legacy footprint entitlement',
+ * we want to give it the old iOS 11.0 accounting behavior which accounted some
+ * of the process's memory to the kernel.
+ *
+ * LEGACY_FOOTPRINT_ENTITLEMENT_LIMIT_INCREASE:
+ * Indicates that for every process that has the 'legacy footprint entitlement',
+ * we want it to have a higher memory limit which will help them acclimate to the
+ * iOS 12.0 (& beyond) accounting behavior that does the right accounting.
+ * The bonus added to the system-wide task limit to calculate this higher memory limit
+ * is available in legacy_footprint_bonus_mb.
+ */
+
+ if (legacy_footprint_entitlement_mode < LEGACY_FOOTPRINT_ENTITLEMENT_IGNORE ||
+ legacy_footprint_entitlement_mode > LEGACY_FOOTPRINT_ENTITLEMENT_LIMIT_INCREASE) {
+ legacy_footprint_entitlement_mode = LEGACY_FOOTPRINT_ENTITLEMENT_LIMIT_INCREASE;
+ }
+ }
+#endif /* __arm64__ */
+#endif /* DEVELOPMENT || DEBUG */