* 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
* 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
* 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.
* 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.
* 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,
* 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,
* 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.
* 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.
* Mach Operating System
* Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
* All Rights Reserved.
* Mach Operating System
* Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
* All Rights Reserved.
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*/
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*/
#include <mach/vm_attributes.h>
#include <mach/vm_param.h>
#include <mach/vm_statistics.h>
#include <mach/vm_attributes.h>
#include <mach/vm_param.h>
#include <mach/vm_statistics.h>
maddr = *addr;
result = mach_vm_allocate_external(map, &maddr, size, flags);
*addr = CAST_DOWN_EXPLICIT(vm32_offset_t, maddr);
maddr = *addr;
result = mach_vm_allocate_external(map, &maddr, size, flags);
*addr = CAST_DOWN_EXPLICIT(vm32_offset_t, maddr);
return mach_vm_inherit(map, start, size, new_inheritance);
}
kern_return_t
vm32_protect(
return mach_vm_inherit(map, start, size, new_inheritance);
}
kern_return_t
vm32_protect(
return mach_vm_protect(map, start, size, set_maximum, new_protection);
}
kern_return_t
vm32_machine_attribute(
return mach_vm_protect(map, start, size, set_maximum, new_protection);
}
kern_return_t
vm32_machine_attribute(
- vm_map_t map,
- vm32_address_t addr,
- vm32_size_t size,
- vm_machine_attribute_t attribute,
- vm_machine_attribute_val_t* value) /* IN/OUT */
+ vm_map_t map,
+ vm32_address_t addr,
+ vm32_size_t size,
+ vm_machine_attribute_t attribute,
+ vm_machine_attribute_val_t* value) /* IN/OUT */
return mach_vm_machine_attribute(map, addr, size, attribute, value);
}
kern_return_t
vm32_read(
return mach_vm_machine_attribute(map, addr, size, attribute, value);
}
kern_return_t
vm32_read(
{
return mach_vm_read(map, addr, size, data, data_size);
}
kern_return_t
vm32_read_list(
{
return mach_vm_read(map, addr, size, data, data_size);
}
kern_return_t
vm32_read_list(
data_list[i].address = CAST_DOWN_EXPLICIT(vm32_address_t, mdata_list[i].address);
data_list[i].size = CAST_DOWN_EXPLICIT(vm32_size_t, mdata_list[i].size);
}
data_list[i].address = CAST_DOWN_EXPLICIT(vm32_address_t, mdata_list[i].address);
data_list[i].size = CAST_DOWN_EXPLICIT(vm32_size_t, mdata_list[i].size);
}
- vm_map_t map,
- vm32_address_t address,
- vm32_size_t size,
- vm32_address_t data,
- vm32_size_t *data_size)
+ vm_map_t map,
+ vm32_address_t address,
+ vm32_size_t size,
+ vm32_address_t data,
+ vm32_size_t *data_size)
- result = mach_vm_read_overwrite(map, address, size, data, &mdata_size);
+ result = mach_vm_read_overwrite(map, address, size, data, &mdata_size);
- vm_map_t map,
- vm32_address_t address,
- pointer_t data,
- mach_msg_type_number_t size)
+ vm_map_t map,
+ vm32_address_t address,
+ pointer_t data,
+ mach_msg_type_number_t size)
{
return mach_vm_write(map, address, data, size);
}
kern_return_t
vm32_copy(
{
return mach_vm_write(map, address, data, size);
}
kern_return_t
vm32_copy(
- vm_map_t map,
- vm32_address_t source_address,
- vm32_size_t size,
- vm32_address_t dest_address)
+ vm_map_t map,
+ vm32_address_t source_address,
+ vm32_size_t size,
+ vm32_address_t dest_address)
{
return mach_vm_copy(map, source_address, size, dest_address);
}
kern_return_t
vm32_map_64(
{
return mach_vm_copy(map, source_address, size, dest_address);
}
kern_return_t
vm32_map_64(
- vm_map_t target_map,
- vm32_offset_t *address,
- vm32_size_t size,
- vm32_offset_t mask,
- int flags,
- ipc_port_t port,
- vm_object_offset_t offset,
- boolean_t copy,
- vm_prot_t cur_protection,
- vm_prot_t max_protection,
- vm_inherit_t inheritance)
+ vm_map_t target_map,
+ vm32_offset_t *address,
+ vm32_size_t size,
+ vm32_offset_t mask,
+ int flags,
+ ipc_port_t port,
+ vm_object_offset_t offset,
+ boolean_t copy,
+ vm_prot_t cur_protection,
+ vm_prot_t max_protection,
+ vm_inherit_t inheritance)
maddress = *address;
result = mach_vm_map_external(target_map, &maddress, size, mask,
maddress = *address;
result = mach_vm_map_external(target_map, &maddress, size, mask,
- flags, port, offset, copy,
- cur_protection, max_protection, inheritance);
+ flags, port, offset, copy,
+ cur_protection, max_protection, inheritance);
- vm_map_t target_map,
- vm32_offset_t *address,
- vm32_size_t size,
- vm32_offset_t mask,
- int flags,
- ipc_port_t port,
- vm32_offset_t offset,
- boolean_t copy,
- vm_prot_t cur_protection,
- vm_prot_t max_protection,
- vm_inherit_t inheritance)
+ vm_map_t target_map,
+ vm32_offset_t *address,
+ vm32_size_t size,
+ vm32_offset_t mask,
+ int flags,
+ ipc_port_t port,
+ vm32_offset_t offset,
+ boolean_t copy,
+ vm_prot_t cur_protection,
+ vm_prot_t max_protection,
+ vm_inherit_t inheritance)
{
return vm32_map_64(target_map, address, size, mask,
{
return vm32_map_64(target_map, address, size, mask,
- flags, port, offset, copy,
- cur_protection, max_protection, inheritance);
+ flags, port, offset, copy,
+ cur_protection, max_protection, inheritance);
- vm_map_t target_map,
- vm32_offset_t *address,
- vm32_size_t size,
- vm32_offset_t mask,
- boolean_t anywhere,
- vm_map_t src_map,
- vm32_offset_t memory_address,
- boolean_t copy,
- vm_prot_t *cur_protection,
- vm_prot_t *max_protection,
- vm_inherit_t inheritance)
+ vm_map_t target_map,
+ vm32_offset_t *address,
+ vm32_size_t size,
+ vm32_offset_t mask,
+ boolean_t anywhere,
+ vm_map_t src_map,
+ vm32_offset_t memory_address,
+ boolean_t copy,
+ vm_prot_t *cur_protection,
+ vm_prot_t *max_protection,
+ vm_inherit_t inheritance)
maddress = *address;
result = mach_vm_remap_external(target_map, &maddress, size, mask,
maddress = *address;
result = mach_vm_remap_external(target_map, &maddress, size, mask,
- anywhere, src_map, memory_address, copy,
- cur_protection, max_protection, inheritance);
+ anywhere, src_map, memory_address, copy,
+ cur_protection, max_protection, inheritance);
{
return mach_vm_msync(map, address, size, sync_flags);
}
{
return mach_vm_msync(map, address, size, sync_flags);
}
return mach_vm_behavior_set(map, start, size, new_behavior);
}
kern_return_t
vm32_region_64(
return mach_vm_behavior_set(map, start, size, new_behavior);
}
kern_return_t
vm32_region_64(
- vm_map_t map,
- vm32_offset_t *address, /* IN/OUT */
- vm32_size_t *size, /* OUT */
- vm_region_flavor_t flavor, /* IN */
- vm_region_info_t info, /* OUT */
- mach_msg_type_number_t *count, /* IN/OUT */
- mach_port_t *object_name) /* OUT */
+ vm_map_t map,
+ vm32_offset_t *address, /* IN/OUT */
+ vm32_size_t *size, /* OUT */
+ vm_region_flavor_t flavor, /* IN */
+ vm_region_info_t info, /* OUT */
+ mach_msg_type_number_t *count, /* IN/OUT */
+ mach_port_t *object_name) /* OUT */
maddress = *address;
msize = *size;
result = mach_vm_region(map, &maddress, &msize, flavor, info, count, object_name);
*size = CAST_DOWN_EXPLICIT(vm32_size_t, msize);
*address = CAST_DOWN_EXPLICIT(vm32_offset_t, maddress);
maddress = *address;
msize = *size;
result = mach_vm_region(map, &maddress, &msize, flavor, info, count, object_name);
*size = CAST_DOWN_EXPLICIT(vm32_size_t, msize);
*address = CAST_DOWN_EXPLICIT(vm32_offset_t, maddress);
- vm_map_t map,
- vm32_address_t *address, /* IN/OUT */
- vm32_size_t *size, /* OUT */
- vm_region_flavor_t flavor, /* IN */
- vm_region_info_t info, /* OUT */
- mach_msg_type_number_t *count, /* IN/OUT */
- mach_port_t *object_name) /* OUT */
+ vm_map_t map,
+ vm32_address_t *address, /* IN/OUT */
+ vm32_size_t *size, /* OUT */
+ vm_region_flavor_t flavor, /* IN */
+ vm_region_info_t info, /* OUT */
+ mach_msg_type_number_t *count, /* IN/OUT */
+ mach_port_t *object_name) /* OUT */
*address = CAST_DOWN_EXPLICIT(vm32_address_t, map_addr);
*size = CAST_DOWN_EXPLICIT(vm32_size_t, map_size);
*address = CAST_DOWN_EXPLICIT(vm32_address_t, map_addr);
*size = CAST_DOWN_EXPLICIT(vm32_size_t, map_size);
- vm_map_t map,
- vm32_address_t *address,
- vm32_size_t *size,
- uint32_t *depth,
- vm_region_recurse_info_64_t info,
- mach_msg_type_number_t *infoCnt)
+ vm_map_t map,
+ vm32_address_t *address,
+ vm32_size_t *size,
+ uint32_t *depth,
+ vm_region_recurse_info_64_t info,
+ mach_msg_type_number_t *infoCnt)
maddress = *address;
msize = *size;
result = mach_vm_region_recurse(map, &maddress, &msize, depth, info, infoCnt);
*address = CAST_DOWN_EXPLICIT(vm32_address_t, maddress);
*size = CAST_DOWN_EXPLICIT(vm32_size_t, msize);
maddress = *address;
msize = *size;
result = mach_vm_region_recurse(map, &maddress, &msize, depth, info, infoCnt);
*address = CAST_DOWN_EXPLICIT(vm32_address_t, maddress);
*size = CAST_DOWN_EXPLICIT(vm32_size_t, msize);
- vm_map_t map,
- vm32_offset_t *address, /* IN/OUT */
- vm32_size_t *size, /* OUT */
- natural_t *depth, /* IN/OUT */
- vm_region_recurse_info_t info32, /* IN/OUT */
- mach_msg_type_number_t *infoCnt) /* IN/OUT */
+ vm_map_t map,
+ vm32_offset_t *address, /* IN/OUT */
+ vm32_size_t *size, /* OUT */
+ natural_t *depth, /* IN/OUT */
+ vm_region_recurse_info_t info32, /* IN/OUT */
+ mach_msg_type_number_t *infoCnt) /* IN/OUT */
map_addr = (vm_map_address_t)*address;
map_size = (vm_map_size_t)*size;
info = (vm_region_submap_info_t)info32;
*infoCnt = VM_REGION_SUBMAP_INFO_COUNT_64;
map_addr = (vm_map_address_t)*address;
map_size = (vm_map_size_t)*size;
info = (vm_region_submap_info_t)info32;
*infoCnt = VM_REGION_SUBMAP_INFO_COUNT_64;
- kr = vm_map_region_recurse_64(map, &map_addr,&map_size,
- depth, &info64, infoCnt);
+ kr = vm_map_region_recurse_64(map, &map_addr, &map_size,
+ depth, &info64, infoCnt);
info->protection = info64.protection;
info->max_protection = info64.max_protection;
info->inheritance = info64.inheritance;
info->offset = (uint32_t)info64.offset; /* trouble-maker */
info->protection = info64.protection;
info->max_protection = info64.max_protection;
info->inheritance = info64.inheritance;
info->offset = (uint32_t)info64.offset; /* trouble-maker */
- info->user_tag = info64.user_tag;
- info->pages_resident = info64.pages_resident;
- info->pages_shared_now_private = info64.pages_shared_now_private;
- info->pages_swapped_out = info64.pages_swapped_out;
- info->pages_dirtied = info64.pages_dirtied;
- info->ref_count = info64.ref_count;
- info->shadow_depth = info64.shadow_depth;
- info->external_pager = info64.external_pager;
- info->share_mode = info64.share_mode;
+ info->user_tag = info64.user_tag;
+ info->pages_resident = info64.pages_resident;
+ info->pages_shared_now_private = info64.pages_shared_now_private;
+ info->pages_swapped_out = info64.pages_swapped_out;
+ info->pages_dirtied = info64.pages_dirtied;
+ info->ref_count = info64.ref_count;
+ info->shadow_depth = info64.shadow_depth;
+ info->external_pager = info64.external_pager;
+ info->share_mode = info64.share_mode;
info->is_submap = info64.is_submap;
info->behavior = info64.behavior;
info->object_id = info64.object_id;
info->is_submap = info64.is_submap;
info->behavior = info64.behavior;
info->object_id = info64.object_id;
*address = CAST_DOWN_EXPLICIT(vm32_address_t, map_addr);
*size = CAST_DOWN_EXPLICIT(vm32_size_t, map_size);
*infoCnt = VM_REGION_SUBMAP_INFO_COUNT;
*address = CAST_DOWN_EXPLICIT(vm32_address_t, map_addr);
*size = CAST_DOWN_EXPLICIT(vm32_size_t, map_size);
*infoCnt = VM_REGION_SUBMAP_INFO_COUNT;
- vm_prot_t permission,
- ipc_port_t *object_handle,
- ipc_port_t parent_handle)
+ vm_prot_t permission,
+ ipc_port_t *object_handle,
+ ipc_port_t parent_handle)
{
// use the existing entrypoint
return _mach_make_memory_entry(target_map, size, offset, permission, object_handle, parent_handle);
{
// use the existing entrypoint
return _mach_make_memory_entry(target_map, size, offset, permission, object_handle, parent_handle);
- vm_map_t target_map,
- vm32_size_t *size,
- vm32_offset_t offset,
- vm_prot_t permission,
- ipc_port_t *object_handle,
- ipc_port_t parent_entry)
-{
- memory_object_size_t mo_size;
- kern_return_t kr;
-
+ vm_map_t target_map,
+ vm32_size_t *size,
+ vm32_offset_t offset,
+ vm_prot_t permission,
+ ipc_port_t *object_handle,
+ ipc_port_t parent_entry)
+{
+ memory_object_size_t mo_size;
+ kern_return_t kr;
+
- kr = _mach_make_memory_entry(target_map, &mo_size,
- (memory_object_offset_t)offset, permission, object_handle,
- parent_entry);
+ kr = _mach_make_memory_entry(target_map, &mo_size,
+ (memory_object_offset_t)offset, permission, object_handle,
+ parent_entry);