28#ifndef __KOS_LIBRARY_H
29#define __KOS_LIBRARY_H
48TAILQ_HEAD(klqueue, klibrary);
73typedef struct klibrary {
111 const char *(*lib_get_name)(void);
121 uint32_t(*lib_get_version)(void);
133 int (*lib_open)(
struct klibrary *lib);
143 int (*lib_close)(
struct klibrary *lib);
147#define LIBRARY_DEFAULTS 0
151extern struct kllist library_list;
288int library_init(
void);
291void library_shutdown(
void);
ELF binary loading support.
Virtual filesystem support.
const char * library_get_name(klibrary_t *lib)
Retrieve the specified library's name.
klibrary_t * library_open(const char *name, const char *fn)
Try to open a library by name.
libid_t library_get_libid(klibrary_t *lib)
Retrieve the specified library's runtime-assigned ID.
int library_close(klibrary_t *lib)
Close a previously opened library.
klibrary_t * library_lookup_fn(const char *fn)
Look up a library by filename.
uint32_t library_get_version(klibrary_t *lib)
Retrieve the specified library's version.
klibrary_t * library_lookup(const char *name)
Look up a library by name.
klibrary_t * library_by_libid(libid_t libid)
Look up a library by ID.
int library_destroy(klibrary_t *lib)
Destroy a library.
tid_t libid_t
Library ID type.
Definition library.h:53
klibrary_t * library_create(int flags)
Create a new library shell.
int library_get_refcnt(klibrary_t *lib)
Retrieve the specified library's reference count.
typedef LIST_HEAD(nmmgr_list, nmmgr_handler) nmmgr_list_t
Name handler list type.
handle_t tid_t
Thread ID type.
Definition types.h:85
Kernel-specific definition of a loaded ELF binary.
Definition elf.h:304
Loaded library structure.
Definition library.h:73
elf_prog_t image
ELF image for this library.
Definition library.h:90
libid_t libid
Library ID (assigned at runtime).
Definition library.h:81
uint32_t flags
Library flags.
Definition library.h:84
int refcnt
Library reference count.
Definition library.h:98
LIST_ENTRY(klibrary) list
Library list handle.