X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/6601e61aa18bf4f09af135ff61fc7f4771d23b06..bca245acd4c03fd752d1a45f011ad495e60fe53d:/osfmk/mach/mach_vm.defs?ds=sidebyside diff --git a/osfmk/mach/mach_vm.defs b/osfmk/mach/mach_vm.defs index 9e39042d7..88097761f 100644 --- a/osfmk/mach/mach_vm.defs +++ b/osfmk/mach/mach_vm.defs @@ -1,23 +1,29 @@ /* * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. * - * @APPLE_LICENSE_HEADER_START@ + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * - * The contents of this file constitute Original Code as defined in and - * are subject to the Apple Public Source License Version 1.1 (the - * "License"). You may not use this file except in compliance with the - * License. Please obtain a copy of the License at - * http://www.apple.com/publicsource and read it before using this file. + * 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. * - * This Original Code and all software distributed under the License are - * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * 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 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. * - * @APPLE_LICENSE_HEADER_END@ + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_FREE_COPYRIGHT@ @@ -70,6 +76,19 @@ subsystem #include #include +#define CONCAT(a,b) a ## b +#if !KERNEL && !LIBSYSCALL_INTERFACE +#define PREFIX(NAME) CONCAT(_kernelrpc_, NAME) +#else +#define PREFIX(NAME) NAME +#endif + +#if KERNEL_SERVER +#define KERNEL_SERVER_SUFFIX(NAME) CONCAT(NAME, _external) +#else +#define KERNEL_SERVER_SUFFIX(NAME) NAME +#endif + /* * Allocate zero-filled memory in the address space * of the target task, either at the specified address, @@ -78,27 +97,50 @@ subsystem * allocation actually took place is returned. */ #if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) -routine mach_vm_allocate( +routine PREFIX(KERNEL_SERVER_SUFFIX(mach_vm_allocate)) ( + target : vm_task_entry_t; + inout address : mach_vm_address_t; + size : mach_vm_size_t; + flags : int); + #else -routine vm_allocate( -#endif + +#if !KERNEL && !LIBSYSCALL_INTERFACE +skip; +#else +routine PREFIX(KERNEL_SERVER_SUFFIX(vm_allocate)) ( target : vm_task_entry_t; inout address : mach_vm_address_t; size : mach_vm_size_t; flags : int); +#endif + +#endif + + /* * Deallocate the specified range from the virtual * address space of the target virtual memory map. */ #if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) -routine mach_vm_deallocate( +routine PREFIX(mach_vm_deallocate) ( + target : vm_task_entry_t; + address : mach_vm_address_t; + size : mach_vm_size_t); + #else -routine vm_deallocate( -#endif + +#if !KERNEL && !LIBSYSCALL_INTERFACE +skip; +#else +routine PREFIX(vm_deallocate) ( target : vm_task_entry_t; address : mach_vm_address_t; size : mach_vm_size_t); +#endif + +#endif /* * Set the current or maximum protection attribute @@ -111,16 +153,31 @@ routine vm_deallocate( * *permissions*. */ #if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) -routine mach_vm_protect( +routine PREFIX(mach_vm_protect) ( + target_task : vm_task_entry_t; + address : mach_vm_address_t; + size : mach_vm_size_t; + set_maximum : boolean_t; + new_protection : vm_prot_t); + + #else -routine vm_protect( -#endif + +#if !KERNEL && !LIBSYSCALL_INTERFACE +skip; +#else + +routine PREFIX(vm_protect) ( target_task : vm_task_entry_t; address : mach_vm_address_t; size : mach_vm_size_t; set_maximum : boolean_t; new_protection : vm_prot_t); +#endif + +#endif + /* * Set the inheritance attribute for the specified range * of the virtual address space of the target address space. @@ -146,9 +203,9 @@ routine vm_inherit( * protection on the specified range must permit reading.] */ #if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) -routine mach_vm_read( +routine PREFIX(mach_vm_read) ( #else -routine vm_read( +routine PREFIX(vm_read) ( #endif target_task : vm_map_t; address : mach_vm_address_t; @@ -283,9 +340,13 @@ routine vm_behavior_set( * for further consistency.] */ #if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) -routine mach_vm_map( +routine PREFIX(KERNEL_SERVER_SUFFIX(mach_vm_map)) ( +#else +#if defined(__arm__) && !LIBSYSCALL_INTERFACE +routine _vm_map_arm( #else -routine vm_map( +routine PREFIX(KERNEL_SERVER_SUFFIX(vm_map)) ( +#endif #endif target_task : vm_task_entry_t; inout address : mach_vm_address_t; @@ -319,15 +380,15 @@ routine vm_machine_attribute( * Map portion of a task's address space. */ #if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) -routine mach_vm_remap( +routine PREFIX(KERNEL_SERVER_SUFFIX(mach_vm_remap)) ( #else -routine vm_remap( +routine PREFIX(KERNEL_SERVER_SUFFIX(vm_remap)) ( #endif target_task : vm_map_t; inout target_address : mach_vm_address_t; size : mach_vm_size_t; mask : mach_vm_offset_t; - anywhere : boolean_t; + flags : int; src_task : vm_map_t; src_address : mach_vm_address_t; copy : boolean_t; @@ -395,8 +456,12 @@ routine vm_region_64( * THIS INTERFACE IS STILL EVOLVING. */ #if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +#if !defined(__LP64__) || KERNEL_SERVER || XNU_KERNEL_PRIVATE || LIBSYSCALL_INTERFACE routine _mach_make_memory_entry( #else +routine mach_make_memory_entry( +#endif +#else routine mach_make_memory_entry_64( #endif target_task :vm_map_t; @@ -406,6 +471,44 @@ routine mach_make_memory_entry_64( out object_handle :mem_entry_name_port_move_send_t; parent_handle :mem_entry_name_port_t); +/* + * Control behavior and investigate state of a "purgable" object in + * the virtual address space of the target task. A purgable object is + * created via a call to mach_vm_allocate() with VM_FLAGS_PURGABLE + * specified. See the routine implementation for a complete + * definition of the routine. + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine PREFIX(mach_vm_purgable_control) ( +#else +routine PREFIX(vm_purgable_control) ( +#endif + target_task : vm_map_t; + address : mach_vm_address_t; + control : vm_purgable_t; + inout state : int); + + +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_page_info( + target_task : vm_map_t; + address : mach_vm_address_t; + flavor : vm_page_info_flavor_t; + out info : vm_page_info_t, CountInOut); +#else +skip; +#endif + +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_page_range_query( + target_map : vm_map_t; + address : mach_vm_offset_t; + size : mach_vm_size_t; + dispositions : mach_vm_address_t; + inout dispositions_count : mach_vm_size_t); +#else +skip; +#endif /****************************** Legacy section ***************************/ /* The following definitions are exist to provide compatibility with */ @@ -439,3 +542,5 @@ routine mach_make_memory_entry_64( * mach_make_memory_entry() - * use mach_vm_make_memory_entry() or mach_make_memory_entry_64() */ + +/* vim: set ft=c : */