Chameleon

Chameleon Svn Source Tree

Root/tags/2.0/i386/include/mach/shared_memory_server.h

Source at commit 1808 created 12 years 4 months ago.
By blackosx, Revise layout of package installer 'Welcome' file so it looks cleaner. Change the copyright notice to begin from 2009 as seen in the Chameleon 2.0 r431 installer. Should this date be set earlier?
1/*
2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 *
30 *File: mach/shared_memory_server.h
31 *
32 * protos and struct definitions for shared library
33 *server and interface
34 */
35
36/*
37 * XXX
38 *
39 * NOTE: this file is deprecated and will be removed in the near future.
40 * Any project that includes this file should be changed to:
41 * 1. use <mach/shared_region.h> instead of this file,
42 * 2. handle the new shared regions, now available on more platforms
43 */
44
45#ifndef _MACH_SHARED_MEMORY_SERVER_H_
46#define _MACH_SHARED_MEMORY_SERVER_H_
47
48#warning "<mach/shared_memory_server.h> is deprecated. Please use <mach/shared_region.h> instead."
49
50#include <sys/cdefs.h>
51#include <mach/vm_prot.h>
52#include <mach/vm_types.h>
53#include <mach/mach_types.h>
54
55#define VM_PROT_COW 0x8 /* must not interfere with normal prot assignments */
56#define VM_PROT_ZF 0x10 /* must not interfere with normal prot assignments */
57
58#ifdef__arm__
59#define GLOBAL_SHARED_TEXT_SEGMENT0x30000000U
60#define GLOBAL_SHARED_DATA_SEGMENT0x38000000U
61#define GLOBAL_SHARED_SEGMENT_MASK0xF8000000U
62
63#defineSHARED_TEXT_REGION_SIZE0x08000000
64#defineSHARED_DATA_REGION_SIZE0x08000000
65#else
66#define GLOBAL_SHARED_TEXT_SEGMENT0x90000000U
67#define GLOBAL_SHARED_DATA_SEGMENT0xA0000000U
68#define GLOBAL_SHARED_SEGMENT_MASK0xF0000000U
69
70#defineSHARED_TEXT_REGION_SIZE0x10000000
71#defineSHARED_DATA_REGION_SIZE0x10000000
72#endif
73
74#if !defined(__LP64__)
75
76#defineSHARED_LIBRARY_SERVER_SUPPORTED
77
78#defineSHARED_ALTERNATE_LOAD_BASE0x09000000
79
80/*
81 * Note: the two masks below are useful because the assumption is
82 * made that these shared regions will always be mapped on natural boundaries
83 * i.e. if the size is 0x10000000 the object can be mapped at
84 * 0x20000000, or 0x30000000, but not 0x1000000
85 */
86#ifdef__arm__
87#defineSHARED_TEXT_REGION_MASK0x07FFFFFF
88#defineSHARED_DATA_REGION_MASK0x07FFFFFF
89#else
90#defineSHARED_TEXT_REGION_MASK0x0FFFFFFF
91#defineSHARED_DATA_REGION_MASK0x0FFFFFFF
92#endif
93
94
95/* flags field aliases for copyin_shared_file and load_shared_file */
96
97/* IN */
98#define ALTERNATE_LOAD_SITE 0x1
99#define NEW_LOCAL_SHARED_REGIONS 0x2
100#defineQUERY_IS_SYSTEM_REGION 0x4
101
102/* OUT */
103#define SF_PREV_LOADED 0x1
104#define SYSTEM_REGION_BACKED 0x2
105
106
107struct sf_mapping {
108vm_offset_tmapping_offset;
109vm_size_tsize;
110vm_offset_tfile_offset;
111vm_prot_tprotection; /* read/write/execute/COW/ZF */
112vm_offset_tcksum;
113};
114typedef struct sf_mapping sf_mapping_t;
115
116#endif /* !defined(__LP64__) */
117
118/*
119 * All shared_region_* declarations are a private interface
120 * between dyld and the kernel.
121 *
122 */
123struct shared_file_mapping_np {
124mach_vm_address_tsfm_address;
125mach_vm_size_tsfm_size;
126mach_vm_offset_tsfm_file_offset;
127vm_prot_tsfm_max_prot;
128vm_prot_tsfm_init_prot;
129};
130
131struct shared_region_range_np {
132mach_vm_address_tsrr_address;
133mach_vm_size_tsrr_size;
134};
135
136
137__BEGIN_DECLS
138intshared_region_map_file_np(int fd,
139 uint32_t mappingCount,
140 const struct shared_file_mapping_np *mappings,
141 int64_t *slide_p);
142intshared_region_make_private_np(uint32_t rangeCount,
143 const struct shared_region_range_np *ranges);
144__END_DECLS
145
146
147#endif /* _MACH_SHARED_MEMORY_SERVER_H_ */
148

Archive Download this file

Revision: 1808