KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
exports.h
Go to the documentation of this file.
1/* KallistiOS ##version##
2
3 kos/exports.h
4 Copyright (C)2003 Megan Potter
5
6*/
7
8/** \file kos/exports.h
9 \brief Kernel exported symbols support.
10 \ingroup system_libraries
11
12 This file contains support related to dynamic linking of the kernel of KOS.
13 The kernel (at compile time) produces a list of exported symbols, which can
14 be looked through using the functionality in this file.
15
16 \author Megan Potter
17*/
18
19#ifndef __KOS_EXPORTS_H
20#define __KOS_EXPORTS_H
21
22#include <sys/cdefs.h>
23__BEGIN_DECLS
24
25#include <arch/types.h>
26
27/** \addtogroup system_libraries
28 @{
29*/
30
31/** \brief A single export symbol.
32
33 This structure holds a single symbol that has been exported from the kernel.
34 These will be patched into loaded ELF binaries at load time.
35
36 \headerfile kos/exports.h
37*/
38typedef struct export_sym {
39 const char * name; /**< \brief The name of the symbol. */
40 ptr_t ptr; /**< \brief A pointer to the symbol. */
42
43/** \cond */
44/* These are the platform-independent exports */
45extern export_sym_t kernel_symtab[];
46
47/* And these are the arch-specific exports */
48extern export_sym_t arch_symtab[];
49/** \endcond */
50
51#ifndef __EXPORTS_FILE
52#include <kos/nmmgr.h>
53
54/** \brief A symbol table "handler" for nmmgr.
55 \headerfile kos/exports.h
56*/
57typedef struct symtab_handler {
58 struct nmmgr_handler nmmgr; /**< \brief Name manager handler header */
59 export_sym_t * table; /**< \brief Location of the first entry */
61#endif
62
63/** \brief Setup initial kernel exports. */
64void export_init(void);
65
66/** \brief Look up a symbol by name.
67 \param name The symbol to look up
68 \return The export structure, or NULL on failure
69*/
70export_sym_t * export_lookup(const char * name);
71
72/** @} */
73
74__END_DECLS
75
76#endif /* __KOS_EXPORTS_H */
77
export_sym_t * export_lookup(const char *name)
Look up a symbol by name.
void export_init(void)
Setup initial kernel exports.
uint32 ptr_t
Pointer arithmetic type.
Definition types.h:52
Name manager.
A single export symbol.
Definition exports.h:38
const char * name
The name of the symbol.
Definition exports.h:39
ptr_t ptr
A pointer to the symbol.
Definition exports.h:40
A symbol table "handler" for nmmgr.
Definition exports.h:57
export_sym_t * table
Location of the first entry.
Definition exports.h:59
Common integer types.