]>
git.saurik.com Git - apple/xnu.git/blob - EXTERNAL_HEADERS/mach-o/kld.h
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
29 #include <mach-o/loader.h>
33 * These API's are in libkld. Both kmodload(8) and /mach_kernel should
34 * link with -lkld and then ld(1) will expand -lkld to libkld.dylib or
35 * libkld.a depending on if -dynamic or -static is in effect.
39 * Note that you must supply the following function for error reporting when
40 * using any of the functions listed here.
42 extern void kld_error_vprintf(const char *format
, va_list ap
);
45 * This two are only in libkld.dylib for use by kmodload(8) (user code compiled
46 * with the default -dynamic).
49 __private_extern__
long kld_load_basefile(
50 const char *base_filename
);
52 /* Note: this takes only one object file name */
53 __private_extern__
long kld_load(
54 struct mach_header
**header_addr
,
55 const char *object_filename
,
56 const char *output_filename
);
57 #endif /* __DYNAMIC__ */
60 * This two are only in libkld.a use by /mach_kernel (kernel code compiled with
64 /* Note: this api does not write an output file */
65 __private_extern__
long kld_load_from_memory(
66 struct mach_header
**header_addr
,
67 const char *object_name
,
70 #endif /* __STATIC__ */
72 __private_extern__
long kld_unload_all(
73 long deallocate_sets
);
75 __private_extern__
long kld_lookup(
76 const char *symbol_name
,
77 unsigned long *value
);
79 __private_extern__
long kld_forget_symbol(
80 const char *symbol_name
);
82 __private_extern__
void kld_address_func(
83 unsigned long (*func
)(unsigned long size
, unsigned long headers_size
));
85 #endif /* _MACHO_KLD_H_ */