2 * Copyright (c) 2008 Apple Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
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.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
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.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
31 #include <mach/machine.h>
32 #include <sys/types.h>
34 #include <libkern/kxld_types.h>
36 #include "kxld_types.h"
47 typedef struct kxld_kext KXLDKext
;
49 /*******************************************************************************
50 * Constructors and Destructors
51 *******************************************************************************/
53 size_t kxld_kext_sizeof(void)
54 __attribute__((const, visibility("hidden")));
56 kern_return_t
kxld_kext_init(KXLDKext
*kext
, struct kxld_object
*kext_object
,
57 struct kxld_object
*interface_object
)
58 __attribute__((nonnull(1,2), visibility("hidden")));
60 void kxld_kext_clear(KXLDKext
*kext
)
61 __attribute__((nonnull
, visibility("hidden")));
63 void kxld_kext_deinit(KXLDKext
*kext
)
64 __attribute__((nonnull
, visibility("hidden")));
66 /*******************************************************************************
68 *******************************************************************************/
70 kern_return_t
kxld_kext_export_symbols(const KXLDKext
*kext
,
71 struct kxld_dict
*defined_symbols_by_name
,
72 struct kxld_dict
*obsolete_symbols_by_name
,
73 struct kxld_dict
*defined_cxx_symbols_by_value
)
74 __attribute__((nonnull(1), visibility("hidden")));
76 void kxld_kext_get_vmsize(const KXLDKext
*kext
,
77 u_long
*header_size
, u_long
*vmsize
)
78 __attribute__((nonnull
, visibility("hidden")));
80 kern_return_t
kxld_kext_export_linked_object(const KXLDKext
*kext
,
81 u_char
*linked_object
, kxld_addr_t
*kmod_info
)
82 __attribute__((nonnull
, visibility("hidden")));
84 /*******************************************************************************
86 *******************************************************************************/
87 kern_return_t
kxld_kext_export_vtables(KXLDKext
*kext
,
88 const struct kxld_dict
*defined_cxx_symbols
,
89 const struct kxld_dict
*defined_symbols
,
90 struct kxld_dict
*vtables
)
91 __attribute__((nonnull
, visibility("hidden")));
93 kern_return_t
kxld_kext_relocate(KXLDKext
*kext
, kxld_addr_t link_address
,
94 struct kxld_dict
*patched_vtables
, const struct kxld_dict
*defined_symbols
,
95 const struct kxld_dict
*obsolete_symbols
,
96 const struct kxld_dict
*defined_cxx_symbols
)
97 __attribute__((nonnull(1,3,4), visibility("hidden")));
99 #endif /* _KXLD_KEXT_H_ */