1*2c2f96dcSApple OSS Distributions /* 2*2c2f96dcSApple OSS Distributions * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. 3*2c2f96dcSApple OSS Distributions * 4*2c2f96dcSApple OSS Distributions * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5*2c2f96dcSApple OSS Distributions * 6*2c2f96dcSApple OSS Distributions * This file contains Original Code and/or Modifications of Original Code 7*2c2f96dcSApple OSS Distributions * as defined in and that are subject to the Apple Public Source License 8*2c2f96dcSApple OSS Distributions * Version 2.0 (the 'License'). You may not use this file except in 9*2c2f96dcSApple OSS Distributions * compliance with the License. The rights granted to you under the License 10*2c2f96dcSApple OSS Distributions * may not be used to create, or enable the creation or redistribution of, 11*2c2f96dcSApple OSS Distributions * unlawful or unlicensed copies of an Apple operating system, or to 12*2c2f96dcSApple OSS Distributions * circumvent, violate, or enable the circumvention or violation of, any 13*2c2f96dcSApple OSS Distributions * terms of an Apple operating system software license agreement. 14*2c2f96dcSApple OSS Distributions * 15*2c2f96dcSApple OSS Distributions * Please obtain a copy of the License at 16*2c2f96dcSApple OSS Distributions * http://www.opensource.apple.com/apsl/ and read it before using this file. 17*2c2f96dcSApple OSS Distributions * 18*2c2f96dcSApple OSS Distributions * The Original Code and all software distributed under the License are 19*2c2f96dcSApple OSS Distributions * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20*2c2f96dcSApple OSS Distributions * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21*2c2f96dcSApple OSS Distributions * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22*2c2f96dcSApple OSS Distributions * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23*2c2f96dcSApple OSS Distributions * Please see the License for the specific language governing rights and 24*2c2f96dcSApple OSS Distributions * limitations under the License. 25*2c2f96dcSApple OSS Distributions * 26*2c2f96dcSApple OSS Distributions * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27*2c2f96dcSApple OSS Distributions */ 28*2c2f96dcSApple OSS Distributions /* 29*2c2f96dcSApple OSS Distributions * @OSF_COPYRIGHT@ 30*2c2f96dcSApple OSS Distributions */ 31*2c2f96dcSApple OSS Distributions /* 32*2c2f96dcSApple OSS Distributions * Mach Operating System 33*2c2f96dcSApple OSS Distributions * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University 34*2c2f96dcSApple OSS Distributions * All Rights Reserved. 35*2c2f96dcSApple OSS Distributions * 36*2c2f96dcSApple OSS Distributions * Permission to use, copy, modify and distribute this software and its 37*2c2f96dcSApple OSS Distributions * documentation is hereby granted, provided that both the copyright 38*2c2f96dcSApple OSS Distributions * notice and this permission notice appear in all copies of the 39*2c2f96dcSApple OSS Distributions * software, derivative works or modified versions, and any portions 40*2c2f96dcSApple OSS Distributions * thereof, and that both notices appear in supporting documentation. 41*2c2f96dcSApple OSS Distributions * 42*2c2f96dcSApple OSS Distributions * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 43*2c2f96dcSApple OSS Distributions * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 44*2c2f96dcSApple OSS Distributions * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 45*2c2f96dcSApple OSS Distributions * 46*2c2f96dcSApple OSS Distributions * Carnegie Mellon requests users of this software to return to 47*2c2f96dcSApple OSS Distributions * 48*2c2f96dcSApple OSS Distributions * Software Distribution Coordinator or [email protected] 49*2c2f96dcSApple OSS Distributions * School of Computer Science 50*2c2f96dcSApple OSS Distributions * Carnegie Mellon University 51*2c2f96dcSApple OSS Distributions * Pittsburgh PA 15213-3890 52*2c2f96dcSApple OSS Distributions * 53*2c2f96dcSApple OSS Distributions * any improvements or extensions that they make and grant Carnegie Mellon 54*2c2f96dcSApple OSS Distributions * the rights to redistribute these changes. 55*2c2f96dcSApple OSS Distributions */ 56*2c2f96dcSApple OSS Distributions /* 57*2c2f96dcSApple OSS Distributions */ 58*2c2f96dcSApple OSS Distributions /* 59*2c2f96dcSApple OSS Distributions * File: mach/memory_object_control.h 60*2c2f96dcSApple OSS Distributions * 61*2c2f96dcSApple OSS Distributions * Abstract: 62*2c2f96dcSApple OSS Distributions * Basic Mach external memory management interface declaration. 63*2c2f96dcSApple OSS Distributions */ 64*2c2f96dcSApple OSS Distributions 65*2c2f96dcSApple OSS Distributions 66*2c2f96dcSApple OSS Distributions #ifndef _MACH_MEMORY_OBJECT_CONTROL_ 67*2c2f96dcSApple OSS Distributions #define _MACH_MEMORY_OBJECT_CONTROL_ 68*2c2f96dcSApple OSS Distributions 69*2c2f96dcSApple OSS Distributions /* Module memory_object_control */ 70*2c2f96dcSApple OSS Distributions 71*2c2f96dcSApple OSS Distributions #include <string.h> 72*2c2f96dcSApple OSS Distributions #include <mach/ndr.h> 73*2c2f96dcSApple OSS Distributions #include <mach/boolean.h> 74*2c2f96dcSApple OSS Distributions #include <mach/kern_return.h> 75*2c2f96dcSApple OSS Distributions #include <mach/notify.h> 76*2c2f96dcSApple OSS Distributions #include <mach/mach_types.h> 77*2c2f96dcSApple OSS Distributions #include <mach/message.h> 78*2c2f96dcSApple OSS Distributions #include <mach/mig_errors.h> 79*2c2f96dcSApple OSS Distributions #include <mach/port.h> 80*2c2f96dcSApple OSS Distributions 81*2c2f96dcSApple OSS Distributions #include <vm/vm_protos.h> 82*2c2f96dcSApple OSS Distributions 83*2c2f96dcSApple OSS Distributions __BEGIN_DECLS 84*2c2f96dcSApple OSS Distributions #pragma GCC visibility push(hidden) 85*2c2f96dcSApple OSS Distributions 86*2c2f96dcSApple OSS Distributions extern kern_return_t memory_object_change_attributes( 87*2c2f96dcSApple OSS Distributions memory_object_control_t memory_control, 88*2c2f96dcSApple OSS Distributions memory_object_flavor_t flavor, 89*2c2f96dcSApple OSS Distributions memory_object_info_t attributes, 90*2c2f96dcSApple OSS Distributions mach_msg_type_number_t attributesCnt); 91*2c2f96dcSApple OSS Distributions 92*2c2f96dcSApple OSS Distributions extern kern_return_t memory_object_lock_request( 93*2c2f96dcSApple OSS Distributions memory_object_control_t memory_control, 94*2c2f96dcSApple OSS Distributions memory_object_offset_t offset, 95*2c2f96dcSApple OSS Distributions memory_object_size_t size, 96*2c2f96dcSApple OSS Distributions memory_object_offset_t *resid_offset, 97*2c2f96dcSApple OSS Distributions integer_t *io_errno, 98*2c2f96dcSApple OSS Distributions memory_object_return_t should_return, 99*2c2f96dcSApple OSS Distributions integer_t flags, 100*2c2f96dcSApple OSS Distributions vm_prot_t lock_value); 101*2c2f96dcSApple OSS Distributions 102*2c2f96dcSApple OSS Distributions extern kern_return_t memory_object_destroy( 103*2c2f96dcSApple OSS Distributions memory_object_control_t memory_control, 104*2c2f96dcSApple OSS Distributions vm_object_destroy_reason_t reason); 105*2c2f96dcSApple OSS Distributions 106*2c2f96dcSApple OSS Distributions extern kern_return_t memory_object_upl_request( 107*2c2f96dcSApple OSS Distributions memory_object_control_t memory_control, 108*2c2f96dcSApple OSS Distributions memory_object_offset_t offset, 109*2c2f96dcSApple OSS Distributions upl_size_t size, 110*2c2f96dcSApple OSS Distributions upl_t *upl, 111*2c2f96dcSApple OSS Distributions upl_page_info_array_t page_list, 112*2c2f96dcSApple OSS Distributions mach_msg_type_number_t *page_listCnt, 113*2c2f96dcSApple OSS Distributions integer_t cntrl_flags, 114*2c2f96dcSApple OSS Distributions integer_t tag); 115*2c2f96dcSApple OSS Distributions 116*2c2f96dcSApple OSS Distributions extern kern_return_t memory_object_cluster_size( 117*2c2f96dcSApple OSS Distributions memory_object_control_t control, 118*2c2f96dcSApple OSS Distributions memory_object_offset_t *start, 119*2c2f96dcSApple OSS Distributions vm_size_t *length, 120*2c2f96dcSApple OSS Distributions uint32_t *io_streaming, 121*2c2f96dcSApple OSS Distributions memory_object_fault_info_t fault_info); 122*2c2f96dcSApple OSS Distributions 123*2c2f96dcSApple OSS Distributions __exported 124*2c2f96dcSApple OSS Distributions extern kern_return_t memory_object_page_op( 125*2c2f96dcSApple OSS Distributions memory_object_control_t memory_control, 126*2c2f96dcSApple OSS Distributions memory_object_offset_t offset, 127*2c2f96dcSApple OSS Distributions integer_t ops, 128*2c2f96dcSApple OSS Distributions uint32_t *phys_entry, 129*2c2f96dcSApple OSS Distributions integer_t *flags); 130*2c2f96dcSApple OSS Distributions 131*2c2f96dcSApple OSS Distributions extern kern_return_t memory_object_range_op( 132*2c2f96dcSApple OSS Distributions memory_object_control_t memory_control, 133*2c2f96dcSApple OSS Distributions memory_object_offset_t offset_beg, 134*2c2f96dcSApple OSS Distributions memory_object_offset_t offset_end, 135*2c2f96dcSApple OSS Distributions integer_t ops, 136*2c2f96dcSApple OSS Distributions integer_t *range); 137*2c2f96dcSApple OSS Distributions 138*2c2f96dcSApple OSS Distributions #pragma GCC visibility pop 139*2c2f96dcSApple OSS Distributions __END_DECLS 140*2c2f96dcSApple OSS Distributions 141*2c2f96dcSApple OSS Distributions #endif /* _MACH_MEMORY_OBJECT_CONTROL_ */ 142