Lines Matching refs:size

407 void assert_deallocate_success(mach_vm_address_t address, mach_vm_size_t size);
413 check_fixed_address(mach_vm_address_t *address, mach_vm_size_t size) in check_fixed_address() argument
417 *address + size <= fixed_vm_address + fixed_vm_size) { in check_fixed_address()
425 wrapper_mach_vm_allocate(vm_map_t map, mach_vm_address_t * address, mach_vm_size_t size, int flags) in wrapper_mach_vm_allocate() argument
427 check_fixed_address(address, size); in wrapper_mach_vm_allocate()
428 return mach_vm_allocate(map, address, size, flags); in wrapper_mach_vm_allocate()
432 wrapper_mach_vm_map(vm_map_t map, mach_vm_address_t * address, mach_vm_size_t size, int flags) in wrapper_mach_vm_map() argument
434 check_fixed_address(address, size); in wrapper_mach_vm_map()
435 …return mach_vm_map(map, address, size, (mach_vm_offset_t)0, flags, MACH_PORT_NULL, (memory_object_… in wrapper_mach_vm_map()
441 wrapper_mach_vm_map_4kB(vm_map_t map, mach_vm_address_t * address, mach_vm_size_t size, int flags) in wrapper_mach_vm_map_4kB() argument
443 check_fixed_address(address, size); in wrapper_mach_vm_map_4kB()
444 …return mach_vm_map(map, address, size, (mach_vm_offset_t)0xFFF, flags, MACH_PORT_NULL, (memory_obj… in wrapper_mach_vm_map_4kB()
449 wrapper_mach_vm_map_2MB(vm_map_t map, mach_vm_address_t * address, mach_vm_size_t size, int flags) in wrapper_mach_vm_map_2MB() argument
451 check_fixed_address(address, size); in wrapper_mach_vm_map_2MB()
452 …return mach_vm_map(map, address, size, (mach_vm_offset_t)0x1FFFFF, flags, MACH_PORT_NULL, (memory_… in wrapper_mach_vm_map_2MB()
457 memory_entry(mach_vm_size_t * size, mach_port_t *object_handle) in memory_entry() argument
459 mach_vm_size_t original_size = *size; in memory_entry()
462 kr = mach_make_memory_entry_64(mach_task_self(), size, in memory_entry()
468 T_QUIET; T_ASSERT_EQ(*size, round_page(original_size), in memory_entry()
473 (uintmax_t)*size, (uintmax_t)*size, (uintmax_t)original_size, (uintmax_t)original_size); in memory_entry()
478 wrapper_mach_vm_map_named_entry(vm_map_t map, mach_vm_address_t * address, mach_vm_size_t size, int… in wrapper_mach_vm_map_named_entry() argument
481 kern_return_t kr = memory_entry(&size, &object_handle); in wrapper_mach_vm_map_named_entry()
486 check_fixed_address(address, size); in wrapper_mach_vm_map_named_entry()
487 …kr = mach_vm_map(map, address, size, (mach_vm_offset_t)0, flags, object_handle, (memory_object_off… in wrapper_mach_vm_map_named_entry()
515 mach_vm_size_t size; member
611 set_vm_size(mach_vm_size_t size) in set_vm_size() argument
613 _vm_size = size; in set_vm_size()
659 set_buffer_size(mach_vm_size_t size) in set_buffer_size() argument
661 _buffer_size = size; in set_buffer_size()
776 vm_sizes[0].size = options.to_vmsize; in process_options()
831 aligned_size(mach_vm_address_t address, mach_vm_size_t size) in aligned_size() argument
833 return round_page(address - mach_vm_trunc_page(address) + size); in aligned_size()
874 assert_allocate_return(mach_vm_address_t * address, mach_vm_size_t size, int address_flag, kern_ret… in assert_allocate_return() argument
876 …assert_mach_return(get_allocator()(mach_task_self(), address, size, address_flag), expected_kr, "A… in assert_allocate_return()
880 assert_allocate_success(mach_vm_address_t * address, mach_vm_size_t size, int address_flag) in assert_allocate_success() argument
882 assert_allocate_return(address, size, address_flag, KERN_SUCCESS); in assert_allocate_success()
886 assert_deallocate_return(mach_vm_address_t address, mach_vm_size_t size, kern_return_t expected_kr) in assert_deallocate_return() argument
888 …assert_mach_return(mach_vm_deallocate(mach_task_self(), address, size), expected_kr, "mach_vm_deal… in assert_deallocate_return()
892 assert_deallocate_success(mach_vm_address_t address, mach_vm_size_t size) in assert_deallocate_success() argument
894 assert_deallocate_return(address, size, KERN_SUCCESS); in assert_deallocate_success()
899 mach_vm_size_t size, in assert_read_return() argument
904 …assert_mach_return(mach_vm_read(mach_task_self(), address, size, data, data_size), expected_kr, "m… in assert_read_return()
908 assert_read_success(mach_vm_address_t address, mach_vm_size_t size, vm_offset_t * data, mach_msg_ty… in assert_read_success() argument
910 assert_read_return(address, size, data, data_size, KERN_SUCCESS); in assert_read_success()
911 T_QUIET; T_ASSERT_EQ(*data_size, size, in assert_read_success()
915 (uintmax_t)*data_size, (uintmax_t)*data_size, (uintmax_t)size, (uintmax_t)size); in assert_read_success()
931 assert_allocate_copy_return(mach_vm_address_t source, mach_vm_size_t size, mach_vm_address_t * dest… in assert_allocate_copy_return() argument
933 assert_allocate_success(dest, size, VM_FLAGS_ANYWHERE); in assert_allocate_copy_return()
934 …assert_mach_return(mach_vm_copy(mach_task_self(), source, size, *dest), expected_kr, "mach_vm_copy… in assert_allocate_copy_return()
937 assert_allocate_copy_success(mach_vm_address_t source, mach_vm_size_t size, mach_vm_address_t * des… in assert_allocate_copy_success() argument
939 assert_allocate_copy_return(source, size, dest, KERN_SUCCESS); in assert_allocate_copy_success()
943 assert_copy_return(mach_vm_address_t source, mach_vm_size_t size, mach_vm_address_t dest, kern_retu… in assert_copy_return() argument
945 …assert_mach_return(mach_vm_copy(mach_task_self(), source, size, dest), expected_kr, "mach_vm_copy(… in assert_copy_return()
949 assert_copy_success(mach_vm_address_t source, mach_vm_size_t size, mach_vm_address_t dest) in assert_copy_success() argument
951 assert_copy_return(source, size, dest, KERN_SUCCESS); in assert_copy_success()
967 mach_vm_size_t size, in filter_addresses_do_else() argument
973 for (i = 0; i + vm_address_size < size; i += vm_address_size) { in filter_addresses_do_else()
1041 get_fixed_address(mach_vm_size_t size) in get_fixed_address() argument
1050 if (size != 0) { in get_fixed_address()
1051 size = round_page(size + 2 * vm_page_size); in get_fixed_address()
1054 assert_allocate_success(&address, size, VM_FLAGS_ANYWHERE); in get_fixed_address()
1064 fixed_vm_size = size; in get_fixed_address()
1073 set_up_vm_address(mach_vm_size_t size) in set_up_vm_address() argument
1085 aligned ? "" : "un", (uintmax_t)size, (uintmax_t)size, (size == 1) ? "" : "s"); in set_up_vm_address()
1086 mach_vm_address_t address = get_fixed_address(size); in set_up_vm_address()
1104 set_vm_size(vm_sizes[sizes_idx].size); in set_up_vm_size()
1111 set_buffer_size(vm_sizes[buffer_sizes_idx].size); in set_up_buffer_size()
1169 allocate(mach_vm_size_t size) in allocate() argument
1174 logv("Allocating 0x%jx (%ju) byte%s", (uintmax_t)size, (uintmax_t)size, (size == 1) ? "" : "s"); in allocate()
1179 assert_allocate_success(&address, size, flag); in allocate()
1183 (uintmax_t)round_page(size), (uintmax_t)round_page(size), (uintmax_t)address); in allocate()
1283 deallocate_range(mach_vm_address_t address, mach_vm_size_t size) in deallocate_range() argument
1285 …llocating 0x%jx (%ju) byte%s at address 0x%jx...", (uintmax_t)size, (uintmax_t)size, (size == 1) ?… in deallocate_range()
1287 assert_deallocate_success(address, size); in deallocate_range()
1324 mach_vm_size_t size = get_vm_size(); in read_deallocate() local
1329 …logv("Reading 0x%jx (%ju) byte%s at address 0x%jx...", (uintmax_t)size, (uintmax_t)size, (size == … in read_deallocate()
1331 assert_read_success(address, size, &read_address, &read_size); in read_deallocate()
1339 deallocate_range(mach_vm_trunc_page(address), size + 1); in read_deallocate()
1400 mach_vm_size_t size = get_vm_size(); in copy_deallocate() local
1404 …logv("Copying 0x%jx (%ju) byte%s at address 0x%jx...", (uintmax_t)size, (uintmax_t)size, (size == … in copy_deallocate()
1406 assert_allocate_copy_success(source, size, &dest); in copy_deallocate()
1410 (uintmax_t)size, (uintmax_t)size, (uintmax_t)dest); in copy_deallocate()
1414 deallocate_range(mach_vm_trunc_page(source), size + 1); in copy_deallocate()
1422 set_vm_size(size); in copy_deallocate()
1431 mach_msg_type_number_t size = (mach_msg_type_number_t)get_buffer_size(); in copy_region() local
1436 (uintmax_t)source, (uintmax_t)size, (uintmax_t)size, (uintmax_t)dest); in copy_region()
1437 assert_copy_success(source, size, dest); in copy_region()
1467 mach_vm_size_t size = get_vm_size(); in set_up_vm_variables_allocate_protect() local
1473 protection_name, (uintmax_t)size, (uintmax_t)size, (size == 1) ? "" : "s", (uintmax_t)address); in set_up_vm_variables_allocate_protect()
1474 …T_QUIET; T_ASSERT_MACH_SUCCESS(mach_vm_protect(mach_task_self(), address, size, FALSE, protection)… in set_up_vm_variables_allocate_protect()
1499 mach_vm_size_t size = get_vm_size(); in test_nonzero_address_iff_nonzero_size() local
1501 …T_QUIET; T_ASSERT_TRUE((address && size) || (!address && !size), "Address 0x%jx is unexpectedly %s… in test_nonzero_address_iff_nonzero_size()
1503 logv("Address 0x%jx is %szero as expected.", (uintmax_t)address, size ? "non" : ""); in test_nonzero_address_iff_nonzero_size()
1522 …address_filter_t filter, boolean_t reversed, mach_vm_address_t address, mach_vm_size_t size, const… in verify_pattern() argument
1527 pattern_name, (uintmax_t)address, (uintmax_t)size, (uintmax_t)size); in verify_pattern()
1528 filter_addresses_do_else(filter, reversed, address, size, verify_address, read_zero, address); in verify_pattern()
1534 …address_filter_t filter, boolean_t reversed, mach_vm_address_t address, mach_vm_size_t size, const… in write_pattern() argument
1539 pattern_name, (uintmax_t)address, (uintmax_t)size, (uintmax_t)size); in write_pattern()
1540 filter_addresses_do_else(filter, reversed, address, size, write_address, no_action, address); in write_pattern()
1546 …address_filter_t filter, boolean_t reversed, mach_vm_address_t address, mach_vm_size_t size, const… in write_and_verify_pattern() argument
1551 pattern_name, (uintmax_t)address, (uintmax_t)size, (uintmax_t)size); in write_and_verify_pattern()
1552 filter_addresses_do_else(filter, reversed, address, size, write_address, no_action, address); in write_and_verify_pattern()
1553 filter_addresses_do_else(filter, reversed, address, size, verify_address, read_zero, address); in write_and_verify_pattern()
1608 mach_vm_size_t size = aligned_size(get_vm_address(), get_vm_size()); in test_reallocate_pages() local
1615 (uintmax_t)address, (uintmax_t)size, (uintmax_t)size); in test_reallocate_pages()
1616 for (i = address; i < address + size; i += vm_page_size) { in test_reallocate_pages()
1632 mach_vm_size_t size = get_vm_size(); in test_allocate_in_null_map() local
1635 logv("Allocating 0x%jx (%ju) byte%s", (uintmax_t)size, (uintmax_t)size, (size == 1) ? "" : "s"); in test_allocate_in_null_map()
1640 …assert_mach_return(get_allocator()(VM_MAP_NULL, &address, size, flag), MACH_SEND_INVALID_DEST, "Al… in test_allocate_in_null_map()
1651 mach_vm_size_t size = get_vm_size(); in test_allocate_with_kernel_flags() local
1657 logv("Allocating 0x%jx (%ju) byte%s", (uintmax_t)size, (uintmax_t)size, (size == 1) ? "" : "s"); in test_allocate_with_kernel_flags()
1671 kr = allocator(this_task, &address, size, bad_flag); in test_allocate_with_kernel_flags()
1688 mach_vm_size_t size = get_vm_size(); in test_allocate_superpage_with_incompatible_flags() local
1694 logv("Allocating 0x%jx (%ju) byte%s", (uintmax_t)size, (uintmax_t)size, (size == 1) ? "" : "s"); in test_allocate_superpage_with_incompatible_flags()
1708 kr = allocator(this_task, &address, size, bad_flag); in test_allocate_superpage_with_incompatible_flags()
1730 mach_vm_size_t size = get_vm_size(); in test_mach_vm_map_protection_inheritance_error() local
1742 assert_mach_success(memory_entry(&size, &object_handle), "mach_make_memory_entry_64()"); in test_mach_vm_map_protection_inheritance_error()
1744 logv("Allocating 0x%jx (%ju) byte%s", (uintmax_t)size, (uintmax_t)size, (size == 1) ? "" : "s"); in test_mach_vm_map_protection_inheritance_error()
1759 …kr = mach_vm_map(my_task, &address, size, mask, flag, object_handle, (memory_object_offset_t)0, FA… in test_mach_vm_map_protection_inheritance_error()
1780 mach_vm_size_t size = get_vm_size(); in test_mach_vm_map_large_mask_overflow_error() local
1784 kern_return_t kr_expected = size ? KERN_NO_SPACE : KERN_INVALID_ARGUMENT; in test_mach_vm_map_large_mask_overflow_error()
1789 (uintmax_t)size, (uintmax_t)size, (size == 1) ? "" : "s", (uintmax_t)address, (uintmax_t)mask); in test_mach_vm_map_large_mask_overflow_error()
1790 …assert_mach_return(mach_vm_map(mach_task_self(), &address, size, mask, VM_FLAGS_ANYWHERE, MACH_POR… in test_mach_vm_map_large_mask_overflow_error()
1801 allocate_edge_size(mach_vm_address_t * address, mach_vm_size_t size, kern_return_t expected_kr) in allocate_edge_size() argument
1803 logv("Allocating 0x%jx (%ju) bytes...", (uintmax_t)size, (uintmax_t)size); in allocate_edge_size()
1804 assert_allocate_return(address, size, VM_FLAGS_ANYWHERE, expected_kr); in allocate_edge_size()
1827 mach_vm_size_t size = (mach_vm_size_t)UINTMAX_MAX - vm_page_size + 1; in test_allocate_invalid_large_size() local
1830 allocate_edge_size(&address, size, KERN_NO_SPACE); in test_allocate_invalid_large_size()
1835 logv("Creating named entry of 0x%jx (%ju) bytes...", (uintmax_t)size, (uintmax_t)size); in test_allocate_invalid_large_size()
1836 assert_mach_return(mach_make_memory_entry_64(mach_task_self(), &size, (memory_object_offset_t)0, in test_allocate_invalid_large_size()
1862 mach_vm_size_t size = get_vm_size(); in test_allocate_at_zero() local
1865 …size ? KERN_INVALID_ADDRESS : (get_allocator() != wrapper_mach_vm_allocate) ? KERN_INVALID_ARGUMEN… in test_allocate_at_zero()
1867 …logv("Allocating 0x%jx (%ju) byte%s at address 0x0...", (uintmax_t)size, (uintmax_t)size, (size ==… in test_allocate_at_zero()
1868 assert_allocate_return(&address, size, VM_FLAGS_FIXED, kr_expected); in test_allocate_at_zero()
1876 deallocate_range(address, size); in test_allocate_at_zero()
1885 mach_vm_size_t size = get_vm_size(); in test_allocate_2MB_boundary_unaligned_page_aligned_address() local
1887 mach_vm_address_t address = get_fixed_address(size + vm_page_size) + vm_page_size; in test_allocate_2MB_boundary_unaligned_page_aligned_address()
1895 kern_return_t kr_expected = (!size && get_allocator() != wrapper_mach_vm_allocate) in test_allocate_2MB_boundary_unaligned_page_aligned_address()
1898 …logv("Allocating 0x%jx (%ju) byte%s at address 0x%jx...", (uintmax_t)size, (uintmax_t)size, (size … in test_allocate_2MB_boundary_unaligned_page_aligned_address()
1900 assert_allocate_return(&address, size, VM_FLAGS_FIXED, kr_expected); in test_allocate_2MB_boundary_unaligned_page_aligned_address()
1903 deallocate_range(address, size); in test_allocate_2MB_boundary_unaligned_page_aligned_address()
2022 mach_vm_size_t size = (mach_vm_size_t)UINTMAX_MAX - vm_page_size + 1; in test_deallocate_suicide() local
2024 …logv("Deallocating 0x%jx (%ju) bytes at address 0x%jx...", (uintmax_t)size, (uintmax_t)size, (uint… in test_deallocate_suicide()
2025 kern_return_t kr = mach_vm_deallocate(mach_task_self(), address, size); in test_deallocate_suicide()
2029 (uintmax_t)address, (uintmax_t)size, (uintmax_t)size, mach_error_string(kr)); in test_deallocate_suicide()
2050 mach_vm_size_t size = get_vm_size(); in test_write_pattern_deallocate_reallocate_zero_filled() local
2052 write_pattern(page_ends, FALSE, address, size, "page ends"); in test_write_pattern_deallocate_reallocate_zero_filled()
2053 …llocating 0x%jx (%ju) byte%s at address 0x%jx...", (uintmax_t)size, (uintmax_t)size, (size == 1) ?… in test_write_pattern_deallocate_reallocate_zero_filled()
2056 assert_allocate_success(&address, size, VM_FLAGS_FIXED); in test_write_pattern_deallocate_reallocate_zero_filled()
2058 verify_pattern(empty, FALSE, address, size, "zero-filled"); in test_write_pattern_deallocate_reallocate_zero_filled()
2103 mach_vm_size_t size; in test_deallocate_rounded_zero_end_ranges() member
2121 kr = mach_vm_deallocate(this_task, ranges[i].address, ranges[i].size); in test_deallocate_rounded_zero_end_ranges()
2126 …(uintmax_t)ranges[i].address, (uintmax_t)ranges[i].size, (uintmax_t)ranges[i].size, mach_error_str… in test_deallocate_rounded_zero_end_ranges()
2140 mach_vm_size_t size; in test_deallocate_wrapped_around_ranges() member
2153 kr = mach_vm_deallocate(this_task, ranges[i].address, ranges[i].size); in test_deallocate_wrapped_around_ranges()
2158 …(uintmax_t)ranges[i].address, (uintmax_t)ranges[i].size, (uintmax_t)ranges[i].size, mach_error_str… in test_deallocate_wrapped_around_ranges()
2169 mach_vm_size_t size = get_vm_size(); in test_deallocate_in_null_map() local
2172 logv("Deallocating 0x%jx (%ju) byte%s", (uintmax_t)size, (uintmax_t)size, (size == 1) ? "" : "s"); in test_deallocate_in_null_map()
2177 …assert_mach_return(mach_vm_deallocate(VM_MAP_NULL, address, size), MACH_SEND_INVALID_DEST, "mach_v… in test_deallocate_in_null_map()
2192 mach_vm_size_t size = get_vm_size(); in test_read_address_offset() local
2194 if (size < vm_page_size * 2 || get_address_alignment()) { in test_read_address_offset()
2215 mach_vm_size_t size = get_vm_size(); in test_read_null_map() local
2222 (uintmax_t)size, (uintmax_t)size, (size == 1) ? "" : "s", (uintmax_t)address); in test_read_null_map()
2223 …assert_mach_return(mach_vm_read(VM_MAP_NULL, address, size, &read_address, &read_size), MACH_SEND_… in test_read_null_map()
2233 mach_vm_size_t size = get_vm_size(); in test_read_partially_deallocated_range() local
2234 mach_vm_address_t mid_point = mach_vm_trunc_page(address + size / 2); in test_read_partially_deallocated_range()
2242 …logv("Reading 0x%jx (%ju) byte%s at address 0x%jx...", (uintmax_t)size, (uintmax_t)size, (size == … in test_read_partially_deallocated_range()
2244 assert_read_return(address, size, &read_address, &read_size, KERN_INVALID_ADDRESS); in test_read_partially_deallocated_range()
2253 mach_vm_size_t size = get_vm_size(); in test_read_partially_unreadable_range() local
2254 mach_vm_address_t mid_point = mach_vm_trunc_page(address + size / 2); in test_read_partially_unreadable_range()
2261 …kern_return_t kr_expected = (size < vm_page_size * 2) ? KERN_INVALID_ADDRESS : KERN_PROTECTION_FAI… in test_read_partially_unreadable_range()
2267 …logv("Reading 0x%jx (%ju) byte%s at address 0x%jx...", (uintmax_t)size, (uintmax_t)size, (size == … in test_read_partially_unreadable_range()
2269 assert_read_return(address, size, &read_address, &read_size, kr_expected); in test_read_partially_unreadable_range()
2278 read_edge_size(mach_vm_size_t size, kern_return_t expected_kr) in read_edge_size() argument
2294 logv("Reading 0x%jx (%ju) bytes at various addresses...", (uintmax_t)size, (uintmax_t)size); in read_edge_size()
2296 kr = mach_vm_read(this_task, addresses[i], size, &read_address, &read_size); in read_edge_size()
2332 mach_vm_size_t size; in test_read_wrapped_around_ranges() member
2347 kr = mach_vm_read(this_task, ranges[i].address, ranges[i].size, &read_address, &read_size); in test_read_wrapped_around_ranges()
2352 …(uintmax_t)ranges[i].address, (uintmax_t)ranges[i].size, (uintmax_t)ranges[i].size, mach_error_str… in test_read_wrapped_around_ranges()
2555 mach_vm_size_t size = get_vm_size(); in pattern_write() local
2565 pattern_name, (uintmax_t)address, (uintmax_t)buffer_size, (uintmax_t)size); in pattern_write()
2598 mach_msg_type_number_t size = (mach_msg_type_number_t)get_buffer_size(); in test_copy_null_map() local
2603 (uintmax_t)dest, (uintmax_t)size, (uintmax_t)size, (uintmax_t)source); in test_copy_null_map()
2604 …assert_mach_return(mach_vm_copy(VM_MAP_NULL, source, size, dest), MACH_SEND_INVALID_DEST, "mach_vm… in test_copy_null_map()
2609 copy_edge_size(mach_vm_size_t size, kern_return_t expected_kr) in copy_edge_size() argument
2626 logv("Allocating 0x%jx (%ju) byte%s...", (uintmax_t)size, (uintmax_t)size, (size == 1) ? "" : "s"); in copy_edge_size()
2628 logv("Copying 0x%jx (%ju) bytes at various addresses...", (uintmax_t)size, (uintmax_t)size); in copy_edge_size()
2630 kr = mach_vm_copy(this_task, addresses[i], size, dest); in copy_edge_size()
2668 mach_vm_size_t size; in test_copy_wrapped_around_ranges() member
2685 kr = mach_vm_copy(this_task, ranges[i].address, ranges[i].size, dest); in test_copy_wrapped_around_ranges()
2690 …(uintmax_t)ranges[i].address, (uintmax_t)ranges[i].size, (uintmax_t)ranges[i].size, mach_error_str… in test_copy_wrapped_around_ranges()
2764 mach_vm_size_t size = get_vm_size(); in test_copy_partially_deallocated_range() local
2765 mach_vm_address_t mid_point = mach_vm_trunc_page(source + size / 2); in test_copy_partially_deallocated_range()
2772 …logv("Copying 0x%jx (%ju) byte%s at address 0x%jx...", (uintmax_t)size, (uintmax_t)size, (size == … in test_copy_partially_deallocated_range()
2775 assert_allocate_copy_return(source, size, &dest, KERN_INVALID_ADDRESS); in test_copy_partially_deallocated_range()
2779 deallocate_range(dest, size); in test_copy_partially_deallocated_range()
2787 mach_vm_size_t size = get_vm_size(); in test_copy_partially_unreadable_range() local
2788 mach_vm_address_t mid_point = mach_vm_trunc_page(source + size / 2); in test_copy_partially_unreadable_range()
2794 kern_return_t kr_expected = (size < vm_page_size) ? KERN_INVALID_ADDRESS : KERN_PROTECTION_FAILURE; in test_copy_partially_unreadable_range()
2800 …logv("Copying 0x%jx (%ju) byte%s at address 0x%jx...", (uintmax_t)size, (uintmax_t)size, (size == … in test_copy_partially_unreadable_range()
2802 assert_allocate_copy_return(source, size, &dest, kr_expected); in test_copy_partially_unreadable_range()
2805 deallocate_range(dest, size); in test_copy_partially_unreadable_range()
2814 mach_msg_type_number_t size = (mach_msg_type_number_t)get_buffer_size(); in test_copy_dest_partially_deallocated_region() local
2815 mach_vm_address_t source_mid_point = (mach_vm_address_t)mach_vm_trunc_page(dest + size / 2); in test_copy_dest_partially_deallocated_region()
2827 (uintmax_t)source, (uintmax_t)size, (uintmax_t)size, (uintmax_t)dest); in test_copy_dest_partially_deallocated_region()
2828 assert_copy_return(source, size, dest, KERN_INVALID_ADDRESS); in test_copy_dest_partially_deallocated_region()
2843 mach_msg_type_number_t size = (mach_msg_type_number_t)get_buffer_size(); in test_copy_source_partially_deallocated_region() local
2844 mach_vm_address_t source_mid_point = (mach_vm_address_t)mach_vm_trunc_page(source + size / 2); in test_copy_source_partially_deallocated_region()
2856 (uintmax_t)source, (uintmax_t)size, (uintmax_t)size, (uintmax_t)dest); in test_copy_source_partially_deallocated_region()
2857 assert_copy_return(source, size, dest, KERN_INVALID_ADDRESS); in test_copy_source_partially_deallocated_region()
2867 mach_msg_type_number_t size = (mach_msg_type_number_t)get_buffer_size(); in test_copy_source_partially_unreadable_region() local
2868 mach_vm_address_t mid_point = (mach_vm_address_t)mach_vm_trunc_page(source + size / 2); in test_copy_source_partially_unreadable_region()
2869 …kern_return_t kr = (size < vm_page_size * 2) ? KERN_INVALID_ADDRESS : KERN_PROTECTION_F… in test_copy_source_partially_unreadable_region()
2881 (uintmax_t)source, (uintmax_t)size, (uintmax_t)size, (uintmax_t)dest); in test_copy_source_partially_unreadable_region()
2883 assert_copy_return(source, size, dest, kr); in test_copy_source_partially_unreadable_region()
2894 mach_msg_type_number_t size = (mach_msg_type_number_t)get_buffer_size(); in test_copy_dest_partially_unwriteable_region() local
2895 mach_vm_address_t mid_point = (mach_vm_address_t)mach_vm_trunc_page(dest + size / 2); in test_copy_dest_partially_unwriteable_region()
2907 (uintmax_t)source, (uintmax_t)size, (uintmax_t)size, (uintmax_t)dest); in test_copy_dest_partially_unwriteable_region()
2908 if (size >= vm_page_size) { in test_copy_dest_partially_unwriteable_region()
2913 assert_copy_return(source, size, dest, kr); in test_copy_dest_partially_unwriteable_region()
2929 mach_msg_type_number_t size = (mach_msg_type_number_t)get_buffer_size(); in test_copy_source_on_partially_deallocated_range() local
2941 (uintmax_t)dest, (uintmax_t)size, (uintmax_t)size, (uintmax_t)source); in test_copy_source_on_partially_deallocated_range()
2942 assert_copy_return(source, size, dest, KERN_INVALID_ADDRESS); in test_copy_source_on_partially_deallocated_range()
2953 mach_msg_type_number_t size = (mach_msg_type_number_t)get_buffer_size(); in test_copy_dest_on_partially_deallocated_range() local
2965 (uintmax_t)dest, (uintmax_t)size, (uintmax_t)size, (uintmax_t)source); in test_copy_dest_on_partially_deallocated_range()
2966 assert_copy_return(source, size, dest, KERN_INVALID_ADDRESS); in test_copy_dest_on_partially_deallocated_range()
2977 mach_msg_type_number_t size = (mach_msg_type_number_t)get_buffer_size(); in test_copy_dest_on_partially_unwritable_range() local
2983 …kern_return_t kr_expected = (size < vm_page_size * 2) ? KERN_INVALID_ADDRESS : KERN_PROTECTION_FAI… in test_copy_dest_on_partially_unwritable_range()
2995 (uintmax_t)dest, (uintmax_t)size, (uintmax_t)size, (uintmax_t)source); in test_copy_dest_on_partially_unwritable_range()
2996 assert_copy_return(source, size, dest, kr_expected); in test_copy_dest_on_partially_unwritable_range()
3007 mach_msg_type_number_t size = (mach_msg_type_number_t)get_buffer_size(); in test_copy_source_on_partially_unreadable_range() local
3013 …kern_return_t kr_expected = (size < vm_page_size * 2) ? KERN_INVALID_ADDRESS : KERN_PROTECTION_FAI… in test_copy_source_on_partially_unreadable_range()
3025 (uintmax_t)dest, (uintmax_t)size, (uintmax_t)size, (uintmax_t)source); in test_copy_source_on_partially_unreadable_range()
3026 assert_copy_return(source, size, dest, kr_expected); in test_copy_source_on_partially_unreadable_range()
3046 mach_vm_size_t size = get_vm_size(); in test_zero_filled_readprotect() local
3048 …("Setting read access on 0x%jx (%ju) byte%s at address 0x%jx...", (uintmax_t)size, (uintmax_t)size, in test_zero_filled_readprotect()
3049 (size == 1) ? "" : "s", (uintmax_t)address); in test_zero_filled_readprotect()
3050 …T_QUIET; T_ASSERT_MACH_SUCCESS(mach_vm_protect(mach_task_self(), address, size, FALSE, VM_PROT_DEF… in test_zero_filled_readprotect()
3059 mach_vm_size_t size = get_vm_size(); in verify_protection() local
3060 mach_vm_size_t original_size = size; in verify_protection()
3068 protection_name, (uintmax_t)address, (uintmax_t)size, (uintmax_t)size); in verify_protection()
3070 …mach_vm_region(mach_task_self(), &address, &size, VM_REGION_BASIC_INFO_64, (vm_region_info_t)&info… in verify_protection()
3225 mach_vm_size_t size; in protect_wrapped_around_ranges() member
3239 kr = mach_vm_protect(this_task, ranges[i].address, ranges[i].size, FALSE, protection); in protect_wrapped_around_ranges()
3244 …(uintmax_t)ranges[i].address, (uintmax_t)ranges[i].size, (uintmax_t)ranges[i].size, mach_error_str… in protect_wrapped_around_ranges()
3270 mach_vm_size_t size = get_vm_size(); in assert_share_mode() local
3282 share_mode_name, (uintmax_t)address, (uintmax_t)size, (uintmax_t)size); in assert_share_mode()
3284 …mach_vm_region(mach_task_self(), &address, &size, VM_REGION_EXTENDED_INFO, (vm_region_info_t)&info… in assert_share_mode()
3301 mach_vm_size_t size = get_vm_size(); in assert_vmcopy_success() local
3304 kr = mach_vm_copy(mach_task_self(), src, size, dst); in assert_vmcopy_success()
3309 (uintmax_t)src, (uintmax_t)dst, (uintmax_t)size, (uintmax_t)size, mach_error_string(kr), in assert_vmcopy_success()
3317 mach_vm_size_t size = get_vm_size(); in write_region() local
3319 filter_addresses_do_else(empty, FALSE, address, size, write_address, write_address, start); in write_region()
3325 mach_vm_size_t size = get_vm_size(); in verify_region() local
3327 filter_addresses_do_else(empty, FALSE, address, size, verify_address, verify_address, start); in verify_region()
3334 mach_vm_size_t size = get_vm_size(); in modify_one_and_verify_all_regions() local
3379 mach_vm_size_t size = get_vm_size(); in test_vmcopy_fresh_source() local
3388 assert_allocate_success(&src, size, TRUE); in test_vmcopy_fresh_source()
3394 assert_allocate_success(&dst, size, TRUE); in test_vmcopy_fresh_source()
3400 assert_deallocate_success(src, size); in test_vmcopy_fresh_source()
3401 assert_deallocate_success(dst, size); in test_vmcopy_fresh_source()
3408 mach_vm_size_t size = get_vm_size(); in test_vmcopy_shared_source() local
3413 assert_allocate_success(&src, size, TRUE); in test_vmcopy_shared_source()
3415 …T_QUIET; T_ASSERT_MACH_SUCCESS(mach_vm_inherit(mach_task_self(), src, size, VM_INHERIT_SHARE), "ma… in test_vmcopy_shared_source()
3424 assert_allocate_success(&dst, size, TRUE); in test_vmcopy_shared_source()
3438 assert_deallocate_success(dst, size); in test_vmcopy_shared_source()
3455 assert_deallocate_success(src, size); in test_vmcopy_shared_source()
3462 mach_vm_size_t size = get_vm_size(); in test_vmcopy_copied_from_source() local
3465 assert_allocate_success(&copied, size, TRUE); in test_vmcopy_copied_from_source()
3468 assert_allocate_success(&src, size, TRUE); in test_vmcopy_copied_from_source()
3470 …T_QUIET; T_ASSERT_MACH_SUCCESS(mach_vm_copy(mach_task_self(), copied, size, src), "mach_vm_copy()"… in test_vmcopy_copied_from_source()
3474 assert_allocate_success(&dst, size, TRUE); in test_vmcopy_copied_from_source()
3480 assert_deallocate_success(src, size); in test_vmcopy_copied_from_source()
3481 assert_deallocate_success(dst, size); in test_vmcopy_copied_from_source()
3482 assert_deallocate_success(copied, size); in test_vmcopy_copied_from_source()
3489 mach_vm_size_t size = get_vm_size(); in test_vmcopy_copied_to_source() local
3492 assert_allocate_success(&src, size, TRUE); in test_vmcopy_copied_to_source()
3495 assert_allocate_success(&copied, size, TRUE); in test_vmcopy_copied_to_source()
3497 …T_QUIET; T_ASSERT_MACH_SUCCESS(mach_vm_copy(mach_task_self(), src, size, copied), "mach_vm_copy()"… in test_vmcopy_copied_to_source()
3501 assert_allocate_success(&dst, size, TRUE); in test_vmcopy_copied_to_source()
3507 assert_deallocate_success(src, size); in test_vmcopy_copied_to_source()
3508 assert_deallocate_success(dst, size); in test_vmcopy_copied_to_source()
3509 assert_deallocate_success(copied, size); in test_vmcopy_copied_to_source()
3516 mach_vm_size_t size = get_vm_size(); in test_vmcopy_trueshared_source() local
3522 assert_allocate_success(&shared, size, TRUE); in test_vmcopy_trueshared_source()
3525 …T_QUIET; T_ASSERT_MACH_SUCCESS(mach_make_memory_entry_64(mach_task_self(), &size, (memory_object_o… in test_vmcopy_trueshared_source()
3529 …mach_vm_map(mach_task_self(), &src, size, 0, TRUE, mem_obj, 0, FALSE, cur_protect, max_protect, VM… in test_vmcopy_trueshared_source()
3534 assert_allocate_success(&dst, size, TRUE); in test_vmcopy_trueshared_source()
3540 assert_deallocate_success(src, size); in test_vmcopy_trueshared_source()
3541 assert_deallocate_success(dst, size); in test_vmcopy_trueshared_source()
3542 assert_deallocate_success(shared, size); in test_vmcopy_trueshared_source()
3549 mach_vm_size_t size = get_vm_size(); in test_vmcopy_private_aliased_source() local
3554 assert_allocate_success(&shared, size, TRUE); in test_vmcopy_private_aliased_source()
3557 …T_QUIET; T_ASSERT_MACH_SUCCESS(mach_vm_remap(mach_task_self(), &src, size, 0, TRUE, mach_task_self… in test_vmcopy_private_aliased_source()
3563 assert_allocate_success(&dst, size, TRUE); in test_vmcopy_private_aliased_source()
3569 assert_deallocate_success(src, size); in test_vmcopy_private_aliased_source()
3570 assert_deallocate_success(dst, size); in test_vmcopy_private_aliased_source()
3571 assert_deallocate_success(shared, size); in test_vmcopy_private_aliased_source()
3645 vm_sizes[sizes_idx].description, (uintmax_t)vm_sizes[sizes_idx].size, in run_allocate_test_suites()
3646 (uintmax_t)vm_sizes[sizes_idx].size); in run_allocate_test_suites()
3656 vm_sizes[sizes_idx].description, (uintmax_t)vm_sizes[sizes_idx].size, in run_allocate_test_suites()
3657 (uintmax_t)vm_sizes[sizes_idx].size); in run_allocate_test_suites()
3667 vm_sizes[sizes_idx].description, (uintmax_t)vm_sizes[sizes_idx].size, in run_allocate_test_suites()
3668 (uintmax_t)vm_sizes[sizes_idx].size); in run_allocate_test_suites()
3675 …[allocators_idx].description, vm_sizes[sizes_idx].description, (uintmax_t)vm_sizes[sizes_idx].size, in run_allocate_test_suites()
3676 (uintmax_t)vm_sizes[sizes_idx].size); in run_allocate_test_suites()
3696 (uintmax_t)vm_sizes[sizes_idx].size, (uintmax_t)vm_sizes[sizes_idx].size); in run_allocate_test_suites()
3749 vm_sizes[sizes_idx].description, (uintmax_t)vm_sizes[sizes_idx].size, in run_deallocate_test_suites()
3750 (uintmax_t)vm_sizes[sizes_idx].size); in run_deallocate_test_suites()
3758 vm_sizes[sizes_idx].description, (uintmax_t)vm_sizes[sizes_idx].size, in run_deallocate_test_suites()
3759 (uintmax_t)vm_sizes[sizes_idx].size); in run_deallocate_test_suites()
3765 vm_sizes[sizes_idx].description, (uintmax_t)vm_sizes[sizes_idx].size, in run_deallocate_test_suites()
3766 (uintmax_t)vm_sizes[sizes_idx].size); in run_deallocate_test_suites()
3821 vm_sizes[sizes_idx].description, (uintmax_t)vm_sizes[sizes_idx].size, in run_read_test_suites()
3822 (uintmax_t)vm_sizes[sizes_idx].size); in run_read_test_suites()
3828 vm_sizes[sizes_idx].description, (uintmax_t)vm_sizes[sizes_idx].size, in run_read_test_suites()
3829 (uintmax_t)vm_sizes[sizes_idx].size); in run_read_test_suites()
3835 vm_sizes[sizes_idx].description, (uintmax_t)vm_sizes[sizes_idx].size, in run_read_test_suites()
3836 (uintmax_t)vm_sizes[sizes_idx].size); in run_read_test_suites()
3844 vm_sizes[sizes_idx].description, (uintmax_t)vm_sizes[sizes_idx].size, in run_read_test_suites()
3845 (uintmax_t)vm_sizes[sizes_idx].size); in run_read_test_suites()
3896 vm_sizes[sizes_idx].description, (uintmax_t)vm_sizes[sizes_idx].size, in run_write_test_suites()
3897 (uintmax_t)vm_sizes[sizes_idx].size, vm_sizes[buffer_sizes_idx].description, in run_write_test_suites()
3898 (uintmax_t)vm_sizes[buffer_sizes_idx].size, (uintmax_t)vm_sizes[buffer_sizes_idx].size, in run_write_test_suites()
3910 vm_sizes[sizes_idx].description, (uintmax_t)vm_sizes[sizes_idx].size, in run_write_test_suites()
3911 (uintmax_t)vm_sizes[sizes_idx].size, vm_sizes[buffer_sizes_idx].description, in run_write_test_suites()
3912 (uintmax_t)vm_sizes[buffer_sizes_idx].size, (uintmax_t)vm_sizes[buffer_sizes_idx].size, in run_write_test_suites()
3916 if (vm_sizes[sizes_idx].size < vm_sizes[buffer_sizes_idx].size) { in run_write_test_suites()
3925 vm_sizes[sizes_idx].description, (uintmax_t)vm_sizes[sizes_idx].size, in run_write_test_suites()
3926 (uintmax_t)vm_sizes[sizes_idx].size, vm_sizes[buffer_sizes_idx].description, in run_write_test_suites()
3927 (uintmax_t)vm_sizes[buffer_sizes_idx].size, (uintmax_t)vm_sizes[buffer_sizes_idx].size, in run_write_test_suites()
3936 vm_sizes[sizes_idx].description, (uintmax_t)vm_sizes[sizes_idx].size, in run_write_test_suites()
3937 (uintmax_t)vm_sizes[sizes_idx].size, vm_sizes[buffer_sizes_idx].description, in run_write_test_suites()
3938 (uintmax_t)vm_sizes[buffer_sizes_idx].size, (uintmax_t)vm_sizes[buffer_sizes_idx].size, in run_write_test_suites()
3996 vm_sizes[sizes_idx].description, (uintmax_t)vm_sizes[sizes_idx].size, in run_protect_test_suites()
3997 (uintmax_t)vm_sizes[sizes_idx].size); in run_protect_test_suites()
4003 vm_sizes[sizes_idx].description, (uintmax_t)vm_sizes[sizes_idx].size, in run_protect_test_suites()
4004 (uintmax_t)vm_sizes[sizes_idx].size); in run_protect_test_suites()
4015 vm_sizes[sizes_idx].description, (uintmax_t)vm_sizes[sizes_idx].size, in run_protect_test_suites()
4016 (uintmax_t)vm_sizes[sizes_idx].size); in run_protect_test_suites()
4024 vm_sizes[sizes_idx].description, (uintmax_t)vm_sizes[sizes_idx].size, in run_protect_test_suites()
4025 (uintmax_t)vm_sizes[sizes_idx].size); in run_protect_test_suites()
4102 vm_sizes[sizes_idx].description, (uintmax_t)vm_sizes[sizes_idx].size, in run_copy_test_suites()
4103 (uintmax_t)vm_sizes[sizes_idx].size, vm_sizes[buffer_sizes_idx].description, in run_copy_test_suites()
4104 (uintmax_t)vm_sizes[buffer_sizes_idx].size, (uintmax_t)vm_sizes[buffer_sizes_idx].size, in run_copy_test_suites()
4107 if (vm_sizes[sizes_idx].size < vm_sizes[buffer_sizes_idx].size) { in run_copy_test_suites()
4121 vm_sizes[sizes_idx].description, (uintmax_t)vm_sizes[sizes_idx].size, in run_copy_test_suites()
4122 (uintmax_t)vm_sizes[sizes_idx].size, vm_sizes[buffer_sizes_idx].description, in run_copy_test_suites()
4123 (uintmax_t)vm_sizes[buffer_sizes_idx].size, (uintmax_t)vm_sizes[buffer_sizes_idx].size, in run_copy_test_suites()
4132 vm_sizes[sizes_idx].description, (uintmax_t)vm_sizes[sizes_idx].size, in run_copy_test_suites()
4133 (uintmax_t)vm_sizes[sizes_idx].size, vm_sizes[buffer_sizes_idx].description, in run_copy_test_suites()
4134 (uintmax_t)vm_sizes[buffer_sizes_idx].size, (uintmax_t)vm_sizes[buffer_sizes_idx].size, in run_copy_test_suites()
4142 vm_sizes[sizes_idx].description, (uintmax_t)vm_sizes[sizes_idx].size, in run_copy_test_suites()
4143 (uintmax_t)vm_sizes[sizes_idx].size, vm_sizes[buffer_sizes_idx].description, in run_copy_test_suites()
4144 (uintmax_t)vm_sizes[buffer_sizes_idx].size, (uintmax_t)vm_sizes[buffer_sizes_idx].size, in run_copy_test_suites()