Loading...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | /* * Copyright (c) 2000-2025 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #include "mocks/std_safe.h" #include "mocks/mock_dynamic.h" #include <vm/vm_kern_xnu.h> #include <vm/vm_map_xnu.h> #include <vm/vm_object_internal.h> #include <vm/vm_page.h> #include <mach/dyld_pager.h> #pragma once T_MOCK_DECLARE(vm_page_t, vm_page_find_canonical, (ppnum_t pnum)); T_MOCK_DECLARE(vm_page_t, vm_page_grab_options, (vm_grab_options_t grab_options)); T_MOCK_DECLARE(void, vm_page_wakeup_done, (vm_object_t object, vm_page_t m)); T_MOCK_DECLARE(kern_return_t, cpm_allocate, (vm_size_t size, vm_page_t * list, ppnum_t max_pnum, ppnum_t pnum_mask, boolean_t wire, int flags)); T_MOCK_DECLARE(kern_return_t, memory_object_map, (memory_object_t memory_object, vm_prot_t prot)); T_MOCK_DECLARE(void, memory_object_last_unmap, (memory_object_t memory_object)); T_MOCK_DECLARE(void, vm_fault_unwire, (vm_map_t map, vm_map_entry_t entry, bool deallocate, pmap_t pmap, vm_map_offset_t pmap_addr, vm_map_offset_t end_addr)); T_MOCK_DECLARE(kern_return_t, vm_map_entry_cs_associate, (vm_map_t map, vm_map_entry_t entry, vm_map_kernel_flags_t vmk_flags)); T_MOCK_DECLARE(kern_return_t, vm_map_wire_kernel, (vm_map_t map, vm_map_offset_ut start_u, vm_map_offset_ut end_u, vm_prot_ut prot_u, vm_tag_t tag, boolean_t user_wire)); T_MOCK_DECLARE(boolean_t, vm_object_sync, (vm_object_t object, vm_object_offset_t offset, vm_object_size_t size, boolean_t should_flush, boolean_t should_return, boolean_t should_iosync)); T_MOCK_DECLARE(kern_return_t, vm_superpage_size, (unsigned int superpage_size, vm_map_size_t * size)); T_MOCK_DECLARE( memory_object_t, dyld_pager_setup, ( task_t task, vm_object_t backing_object, struct mwl_region *regions, uint32_t region_cnt, void *link_info, uint32_t link_info_size)); T_MOCK_DECLARE(kern_return_t, vm_fault_attempt_pmap_enter, ( pmap_t pmap, vm_map_offset_t vaddr, vm_map_size_t fault_page_size, vm_map_offset_t fault_phys_offset, vm_page_t m, vm_prot_t * prot, vm_prot_t caller_prot, vm_prot_t fault_type, bool wired, int pmap_options)); T_MOCK_DECLARE(kern_return_t, vm_fault_enter_prepare, ( vm_page_t m, pmap_t pmap, vm_map_offset_t vaddr, vm_prot_t * prot, vm_prot_t caller_prot, vm_map_size_t fault_page_size, vm_map_offset_t fault_phys_offset, vm_prot_t fault_type, vm_object_fault_info_t fault_info, int *type_of_fault, bool *page_needs_data_sync)); T_MOCK_DECLARE( kern_return_t, vm_object_zero, ( vm_object_t object, vm_object_offset_t * cur_offset_p, vm_object_offset_t end_offset)); T_MOCK_DECLARE( wait_result_t, vm_page_sleep, ( vm_object_t object, vm_page_t m, wait_interrupt_t interruptible, lck_sleep_action_t action)); T_MOCK_DECLARE( kern_return_t, mach_vm_deallocate_kernel, ( vm_map_t target, mach_vm_address_t address, mach_vm_size_t size )); T_MOCK_DECLARE( kern_return_t, mach_vm_protect, ( vm_map_t target_task, mach_vm_address_t address, mach_vm_size_t size, boolean_t set_maximum, vm_prot_t new_protection )); T_MOCK_DECLARE( kern_return_t, mach_vm_remap_new_kernel, ( vm_map_t target_map, mach_vm_offset_ut * address, mach_vm_size_ut size, mach_vm_offset_ut mask, vm_map_kernel_flags_t vmk_flags, vm_map_t src_map, mach_vm_offset_ut memory_address, boolean_t copy, vm_prot_ut * cur_protection, vm_prot_ut * max_protection, vm_inherit_ut inheritance )); T_MOCK_DECLARE( kern_return_t, vm_map_unwire, ( vm_map_t map, vm_map_offset_ut start_u, vm_map_offset_ut end_u, boolean_t user_wire )); T_MOCK_DECLARE( boolean_t, vm_object_coalesce, ( vm_object_t prev_object, vm_object_t next_object, vm_object_offset_t prev_offset, vm_object_offset_t next_offset, vm_object_size_t prev_size, vm_object_size_t next_size )); T_MOCK_DECLARE( uint32_t, vmgo_chunk_select_random_slot, ( vm_guard_object_chunk_t chunk )); |