1/*- 2 * Copyright (c) 1997-2000 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/sys/linker.h 132117 2004-07-13 19:36:59Z phk $ |
27 */ 28 29#ifndef _SYS_LINKER_H_ 30#define _SYS_LINKER_H_ 31 32#ifdef _KERNEL 33 34#include <machine/elf.h> --- 95 unchanged lines hidden (view full) --- 130/* 131 * Called from a class handler when a file is laoded. 132 */ 133linker_file_t linker_make_file(const char* _filename, linker_class_t _cls); 134 135/* 136 * Unload a file, freeing up memory. 137 */ |
138int linker_file_unload(linker_file_t _file, int flags); |
139 140/* 141 * Add a dependency to a file. 142 */ 143int linker_file_add_dependency(linker_file_t _file, linker_file_t _dep); 144 145/* 146 * Lookup a symbol in a file. If deps is TRUE, look in dependencies --- 123 unchanged lines hidden (view full) --- 270struct kld_sym_lookup { 271 int version; /* set to sizeof(struct kld_sym_lookup) */ 272 char *symname; /* Symbol name we are looking up */ 273 u_long symvalue; 274 size_t symsize; 275}; 276#define KLDSYM_LOOKUP 1 277 |
278/* 279 * Flags for kldunloadf() and linker_file_unload() 280 */ 281#define LINKER_UNLOAD_NORMAL 0 282#define LINKER_UNLOAD_FORCE 1 283 |
284#ifndef _KERNEL 285 286#include <sys/cdefs.h> 287 288__BEGIN_DECLS 289int kldload(const char* _file); 290int kldunload(int _fileid); |
291int kldunloadf(int _fileid, int flags); |
292int kldfind(const char* _file); 293int kldnext(int _fileid); 294int kldstat(int _fileid, struct kld_file_stat* _stat); 295int kldfirstmod(int _fileid); 296int kldsym(int _fileid, int _cmd, void *_data); 297__END_DECLS 298 299#endif 300 301#endif /* !_SYS_LINKER_H_ */ |