+#define MIN_SLIDE_INFO_SIZE \
+ MIN(sizeof(struct vm_shared_region_slide_info_entry_v2), \
+ MIN(sizeof(struct vm_shared_region_slide_info_entry_v3), \
+ sizeof(struct vm_shared_region_slide_info_entry_v4)))
+
+/*
+ * This is the information used by the shared cache pager for sub-sections
+ * which must be modified for relocations and/or pointer authentications
+ * before it can be used. The shared_region_pager gets source pages from
+ * the shared cache file and modifies them -- see shared_region_pager_data_request().
+ *
+ * A single pager may be used from multiple shared regions provided:
+ * - same si_slide_object, si_start, si_end, si_slide, si_ptrauth and si_jop_key
+ * - The size and contents of si_slide_info_entry are the same.
+ */
+typedef struct vm_shared_region_slide_info {
+ uint32_t si_slide; /* the distance that the file data is relocated */
+ bool si_slid;
+#if __has_feature(ptrauth_calls)
+ bool si_ptrauth;
+ uint64_t si_jop_key;
+ struct vm_shared_region *si_shared_region; /* so we can ref/dealloc for authenticated slide info */
+#endif /* __has_feature(ptrauth_calls) */
+ mach_vm_address_t si_slid_address;
+ mach_vm_offset_t si_start; /* start offset in si_slide_object */
+ mach_vm_offset_t si_end;
+ vm_object_t si_slide_object; /* The source object for the pages to be modified */
+ mach_vm_size_t si_slide_info_size; /* size of dyld provided relocation information */
+ vm_shared_region_slide_info_entry_t si_slide_info_entry; /* dyld provided relocation information */
+} *vm_shared_region_slide_info_t;
+
+/*
+ * Data structure that represents a unique shared cache region.
+ */