2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
24 * File: mach/shared_memory_server.h
26 * protos and struct definitions for shared library
27 * server and interface
29 #ifndef _MACH_SHARED_MEMORY_SERVER_H_
30 #define _MACH_SHARED_MEMORY_SERVER_H_
32 #define SHARED_LIBRARY_SERVER_SUPPORTED
33 #define GLOBAL_SHARED_TEXT_SEGMENT 0x90000000
34 #define GLOBAL_SHARED_DATA_SEGMENT 0xA0000000
35 #define GLOBAL_SHARED_SEGMENT_MASK 0xF0000000
37 #define SHARED_TEXT_REGION_SIZE 0x10000000
38 #define SHARED_DATA_REGION_SIZE 0x10000000
39 #define SHARED_ALTERNATE_LOAD_BASE 0x9000000
42 * Note: the two masks below are useful because the assumption is
43 * made that these shared regions will always be mapped on natural boundaries
44 * i.e. if the size is 0x10000000 the object can be mapped at
45 * 0x20000000, or 0x30000000, but not 0x1000000
47 #define SHARED_TEXT_REGION_MASK 0xFFFFFFF
48 #define SHARED_DATA_REGION_MASK 0xFFFFFFF
51 #include <mach/vm_prot.h>
52 #include <mach/mach_types.h>
54 #define SHARED_LIB_ALIAS 0x10
57 /* flags field aliases for copyin_shared_file and load_shared_file */
60 #define ALTERNATE_LOAD_SITE 0x1
61 #define NEW_LOCAL_SHARED_REGIONS 0x2
62 #define QUERY_IS_SYSTEM_REGION 0x4
65 #define SF_PREV_LOADED 0x1
66 #define SYSTEM_REGION_BACKED 0x2
69 #define load_file_hash(file_object, size) \
70 ((((natural_t)file_object) & 0xffffff) % size)
72 #define VM_PROT_COW 0x8 /* must not interfere with normal prot assignments */
73 #define VM_PROT_ZF 0x10 /* must not interfere with normal prot assignments */
76 vm_offset_t mapping_offset
;
78 vm_offset_t file_offset
;
79 vm_prot_t protection
; /* read/write/execute/COW/ZF */
83 typedef struct sf_mapping sf_mapping_t
;
85 #endif /* _MACH_SHARED_MEMORY_SERVER_H_ */