]> git.saurik.com Git - apple/dyld.git/blame - src/dyldLibSystemInterface.h
dyld-851.27.tar.gz
[apple/dyld.git] / src / dyldLibSystemInterface.h
CommitLineData
0959b6d4
A
1/* -*- mode: C++; c-basic-offset: 4; tab-width: 4 -*-
2 *
39a8cd10 3 * Copyright (c) 2004-2009 Apple Inc. All rights reserved.
0959b6d4
A
4 *
5 * @APPLE_LICENSE_HEADER_START@
6 *
7 * This file contains Original Code and/or Modifications of Original Code
8 * as defined in and that are subject to the Apple Public Source License
9 * Version 2.0 (the 'License'). You may not use this file except in
10 * compliance with the License. Please obtain a copy of the License at
11 * http://www.opensource.apple.com/apsl/ and read it before using this
12 * file.
13 *
14 * The Original Code and all software distributed under the License are
15 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
19 * Please see the License for the specific language governing rights and
20 * limitations under the License.
21 *
22 * @APPLE_LICENSE_HEADER_END@
23 */
24
25
26#ifndef __DYLDLIBSYSTEMHELPERS__
27#define __DYLDLIBSYSTEMHELPERS__
28
29#include <stdint.h>
cf998323 30#include <mach/mach.h>
0959b6d4 31
19894a12
A
32struct __cxa_range_t { const void* addr; size_t length; };
33
39a8cd10 34#if __cplusplus
0959b6d4 35namespace dyld {
39a8cd10 36#endif
0959b6d4
A
37 //
38 // This file contains the synchronization utilities used by dyld to be thread safe.
39 // This struct is implemented in in libSystem (where pthreads is available)
40 // and passed to dyld to use.
41 //
bac542e6 42 struct LibSystemHelpers
0959b6d4
A
43 {
44 uintptr_t version;
6cae9b63
A
45 void (*acquireGlobalDyldLock)(void);
46 void (*releaseGlobalDyldLock)(void);
19894a12 47 char* (*getThreadBufferFor_dlerror)(size_t sizeRequired);
bac542e6
A
48 // addded in version 2
49 void* (*malloc)(size_t);
50 void (*free)(void*);
51 int (*cxa_atexit)(void (*)(void*), void*, void*);
52 // addded in version 3
6cae9b63
A
53 void (*dyld_shared_cache_missing)(void);
54 void (*dyld_shared_cache_out_of_date)(void);
bac542e6 55 // addded in version 4
6cae9b63
A
56 void (*acquireDyldInitializerLock)(void);
57 void (*releaseDyldInitializerLock)(void);
39a8cd10 58 // added in version 5
412ebb8e
A
59 int (*pthread_key_create)(pthread_key_t*, void (*destructor)(void*));
60 int (*pthread_setspecific)(pthread_key_t, const void*);
39a8cd10
A
61 // added in version 6
62 size_t (*malloc_size)(const void *ptr);
412ebb8e
A
63 // added in version 7
64 void* (*pthread_getspecific)(pthread_key_t);
65 // added in version 8
66 void (*cxa_finalize)(const void*);
832b6fce
A
67 // added in version 9
68 void* startGlueToCallExit;
2fd3f4e8 69 // added in version 10
6cae9b63 70 bool (*hasPerThreadBufferFor_dlerror)(void);
2fd3f4e8 71 // added in version 11
6cae9b63 72 bool (*isLaunchdOwned)(void);
2fd3f4e8
A
73 // added in version 12
74 kern_return_t (*vm_alloc)(vm_map_t task, vm_address_t* addr, vm_size_t size, int flags);
75 void* (*mmap)(void* addr, size_t len, int prot, int flags, int fd, off_t offset);
19894a12
A
76 // added in version 13
77 void (*cxa_finalize_ranges)(const struct __cxa_range_t ranges[], int count);
0959b6d4 78 };
39a8cd10 79#if __cplusplus
2fd3f4e8 80}
39a8cd10 81#endif
0959b6d4
A
82
83
84
85
86#endif // __DYLDLIBSYSTEMHELPERS__
87