include/temu-c/Support/Loader.h File Reference

#include <stdint.h>

Include dependency graph for Loader.h:

Go to the source code of this file.

Functions

int temu_loadImage (void *mem, const char *file)
 Loads a binary image to the memory object.
int temu_loadRelocatedImage (void *mem, const char *file, uint64_t pa)
 Loads a binary image to the memory object at the given address.
int temu_loadBinaryImage (void *mem, const char *file, uint64_t pa)
 Loads a raw binary image to the memory object at the given address.
int temu_loadElfImage (void *mem, const char *file, uint64_t pa)
int temu_loadSrecImage (void *mem, const char *file, uint64_t pa)


Function Documentation

int temu_loadBinaryImage ( void *  mem,
const char *  file,
uint64_t  pa 
)

Loads a raw binary image to the memory object at the given address.

The function will assume that the file is a raw binary. This way you can load an ELF file as is to memory (e.g. where it is expected by the boot loader).

Parameters:
mem Memory object, must conform to the mem interface.
file Path to file to load.
pa Physical address where to load the image.
Returns:
0 on success, other values indicates errors.

int temu_loadElfImage ( void *  mem,
const char *  file,
uint64_t  pa 
)

int temu_loadImage ( void *  mem,
const char *  file 
)

Loads a binary image to the memory object.

The function will autodetect the file type (based on extensions and magic headers in the file).

Binary images will be placed at address 0.

The image can be one of the supported file formats.

Parameters:
mem Memory object, must conform to the mem interface.
file Path to file to load.
Returns:
0 on success, other values indicates errors.

int temu_loadRelocatedImage ( void *  mem,
const char *  file,
uint64_t  pa 
)

Loads a binary image to the memory object at the given address.

The function will autodetect the file type (based on extensions and magic headers in the file). The binary is loaded to the given physical address (relocated). The relocation semantics is file type specific:

ELF: The content is shifted by pa - start address. I.e. the start address ends up at pa. SREC: The content is loaded to pa - start address. BIN: The content is loaded to pa.

Parameters:
mem Memory object, must conform to the mem interface.
file Path to file to load.
pa The physical address to where to load the file.
Returns:
0 on success, other values indicates errors.

int temu_loadSrecImage ( void *  mem,
const char *  file,
uint64_t  pa 
)


Generated on Wed May 27 11:00:04 2015 for T-EMU by  doxygen 1.5.6