2 Copyright (C) 2008 Mathias Gottschlag
4 Permission is hereby granted, free of charge, to any person obtaining a copy of
5 this software and associated documentation files (the "Software"), to deal in the
6 Software without restriction, including without limitation the rights to use,
7 copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8 Software, and to permit persons to whom the Software is furnished to do so,
9 subject to the following conditions:
11 The above copyright notice and this permission notice shall be included in all
12 copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16 PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 * Module/kernel symbol functions.
26 #ifndef KE_MODULE_H_INCLUDED
27 #define KE_MODULE_H_INCLUDED
29 #include "ke/multiboot.h"
32 * Reads in all kernel symbols from the multiboot information.
34 int keInitKernelSymbols(MultibootInfo
*info
);
36 * Loads all modules which are in memory.
38 int keInitModules(MultibootInfo
*info
);
41 * Resolves a memory address and returns the name/function offset. This includes
43 * \param addr Instruction address to be resolved.
44 * \param name Pointer to a variable which will be filled with the name.
45 * \param offset Pointer to an integer which will be filled with the difference
46 * between the beginning of the function and the address.
48 int keResolveAddress(uintptr_t addr
, char **name
, uintptr_t *offset
);
50 * Resolves a public kernel symbol and returns the name.
52 uintptr_t keResolveSymbol(char *name
);
54 * Resolves a memory address which is not within the kernel and returns the
55 * module/name/function offset. This includes private symbols.
56 * \todo: No function name resolving yet.
57 * \param addr Instruction address to be resolved.
58 * \param module Pointer to a variable which will be filled with the module
60 * \param name Pointer to a variable which will be filled with the name.
61 * \param offset Pointer to an integer which will be filled with the difference
62 * between the beginning of the function and the address.
65 int keResolveModuleAddress(uintptr_t addr
, char **module
, char **name
, uintptr_t *offset
);