]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/sys/kern_memorystatus.h
xnu-7195.101.1.tar.gz
[apple/xnu.git] / bsd / sys / kern_memorystatus.h
index 48b03e0de3b1abdee62aa34d0ed69fb5efd409e3..8db45d65e0a24a57d06da0113b2bce73b5cc830d 100644 (file)
@@ -161,6 +161,20 @@ typedef struct memorystatus_kernel_stats {
        char     largest_zone_name[MACH_ZONE_NAME_MAX_LEN];
 } memorystatus_kernel_stats_t;
 
+typedef enum memorystatus_freeze_skip_reason {
+       kMemorystatusFreezeSkipReasonNone = 0,
+       kMemorystatusFreezeSkipReasonExcessSharedMemory = 1,
+       kMemorystatusFreezeSkipReasonLowPrivateSharedRatio = 2,
+       kMemorystatusFreezeSkipReasonNoCompressorSpace = 3,
+       kMemorystatusFreezeSkipReasonNoSwapSpace = 4,
+       kMemorystatusFreezeSkipReasonBelowMinPages = 5,
+       kMemorystatusFreezeSkipReasonLowProbOfUse = 6,
+       kMemorystatusFreezeSkipReasonOther = 7,
+       kMemorystatusFreezeSkipReasonOutOfBudget = 8,
+       kMemorystatusFreezeSkipReasonOutOfSlots = 9,
+       kMemorystatusFreezeSkipReasonDisabled = 10,
+       _kMemorystatusFreezeSkipReasonMax
+} memorystatus_freeze_skip_reason_t;
 /*
 ** This is a variable-length struct.
 ** Allocate a buffer of the size returned by the sysctl, cast to a memorystatus_snapshot_t *
@@ -172,6 +186,7 @@ typedef struct jetsam_snapshot_entry {
        int32_t  priority;
        uint32_t state;
        uint32_t fds;
+       memorystatus_freeze_skip_reason_t jse_freeze_skip_reason; /* why wasn't this process frozen? */
        uint8_t  uuid[16];
        uint64_t user_data;
        uint64_t killed;
@@ -349,9 +364,11 @@ int memorystatus_control(uint32_t command, int32_t pid, uint32_t flags, void *bu
 #define MEMORYSTATUS_CMD_INCREASE_JETSAM_TASK_LIMIT   22   /* Used by DYLD to increase the jetsam active and inactive limits, when using roots */
 
 #if PRIVATE
-#define MEMORYSTATUS_CMD_SET_JETSAM_SNAPSHOT_OWNERSHIP 23 /* Used by unit tests in the development kernel only. */
+#define MEMORYSTATUS_CMD_SET_TESTING_PID 23 /* Used by unit tests in the development kernel only. */
 #endif /* PRIVATE */
 
+#define MEMORYSTATUS_CMD_GET_PROCESS_IS_FROZEN 24 /* Check if the process is frozen. */
+
 /* Commands that act on a group of processes */
 #define MEMORYSTATUS_CMD_GRP_SET_PROPERTIES           100
 
@@ -385,8 +402,8 @@ typedef struct memorystatus_jetsam_panic_options {
 #define MEMORYSTATUS_FLAGS_GRP_SET_PROBABILITY          0x10    /* Set probability of use for a group of processes */
 
 #if PRIVATE
-#define MEMORYSTATUS_FLAGS_SNAPSHOT_TAKE_OWNERSHIP      0x20 /* Only used by xnu unit tests. */
-#define MEMORYSTATUS_FLAGS_SNAPSHOT_DROP_OWNERSHIP      0x40 /* Only used by xnu unit tests. */
+#define MEMORYSTATUS_FLAGS_SET_TESTING_PID     0x20 /* Only used by xnu unit tests. */
+#define MEMORYSTATUS_FLAGS_UNSET_TESTING_PID   0x40 /* Only used by xnu unit tests. */
 #endif /* PRIVATE */
 
 #define MEMORYSTATUS_FLAGS_SNAPSHOT_FREEZER             0x80    /* A snapshot buffer containing app kills since last consumption */
@@ -505,7 +522,6 @@ typedef struct memorystatus_memlimit_properties2 {
 #define P_MEMSTAT_PRIORITY_ASSERTION              0x00020000   /* jetsam priority is being driven by an assertion */
 #define P_MEMSTAT_FREEZE_CONSIDERED               0x00040000   /* This process has been considered for the freezer. */
 
-
 /*
  * p_memstat_relaunch_flags holds
  *      - relaunch behavior when jetsammed