Supports loading of binary blobs which are the result of a extraction of the text section of a shared libraries.
Certain restrictions apply to what you can do and what not in a sahred library to allow it to be converted into a module.
Module | Supports loading of binary blobs which are the result of a extraction of the text section of a shared libraries. |
Copyright | This program is free software. |
Files | |
C-kern/ | Header file Module. |
C-kern/ | Implementation file Module impl. |
Types | |
struct module_t | Export module_t into global namespace. |
Functions | |
test | |
unittest_context_module | Test module_t functionality. |
module_t | Describes the meory page where the program code is stored. |
lifetime | |
module_FREE | Static initializer. |
init_module | Maps a file as binary executable into memory whose filename is modulename. |
free_module | Unmaps a binary blob from memory. |
query | |
codeaddr_module | Returns the start address of the mapped program code. |
codesize_module | Returns the size of the mapped program code. |
inline implementation | |
Macros | |
codeaddr_module | Implements module_t.codeaddr_module. |
codesize_module | Implements module_t.codesize_module. |
This program is free software. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
© 2013 Jörg Seebohn
Header file Module.
Implementation file Module impl.
typedef struct module_t module_t
Export module_t into global namespace.
test | |
unittest_context_module | Test module_t functionality. |
int unittest_context_module( void )
Test module_t functionality.
struct module_t
Describes the meory page where the program code is stored. TODO: Support interface/version export
lifetime | |
module_FREE | Static initializer. |
init_module | Maps a file as binary executable into memory whose filename is modulename. |
free_module | Unmaps a binary blob from memory. |
query | |
codeaddr_module | Returns the start address of the mapped program code. |
codesize_module | Returns the size of the mapped program code. |
int init_module( /*out*/module_t * mod, const char * modulename )
Maps a file as binary executable into memory whose filename is modulename. The binary must be stored in a directory whose name is configured in resource/config/modulevalues with module=”module_t” and name=”DIRECTORY*. The binary is mapped as is. No relocation is done and no data segments are supproted.
Macros | |
codeaddr_module | Implements module_t.codeaddr_module. |
codesize_module | Implements module_t.codesize_module. |
#define codeaddr_module( mod ) ((mod)->code_addr)
Implements module_t.codeaddr_module.
#define codesize_module( mod ) ((mod)->code_size)
Implements module_t.codesize_module.
Export module_t into global namespace.
typedef struct module_t module_t
Describes the meory page where the program code is stored.
struct module_t
Test module_t functionality.
int unittest_context_module( void )
Static initializer.
#define module_FREE { 0, 0 }
Maps a file as binary executable into memory whose filename is modulename.
int init_module( /*out*/module_t * mod, const char * modulename )
Unmaps a binary blob from memory.
int free_module( module_t * mod )
Returns the start address of the mapped program code.
uint8_t * codeaddr_module( const module_t * mod )
Returns the size of the mapped program code.
size_t codesize_module( const module_t * mod )
Implements module_t.codeaddr_module.
#define codeaddr_module( mod ) ((mod)->code_addr)
Implements module_t.codesize_module.
#define codesize_module( mod ) ((mod)->code_size)