Barrelfish
|
Domain spawn functionality. More...
Data Structures | |
struct | spawninfo |
Struct to refer to the various caps within a domain being spawned. More... | |
Macros | |
#define | SPAWN_FLAGS_NEW_DOMAIN (1 << 0) |
allocate a new domain ID | |
#define | SPAWN_FLAGS_OMP (1 << 1) |
do the OpenMP parsing | |
Functions | |
__BEGIN_DECLS errval_t | spawn_get_cmdline_args (struct mem_region *module, char **retargs) |
Retrive the commandline args of #name. More... | |
int | spawn_tokenize_cmdargs (char *args, char *argv[], size_t argv_len) |
Returns tokenized cmdline args. More... | |
errval_t | spawn_load_with_bootinfo (struct spawninfo *si, struct bootinfo *bi, const char *name, coreid_t coreid) |
Spawn a domain and give it the bootinfo struct. Just monitor and memserv should be spawned using this. | |
errval_t | spawn_load_with_args (struct spawninfo *si, struct mem_region *module, const char *name, coreid_t coreid, char *const argv[], char *const envp[]) |
Spawn a domain with the given args. | |
errval_t | spawn_load_image (struct spawninfo *si, lvaddr_t binary, size_t binary_size, enum cpu_type type, const char *name, coreid_t coreid, char *const argv[], char *const envp[], struct capref inheritcn_cap, struct capref argcn_cap) |
Load an image. More... | |
errval_t | spawn_vspace_init (struct spawninfo *si, struct capref vnode, enum cpu_type cpu_type) |
Initialize the vspace for the domain being spawned. More... | |
errval_t | spawn_vspace_map_one_frame (struct spawninfo *si, genvaddr_t *retaddr, struct capref frame, size_t size) |
Map one frame anywhere. | |
errval_t | spawn_vspace_map_fixed_one_frame (struct spawninfo *si, genvaddr_t addr, struct capref frame, size_t size) |
Map one frame at the given addr. | |
errval_t | spawn_vspace_map_anon_fixed_attr (struct spawninfo *si, genvaddr_t addr, size_t size, struct vregion **vregion, struct memobj **memobj, vregion_flags_t flags) |
Return memobj and vregion for anonymous type mapping. | |
const char * | multiboot_module_rawstring (struct mem_region *region) |
Returns a raw pointer to the modules string area string. | |
const char * | multiboot_module_name (struct mem_region *region) |
returns the basename without arguments of a multiboot module | |
errval_t | spawn_map_module (struct mem_region *module, size_t *retsize, lvaddr_t *retaddr, genpaddr_t *retpaddr) |
Map in the frame caps for a module into our vspace, return their location. | |
errval_t | spawn_span_domain (struct spawninfo *si, struct capref vroot, struct capref disp_frame) |
Span a domain with the given vroot and disp_frame. More... | |
errval_t | spawn_symval_lookup_idx (uint32_t idx, char **ret_name, genvaddr_t *ret_add) |
looks up the symbol by a given index More... | |
errval_t | spawn_symval_lookup_name (char *name, uint32_t *ret_idx, genvaddr_t *ret_add) |
looks up the symbol based on its name and adds it to the cache More... | |
errval_t | spawn_symval_lookup_addr (genvaddr_t addr, uint32_t *ret_idx, char **ret_name) |
looks up the symbol information based on its address More... | |
errval_t | spawn_symval_count (uint32_t *ret_count) |
obtains the number of OpenMP symbols of the ELF file More... | |
errval_t | spawn_symval_cache_init (uint8_t lazy) |
initializes the symbol value cache for faster lookups More... | |
Domain spawn functionality.
__BEGIN_DECLS errval_t spawn_get_cmdline_args | ( | struct mem_region * | module, |
char ** | retargs | ||
) |
Retrive the commandline args of #name.
The arguments are malloced into a new space so need to be freed after use
errval_t spawn_load_image | ( | struct spawninfo * | si, |
lvaddr_t | binary, | ||
size_t | binary_size, | ||
enum cpu_type | type, | ||
const char * | name, | ||
coreid_t | coreid, | ||
char *const | argv[], | ||
char *const | envp[], | ||
struct capref | inheritcn_cap, | ||
struct capref | argcn_cap | ||
) |
Load an image.
si | Struct used by the library |
binary | The image to load |
type | The type of arch to load for |
name | Name of the image required only to place it in disp struct |
coreid | Coreid to load for, required only to place it in disp struct |
argv | Command-line arguments, NULL-terminated |
envp | Environment, NULL-terminated |
inheritcn_cap | Cap to a CNode containing capabilities to be inherited |
argcn_cap | Cap to a CNode containing capabilities passed as arguments |
Span a domain with the given vroot and disp_frame.
Operation similar to spawning a domain but the vroot and disp_frame are already provided
errval_t spawn_symval_cache_init | ( | uint8_t | lazy | ) |
initializes the symbol value cache for faster lookups
lazy | do a lazy initialization i.e. only allocate memory for the symbols but do not load them |
errval_t spawn_symval_count | ( | uint32_t * | ret_count | ) |
obtains the number of OpenMP symbols of the ELF file
ret_count | returns the number of symbols |
errval_t spawn_symval_lookup_addr | ( | genvaddr_t | addr, |
uint32_t * | ret_idx, | ||
char ** | ret_name | ||
) |
looks up the symbol information based on its address
addr | the address to lookup |
ret_idx | returns the symbol index |
ret_name | returns the symbol name |
errval_t spawn_symval_lookup_idx | ( | uint32_t | idx, |
char ** | ret_name, | ||
genvaddr_t * | ret_addr | ||
) |
looks up the symbol by a given index
idx | the index of the symbol to look up |
ret_name | returns the name of the symbol |
ret_addr | returns the address of the symbol |
errval_t spawn_symval_lookup_name | ( | char * | name, |
uint32_t * | ret_idx, | ||
genvaddr_t * | ret_addr | ||
) |
looks up the symbol based on its name and adds it to the cache
name | the name of the symbol to query |
ret_idx | returns the symbol index |
ret_addr | returns the address of the symbol |
int spawn_tokenize_cmdargs | ( | char * | s, |
char * | argv[], | ||
size_t | argv_len | ||
) |
Returns tokenized cmdline args.
s | Argument string, which is modified in place |
argv | Array to be filled-in with arguments |
argv_len | Length of array available in argv, including terminator |
The arguments are placed in #argv, which is NULL-terminated