PebbleOS v4.44.0-150-gc3023ce72
Loading...
Searching...
No Matches
loader.h File Reference
#include <stddef.h>
#include <stdint.h>

Data Structures

struct  pbl_loader_source
 Image source. More...
 
struct  pbl_loader_image
 Image layout. More...
 

Typedefs

typedef int(* pbl_loader_read_t) (void *ctx, size_t offset, void *buf, size_t len)
 Read bytes from an image source.
 
typedef uint32_t(* pbl_loader_address_t) (void *ctx, const void *addr)
 Translate an address in the loaded image to the address the image code sees.
 

Functions

int pbl_loader_copy (const struct pbl_loader_image *img, const struct pbl_loader_source *src, void *dst, size_t dst_size)
 Copy the file part of an image and zero-fill the rest of its memory.
 
int pbl_loader_relocate (const struct pbl_loader_image *img, const struct pbl_loader_source *src, void *dst, size_t dst_size, pbl_loader_address_t address, void *ctx)
 Apply the relocations of an image copied by pbl_loader_copy().