]>
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 * 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@
26 #include <mach-o/loader.h>
30 * These API's are in libkld. Both kmodload(8) and /mach_kernel should
31 * link with -lkld and then ld(1) will expand -lkld to libkld.dylib or
32 * libkld.a depending on if -dynamic or -static is in effect.
36 * Note that you must supply the following function for error reporting when
37 * using any of the functions listed here.
39 extern void kld_error_vprintf(const char *format
, va_list ap
);
42 * This two are only in libkld.dylib for use by kmodload(8) (user code compiled
43 * with the default -dynamic).
46 __private_extern__
long kld_load_basefile(
47 const char *base_filename
);
49 /* Note: this takes only one object file name */
50 __private_extern__
long kld_load(
51 struct mach_header
**header_addr
,
52 const char *object_filename
,
53 const char *output_filename
);
54 #endif /* __DYNAMIC__ */
57 * This two are only in libkld.a use by /mach_kernel (kernel code compiled with
61 /* Note: this api does not write an output file */
62 __private_extern__
long kld_load_from_memory(
63 struct mach_header
**header_addr
,
64 const char *object_name
,
67 #endif /* __STATIC__ */
69 __private_extern__
long kld_unload_all(
70 long deallocate_sets
);
72 __private_extern__
long kld_lookup(
73 const char *symbol_name
,
74 unsigned long *value
);
76 __private_extern__
long kld_forget_symbol(
77 const char *symbol_name
);
79 __private_extern__
void kld_address_func(
80 unsigned long (*func
)(unsigned long size
, unsigned long headers_size
));
82 #endif /* _MACHO_KLD_H_ */