1/* 2 * Copyright (c) 2000-2007 Apple Inc. All rights reserved. 3 */ 4/* 5 * @OSF_COPYRIGHT@ 6 */ 7/* 8 * Mach Operating System 9 * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University 10 * All Rights Reserved. 11 * 12 * Permission to use, copy, modify and distribute this software and its 13 * documentation is hereby granted, provided that both the copyright 14 * notice and this permission notice appear in all copies of the 15 * software, derivative works or modified versions, and any portions 16 * thereof, and that both notices appear in supporting documentation. 17 * 18 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 19 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 20 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 21 * 22 * Carnegie Mellon requests users of this software to return to 23 * 24 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 25 * School of Computer Science 26 * Carnegie Mellon University 27 * Pittsburgh PA 15213-3890 28 * 29 * any improvements or extensions that they make and grant Carnegie Mellon 30 * the rights to redistribute these changes. 31 */ 32/* 33 */ 34 35/* 36 * File: vm_types.h 37 * Author: Avadis Tevanian, Jr. 38 * Date: 1985 39 * 40 * Header file for VM data types. ARM version. 41 */ 42 43#ifndef _MACH_ARM_VM_TYPES_H_ 44#define _MACH_ARM_VM_TYPES_H_ 45 46#ifndef ASSEMBLER 47 48#include <arm/_types.h> 49#include <mach/arm/vm_param.h> 50#include <stdint.h> 51#include <Availability.h> 52 53/* 54 * natural_t and integer_t are Mach's legacy types for machine- 55 * independent integer types (unsigned, and signed, respectively). 56 * Their original purpose was to define other types in a machine/ 57 * compiler independent way. 58 * 59 * They also had an implicit "same size as pointer" characteristic 60 * to them (i.e. Mach's traditional types are very ILP32 or ILP64 61 * centric). We will likely support x86 ABIs that do not follow 62 * either ofthese models (specifically LP64). Therefore, we had to 63 * make a choice between making these types scale with pointers or stay 64 * tied to integers. Because their use is predominantly tied to 65 * to the size of an integer, we are keeping that association and 66 * breaking free from pointer size guarantees. 67 * 68 * New use of these types is discouraged. 69 */ 70typedef __darwin_natural_t natural_t; 71typedef int integer_t; 72 73/* 74 * A vm_offset_t is a type-neutral pointer, 75 * e.g. an offset into a virtual memory space. 76 */ 77#ifdef __LP64__ 78typedef uintptr_t vm_offset_t; 79typedef uintptr_t vm_size_t; 80 81typedef uint64_t mach_vm_address_t; 82typedef uint64_t mach_vm_offset_t; 83typedef uint64_t mach_vm_size_t; 84 85typedef uint64_t vm_map_offset_t; 86typedef uint64_t vm_map_address_t; 87typedef uint64_t vm_map_size_t; 88#else 89typedef natural_t vm_offset_t; 90/* 91 * A vm_size_t is the proper type for e.g. 92 * expressing the difference between two 93 * vm_offset_t entities. 94 */ 95typedef natural_t vm_size_t; 96 97/* 98 * This new type is independent of a particular vm map's 99 * implementation size - and represents appropriate types 100 * for all possible maps. This is used for interfaces 101 * where the size of the map is not known - or we don't 102 * want to have to distinguish. 103 */ 104//#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0) 105 106/* We target iOS 4.3 for compatibility. */ 107typedef uint32_t mach_vm_address_t; 108typedef uint32_t mach_vm_offset_t; 109typedef uint32_t mach_vm_size_t; 110 111typedef uint32_t vm_map_offset_t; 112typedef uint32_t vm_map_address_t; 113typedef uint32_t vm_map_size_t; 114#endif /* __LP64__ */ 115 116 117typedef uint32_t vm32_offset_t; 118typedef uint32_t vm32_address_t; 119typedef uint32_t vm32_size_t; 120 121typedef vm_offset_t mach_port_context_t; 122 123 124/* ARM64_TODO: sigh, need to adjust these... */ 125#define VM_MAP_MIN_ADDRESS VM_MIN_ADDRESS 126#define VM_MAP_MAX_ADDRESS VM_MAX_ADDRESS 127 128#endif /* ASSEMBLER */ 129 130/* 131 * If composing messages by hand (please do not) 132 */ 133#define MACH_MSG_TYPE_INTEGER_T MACH_MSG_TYPE_INTEGER_32 134 135#endif /* _MACH_ARM_VM_TYPES_H_ */ 136